html_url
stringlengths
48
51
title
stringlengths
5
280
comments
stringlengths
63
51.8k
body
stringlengths
0
36.2k
comment_length
int64
16
1.52k
text
stringlengths
159
54.1k
embeddings
listlengths
768
768
https://github.com/huggingface/datasets/issues/6538
ImportError: cannot import name 'SchemaInferenceError' from 'datasets.arrow_writer' (/opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py)
Closing this issue as it is not related to the datasets library; rather, it's linked to platform-related issues.
### Describe the bug While importing from packages getting the error Code: ``` import os import torch from datasets import load_dataset, Dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, HfArgumentParser, TrainingArguments, pipeline, logging ) from peft import LoraConfig, PeftModel from trl import SFTTrainer from huggingface_hub import login import pandas as pd ``` Error: ```` --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[5], line 14 4 from transformers import ( 5 AutoModelForCausalLM, 6 AutoTokenizer, (...) 11 logging 12 ) 13 from peft import LoraConfig, PeftModel ---> 14 from trl import SFTTrainer 15 from huggingface_hub import login 16 import pandas as pd File /opt/conda/lib/python3.10/site-packages/trl/__init__.py:21 8 from .import_utils import ( 9 is_diffusers_available, 10 is_npu_available, (...) 13 is_xpu_available, 14 ) 15 from .models import ( 16 AutoModelForCausalLMWithValueHead, 17 AutoModelForSeq2SeqLMWithValueHead, 18 PreTrainedModelWrapper, 19 create_reference_model, 20 ) ---> 21 from .trainer import ( 22 DataCollatorForCompletionOnlyLM, 23 DPOTrainer, 24 IterativeSFTTrainer, 25 PPOConfig, 26 PPOTrainer, 27 RewardConfig, 28 RewardTrainer, 29 SFTTrainer, 30 ) 33 if is_diffusers_available(): 34 from .models import ( 35 DDPOPipelineOutput, 36 DDPOSchedulerOutput, 37 DDPOStableDiffusionPipeline, 38 DefaultDDPOStableDiffusionPipeline, 39 ) File /opt/conda/lib/python3.10/site-packages/trl/trainer/__init__.py:44 42 from .ppo_trainer import PPOTrainer 43 from .reward_trainer import RewardTrainer, compute_accuracy ---> 44 from .sft_trainer import SFTTrainer 45 from .training_configs import RewardConfig File /opt/conda/lib/python3.10/site-packages/trl/trainer/sft_trainer.py:23 21 import torch.nn as nn 22 from datasets import Dataset ---> 23 from datasets.arrow_writer import SchemaInferenceError 24 from datasets.builder import DatasetGenerationError 25 from transformers import ( 26 AutoModelForCausalLM, 27 AutoTokenizer, (...) 33 TrainingArguments, 34 ) ImportError: cannot import name 'SchemaInferenceError' from 'datasets.arrow_writer' (/opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py ```` transformers version: 4.36.2 python version: 3.10.12 datasets version: 2.16.1 ### Steps to reproduce the bug 1. Install packages ``` !pip install -U datasets trl accelerate peft bitsandbytes transformers trl huggingface_hub ``` 2. import packages ``` import os import torch from datasets import load_dataset, Dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, HfArgumentParser, TrainingArguments, pipeline, logging ) from peft import LoraConfig, PeftModel from trl import SFTTrainer from huggingface_hub import login import pandas as pd ``` ### Expected behavior No error while importing ### Environment info - `datasets` version: 2.16.0 - Platform: Linux-5.15.133+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.20.1 - PyArrow version: 11.0.0 - Pandas version: 2.1.4 - `fsspec` version: 2023.10.0
18
ImportError: cannot import name 'SchemaInferenceError' from 'datasets.arrow_writer' (/opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py) ### Describe the bug While importing from packages getting the error Code: ``` import os import torch from datasets import load_dataset, Dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, HfArgumentParser, TrainingArguments, pipeline, logging ) from peft import LoraConfig, PeftModel from trl import SFTTrainer from huggingface_hub import login import pandas as pd ``` Error: ```` --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[5], line 14 4 from transformers import ( 5 AutoModelForCausalLM, 6 AutoTokenizer, (...) 11 logging 12 ) 13 from peft import LoraConfig, PeftModel ---> 14 from trl import SFTTrainer 15 from huggingface_hub import login 16 import pandas as pd File /opt/conda/lib/python3.10/site-packages/trl/__init__.py:21 8 from .import_utils import ( 9 is_diffusers_available, 10 is_npu_available, (...) 13 is_xpu_available, 14 ) 15 from .models import ( 16 AutoModelForCausalLMWithValueHead, 17 AutoModelForSeq2SeqLMWithValueHead, 18 PreTrainedModelWrapper, 19 create_reference_model, 20 ) ---> 21 from .trainer import ( 22 DataCollatorForCompletionOnlyLM, 23 DPOTrainer, 24 IterativeSFTTrainer, 25 PPOConfig, 26 PPOTrainer, 27 RewardConfig, 28 RewardTrainer, 29 SFTTrainer, 30 ) 33 if is_diffusers_available(): 34 from .models import ( 35 DDPOPipelineOutput, 36 DDPOSchedulerOutput, 37 DDPOStableDiffusionPipeline, 38 DefaultDDPOStableDiffusionPipeline, 39 ) File /opt/conda/lib/python3.10/site-packages/trl/trainer/__init__.py:44 42 from .ppo_trainer import PPOTrainer 43 from .reward_trainer import RewardTrainer, compute_accuracy ---> 44 from .sft_trainer import SFTTrainer 45 from .training_configs import RewardConfig File /opt/conda/lib/python3.10/site-packages/trl/trainer/sft_trainer.py:23 21 import torch.nn as nn 22 from datasets import Dataset ---> 23 from datasets.arrow_writer import SchemaInferenceError 24 from datasets.builder import DatasetGenerationError 25 from transformers import ( 26 AutoModelForCausalLM, 27 AutoTokenizer, (...) 33 TrainingArguments, 34 ) ImportError: cannot import name 'SchemaInferenceError' from 'datasets.arrow_writer' (/opt/conda/lib/python3.10/site-packages/datasets/arrow_writer.py ```` transformers version: 4.36.2 python version: 3.10.12 datasets version: 2.16.1 ### Steps to reproduce the bug 1. Install packages ``` !pip install -U datasets trl accelerate peft bitsandbytes transformers trl huggingface_hub ``` 2. import packages ``` import os import torch from datasets import load_dataset, Dataset from transformers import ( AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, HfArgumentParser, TrainingArguments, pipeline, logging ) from peft import LoraConfig, PeftModel from trl import SFTTrainer from huggingface_hub import login import pandas as pd ``` ### Expected behavior No error while importing ### Environment info - `datasets` version: 2.16.0 - Platform: Linux-5.15.133+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.20.1 - PyArrow version: 11.0.0 - Pandas version: 2.1.4 - `fsspec` version: 2023.10.0 Closing this issue as it is not related to the datasets library; rather, it's linked to platform-related issues.
[ -0.2569026052951813, -0.06662440299987793, -0.055801644921302795, 0.6121094822883606, 0.27489668130874634, 0.06340041011571884, 0.244042307138443, 0.24720148742198944, -0.019955817610025406, 0.11987872421741486, -0.1381203830242157, 0.3893900513648987, -0.1408829241991043, 0.10076155513525009, -0.32404398918151855, -0.326165109872818, 0.03916265815496445, 0.21027511358261108, -0.25826719403266907, -0.025113213807344437, -0.13907375931739807, 0.13409431278705597, -0.1727447509765625, 0.2468520849943161, -0.425018846988678, -0.26558542251586914, 0.24698156118392944, 0.030495136976242065, -0.4435822367668152, -0.3970082104206085, 0.24750690162181854, -0.23104041814804077, 0.37677860260009766, 0.6055505871772766, -0.00011488999734865502, 0.19208462536334991, 0.32309967279434204, -0.10012717545032501, -0.18276384472846985, -0.26851093769073486, -0.10362564027309418, 0.031067365780472755, 0.2166559398174286, -0.10153042525053024, 0.21615874767303467, 0.0005404278635978699, -0.2749485969543457, -0.20352394878864288, 0.2566177248954773, 0.5264045596122742, 0.2563377916812897, 0.264560729265213, 0.43410059809684753, -0.11921686679124832, -0.06146686524152756, -0.09233070909976959, -0.24444074928760529, 0.15163972973823547, -0.12952512502670288, 0.0448492169380188, 0.005928516387939453, 0.33586910367012024, -0.028897834941744804, 0.1583632379770279, 0.3225533962249756, -0.16028232872486115, 0.11113861203193665, -0.44104495644569397, 0.01453595981001854, 0.05212906748056412, 0.7370858788490295, -0.3695688545703888, -0.4370405972003937, 0.15414732694625854, 0.14453907310962677, 0.042078688740730286, 0.1804107427597046, 0.10252571851015091, -0.23504281044006348, 0.13352841138839722, 0.2321053296327591, -0.11182110756635666, -0.37119460105895996, -0.15580826997756958, -0.20775450766086578, 0.28189224004745483, -0.07928590476512909, 0.05331489071249962, 0.08881208300590515, -0.17495158314704895, 0.8017529845237732, 0.0018245168030261993, -0.24544423818588257, 0.19523738324642181, -0.46608632802963257, -0.11735107749700546, -0.020867541432380676, 0.014490477740764618, -0.3216080963611603, 0.08730141073465347, 0.1457758992910385, -0.08641453087329865, 0.09756247699260712, 0.24484804272651672, 0.0834505558013916, 0.09961149096488953, 0.10073820501565933, 0.569821298122406, 0.07114998251199722, -0.03231752663850784, 0.05505329743027687, -0.09617462009191513, -0.24876052141189575, -0.4074490964412689, -0.024744972586631775, -0.1836465299129486, 0.24613715708255768, -0.11243551969528198, -0.30685704946517944, 0.14300665259361267, -0.19277086853981018, -0.04361426457762718, -0.021950632333755493, 0.40578988194465637, -0.02127387747168541, 0.28545451164245605, 0.31094586849212646, 0.15615591406822205, 0.12214308232069016, 0.12312240153551102, -0.20654644072055817, 0.33852919936180115, -0.14966566860675812, -0.12863647937774658, -0.12041686475276947, -0.061614204198122025, 0.2588486969470978, -0.11313829571008682, -0.08800935745239258, -0.1768268197774887, -0.014623811468482018, -0.33047065138816833, 0.020192407071590424, 0.193961501121521, -0.06595350801944733, 0.04192189872264862, 0.24863018095493317, -0.25377732515335083, -0.1377229392528534, -0.05962521582841873, -0.34622451663017273, -0.1618194282054901, -0.4648599922657013, 0.19620993733406067, 0.05868689715862274, -0.15151400864124298, -0.08748704940080643, -0.45019474625587463, 0.18756401538848877, 0.05569217726588249, -0.005037784576416016, -0.19469648599624634, 0.10776232182979584, -0.014502011239528656, -0.034264665096998215, 0.34109005331993103, -0.39453181624412537, -0.0010113343596458435, 0.38095518946647644, -0.1595524400472641, -0.02658439427614212, 0.12249135971069336, -0.09577812999486923, 0.39026105403900146, -0.09571188688278198, -0.15573164820671082, 0.5678081512451172, -0.5921732783317566, -0.2660873830318451, 0.05019434913992882, -0.04213884472846985, -0.14474298059940338, 0.36950328946113586, -0.06576823443174362, -0.0394737534224987, 0.07813965529203415, 0.08266071230173111, 0.14434413611888885, 0.025287017226219177, 0.03669627010822296, -0.06944020092487335, -0.11206161230802536, 0.07201462984085083, 0.14143039286136627, 0.14674223959445953, 0.03374384343624115, 0.09996700286865234, 0.06819672137498856, 0.32104983925819397, -0.055073756724596024, -0.04141668975353241, 0.6366986632347107, 0.1728818118572235, 0.2089124172925949, 0.04611876979470253, -0.2587151825428009, -0.09337212890386581, 0.0966954156756401, -0.09548298269510269, 0.20620664954185486, -0.5495564937591553, 0.03902240842580795, -0.28502601385116577, 0.3546812832355499, -0.30130529403686523, -0.17267519235610962, 0.14956863224506378, 0.11204643547534943, 0.15216074883937836, 0.08011522889137268, -0.05253683403134346, 0.44992563128471375, -0.26844125986099243, 0.3102838099002838, -0.39345720410346985, 0.34761694073677063, -0.32308483123779297, -0.31270357966423035, 0.04742029309272766, 0.17949047684669495, 0.024486016482114792, -0.04163537546992302, -0.3031940162181854, 0.1640666425228119, 0.04536639526486397, 0.20532070100307465, -0.3108333647251129, -0.03053314983844757, -0.002520183101296425, -0.27089688181877136, 0.029110286384820938, -0.11259260773658752, 0.31119292974472046, 0.10925493389368057, 0.0567718967795372, -0.04140560328960419, -0.08252988755702972, 0.32018303871154785, 0.15477576851844788, 0.22164945304393768, 0.2683151662349701, 0.047718096524477005, 0.12539058923721313, -0.239680215716362, 0.017539501190185547, 0.18916191160678864, 0.21758697926998138, 0.12453337013721466, -0.02024974301457405, -0.3259885013103485, 0.38412877917289734, 0.16331563889980316, -0.023884668946266174, -0.06235867738723755, -0.22122198343276978, 0.25033870339393616, 0.3229474425315857, 0.37076547741889954, 0.35874032974243164, 0.0980670303106308, -0.26626551151275635, 0.11245923489332199, 0.07017218321561813, -0.07234814763069153, 0.2630460858345032, 0.1803169548511505, 0.37655043601989746, 0.25856760144233704, 0.016931530088186264, 0.12798215448856354, -0.13936060667037964, -0.4716644287109375, -0.10985520482063293, 0.3701164722442627, -0.29064515233039856, -0.001737937331199646, -0.1279350221157074, -0.05703883618116379, -0.3960554003715515, -0.026670392602682114, -0.1569133996963501, -0.2648874819278717, -0.42730623483657837, 0.3287534713745117, -0.0548814982175827, 0.29113075137138367, -0.19480343163013458, -0.24224211275577545, 0.19393372535705566, -0.1221851333975792, -0.19032303988933563, -0.3616560995578766, 0.08080095052719116, 0.034584496170282364, 0.18995390832424164, 0.1496809422969818, 0.3307647109031677, -0.1079229861497879, 0.2957944869995117, -0.31718528270721436, -0.23514124751091003, 0.14393962919712067, -0.03864448517560959, -0.034761399030685425, 0.3126857876777649, 0.18780657649040222, 0.2566010355949402, -0.5176387429237366, 0.09446368366479874, -0.14445340633392334, -0.1891447901725769, 0.08693953603506088, -0.0527481772005558, -0.18511635065078735, 0.12090449035167694, -0.25175803899765015, -0.4811355471611023, -0.5694223046302795, 0.13440591096878052, 0.24150891602039337, 0.08420393615961075, 0.26392337679862976, 0.15868696570396423, 0.31294819712638855, 0.08068420737981796, 0.41444987058639526, 0.23354269564151764, -0.07358387112617493, 0.30034512281417847, -0.1543540358543396, -0.26620209217071533, 0.05075203254818916, -0.09570375829935074, 0.44102582335472107, -0.02755935862660408, -0.350641667842865, -0.13104456663131714, -0.24551410973072052, 0.16854572296142578, -0.1461600810289383, 0.2192198634147644, 0.3787780702114105, 0.4142231345176697, 0.004856022074818611, -0.10502444207668304, 0.0929865837097168, -0.03882121294736862, -0.274708092212677, -0.06299754232168198, -0.016449451446533203, 0.43773573637008667, -0.1966346949338913, 0.2570459246635437, 0.23741203546524048, -0.16500267386436462, 0.2373635321855545, 0.0895581990480423, 0.2865935266017914, -0.16709119081497192, -0.27347806096076965, -0.17229457199573517, -0.1809961497783661, 0.1060645580291748, -0.04750804603099823, -0.24346596002578735, -0.01947096176445484, -0.12351558357477188, -0.062418848276138306, -0.043493133038282394, -0.0273725725710392, -0.073729008436203, -0.42088571190834045, 0.23319083452224731, -0.08653110265731812, -0.06325065344572067, -0.1703769564628601, 0.036015987396240234, 0.18266405165195465, 0.044900938868522644, -0.140200674533844, -0.07022388279438019, -0.2805652618408203, -0.02785993181169033, -0.2964317798614502, 0.09792309254407883, 0.13958671689033508, 0.3668660819530487, 0.1117226779460907, -0.05322965979576111, 0.06627201288938522, 0.006396125070750713, 0.21520835161209106, -0.18715520203113556, -0.23747415840625763, 0.14924649894237518, -0.06803737580776215, -0.44537535309791565, -0.03558800369501114, -0.16861145198345184, 0.08980216830968857, 0.15014390647411346, 0.19179147481918335, -0.06652412563562393, -0.17009854316711426, 0.45212140679359436, 0.06473730504512787, -0.1161901205778122, -0.03079143539071083, -0.15608473122119904, -0.3060140013694763, -0.3745065927505493, -0.0787692591547966, 0.25925925374031067, 0.4649043381214142, 0.28632909059524536, 0.19665169715881348, -0.29558971524238586, -0.12551353871822357, -0.04865168035030365, 0.028419610112905502, 0.19002613425254822, -0.04672900214791298, 0.0954892635345459, 0.0805637389421463, 0.3972300887107849, 0.5442343950271606, 0.6393275856971741, -0.35644593834877014, -0.5447496771812439, -0.05768252909183502, -0.17036187648773193, 0.3061316907405853, 0.042328305542469025, -0.09967072308063507, 0.19207635521888733, -0.49685612320899963, 0.014718234539031982, -0.08922392129898071, -0.04809844121336937, 0.06300978362560272, 0.16771535575389862, -0.18332259356975555, -0.2414659559726715, 0.3640117049217224, 0.25124967098236084, 0.05983537435531616, 0.46670398116111755, 0.2392403781414032, -0.38408681750297546, 0.47856760025024414, 0.11168108880519867, 0.771072268486023, 0.24745997786521912, 0.10733512043952942, 0.2562344968318939, -0.44009292125701904, 0.2782886028289795, -0.009791269898414612, -0.013260608538985252, -0.44002673029899597, -0.2337634563446045, -0.01054738275706768, -0.23394089937210083, 0.3223820924758911, -0.13457418978214264, -0.1893022209405899, 0.057696182280778885, -0.23671060800552368, -0.11946357786655426, 0.12738807499408722, 0.1503719836473465, -0.09924189746379852, -0.1841556876897812, -0.15610383450984955, 0.09696324169635773, 0.16927611827850342, 0.10973066091537476, -0.11566175520420074, -0.03951516002416611, -0.1755988597869873, -0.3215962052345276, -0.21222418546676636, 0.19046542048454285, -0.3982679545879364, 0.4196787476539612, 0.1574944406747818, -0.2001783698797226, 0.23643603920936584, 0.45393553376197815, 0.18932737410068512, -0.1055028885602951, -0.11277563869953156, 0.14423643052577972, 0.11200088262557983, -0.1620911955833435, 0.07247602939605713, 0.2463330626487732, 0.38906434178352356, -0.07430322468280792, 0.03419830650091171, 0.3885520100593567, -0.18327194452285767, -0.40027981996536255, 0.14202311635017395, 0.06764008104801178, 0.04324626922607422, -0.2300715297460556, -0.20149101316928864, -0.174839049577713, -0.05476342514157295, -0.17514744400978088, 0.14702340960502625, 0.03132959455251694, -0.3554784059524536, 0.13708817958831787, -0.17109999060630798, -0.34396862983703613, 0.01698911190032959, 0.3831446170806885, 0.18987056612968445, 0.04016687721014023, 0.614180326461792, 0.07355925440788269, -0.25458818674087524, -0.2138848602771759, 0.13359490036964417, 0.19124913215637207, -0.6223501563072205, 0.1904216706752777, -0.02141658402979374, -0.27320611476898193, -0.029417920857667923, 0.3728376626968384, 0.2495023012161255, 0.07783515751361847, -0.17882293462753296, -0.24607938528060913, -0.42848554253578186, 0.11749082058668137, 0.04444228485226631, 0.22140870988368988, -0.37719857692718506, 0.2194167673587799, -0.1711081862449646, 0.1031775176525116, -0.29550567269325256, -0.026355748996138573, -0.5316577553749084, 0.14548388123512268, 0.22247985005378723, -0.015324316918849945, -0.15028510987758636, -0.021511036902666092, 0.1400277465581894, 0.2930784821510315, -0.09902147948741913, -0.17725837230682373, -0.15965275466442108, 0.09779375046491623, 0.19002357125282288, -0.14165794849395752, 0.00005952594801783562, -0.014029864221811295, -0.07470057904720306, -0.019229566678404808, -0.08337247371673584, 0.2656904458999634, -0.0025573372840881348, 0.16257108747959137, 0.1595553159713745, -0.03337572515010834, -0.26804184913635254, 0.24136605858802795, -0.16095425188541412, 0.2795291543006897, -0.20764587819576263, 0.2113105058670044, -0.09595111757516861, 0.09591695666313171, -0.05292640998959541, 0.09137208759784698, -0.1703520268201828, -0.052580155432224274, 0.2903684079647064, -0.3428812026977539, -0.015550490468740463, 0.18389151990413666, 0.22407053411006927, 0.22856087982654572, -0.343689888715744, 0.01269080676138401, 0.14790844917297363, 0.2381799966096878, -0.28956541419029236, -0.16199710965156555, -0.11132696270942688, -0.2829519808292389, 0.03940610960125923, 0.15308916568756104, -0.06062771752476692, -0.12041807919740677, 0.280824214220047, 0.264636754989624, 0.20148847997188568, -0.11933872103691101, 0.40105122327804565, 0.3233988583087921, -0.13719579577445984, -0.04563354328274727, 0.5149921178817749, 0.24320144951343536, 0.26740285754203796, 0.32430553436279297, -0.12012120336294174, 0.1913459748029709, -0.39380523562431335, -0.08652566373348236, 0.13271650671958923, -0.15006910264492035, 0.07412684708833694, -0.30742618441581726, -0.016707107424736023, -0.19194525480270386, -0.12525461614131927, -0.05134870857000351, -0.052303511649370193, -0.06941892206668854, 0.00046330131590366364, 0.07868146896362305, -0.2117464542388916, -0.026525361463427544, 0.027291610836982727, -0.14084987342357635, -0.10010280460119247, -0.0014865174889564514, 0.1519307643175125, -0.03160548210144043, 0.141983762383461, 0.07675088196992874, -0.25749969482421875, -0.26734116673469543, 0.0347667820751667, 0.1659720540046692, 0.03169555962085724, -0.40021389722824097, 0.15680864453315735, -0.03142896294593811, -0.0470065176486969, -0.2851220369338989, 0.433237761259079, 0.5774031281471252, 0.4171214699745178, 0.10439246892929077, -0.049284838140010834, -0.07951278984546661, -0.15137651562690735, 0.13028527796268463, 0.32732269167900085, -0.07780224084854126, 0.22529911994934082, 0.3888446092605591, 0.15440931916236877, -0.2408878654241562, -0.07401253283023834, 0.07731544226408005, 0.22244562208652496, -0.26429277658462524, 0.5152063965797424, -0.024254482239484787, -0.33644458651542664, 0.012548839673399925, 0.15210384130477905, -0.4033682942390442, 0.194766566157341, 0.4406995475292206, -0.18382306396961212, 0.018053025007247925, -0.33213964104652405, 0.0653381422162056, 0.03727583959698677, 0.6124904751777649, 0.4852130115032196, 0.3351706266403198, -0.15982896089553833, -0.16731759905815125, -0.31288033723831177, 0.1869906783103943, -0.11246560513973236, 0.03628390282392502, 0.013686916790902615, 0.06751824170351028, 0.04187135025858879, 0.1565743386745453, 0.18706801533699036, 0.22109173238277435, -0.2763955295085907, 0.026084527373313904, -0.3880603611469269, -0.24558119475841522, 0.10810892283916473, -0.038847245275974274, 0.08636340498924255, -0.5342229604721069, 0.09064970910549164, -0.08244766294956207, 0.16404205560684204, -0.284659743309021, -0.05425644293427467, 0.20082272589206696, -0.19790229201316833, 0.45428910851478577, -0.054780423641204834, 0.45950427651405334, 0.020229995250701904, -0.15616236627101898, -0.1395646631717682, -0.5568039417266846, -0.2812892496585846, 0.17513680458068848, 0.3284692168235779, 0.42261803150177, -0.18614020943641663, -0.3810907304286957, -0.3425791263580322, 0.13387219607830048, -0.20194588601589203, 0.10682006925344467, -0.16240744292736053, 0.17728842794895172, -0.040892135351896286, 0.1151123121380806, 0.19150260090827942, -0.09540460258722305, -0.028515182435512543, 0.19460982084274292, -0.26383236050605774, -0.3892170190811157, 0.4156479835510254, -0.1845732480287552, -0.31621113419532776, 0.15280845761299133, 0.1361369639635086, -0.0953708067536354, -0.08400629460811615, -0.5766761898994446, 0.23468521237373352, 0.3238639533519745, -0.09576001763343811, -0.12282322347164154, 0.2379458248615265, 0.33038243651390076, 0.1165195107460022, -0.046697940677404404, 0.34432128071784973, -0.12160823494195938, -0.010211879387497902, 0.05064908042550087, -0.1150670275092125 ]
https://github.com/huggingface/datasets/issues/6537
Adding support for netCDF (*.nc) files
Conceptually, we can use xarray to load the netCDF file, then xarray -> pandas -> pyarrow.
### Feature request netCDF (*.nc) is a file format for storing multidimensional scientific data, which is used by packages like `xarray` (labelled multi-dimensional arrays in Python). It would be nice to have native support for netCDF in `datasets`. ### Motivation When uploading *.nc files onto Huggingface Hub through the `datasets` API, I would like to be able to preview the dataset without converting it to another format. ### Your contribution I can submit a PR, provided I have the time.
16
Adding support for netCDF (*.nc) files ### Feature request netCDF (*.nc) is a file format for storing multidimensional scientific data, which is used by packages like `xarray` (labelled multi-dimensional arrays in Python). It would be nice to have native support for netCDF in `datasets`. ### Motivation When uploading *.nc files onto Huggingface Hub through the `datasets` API, I would like to be able to preview the dataset without converting it to another format. ### Your contribution I can submit a PR, provided I have the time. Conceptually, we can use xarray to load the netCDF file, then xarray -> pandas -> pyarrow.
[ -0.38227784633636475, -0.145077645778656, -0.011451074853539467, 0.0008690357208251953, -0.07568597048521042, 0.011975705623626709, -0.23382778465747833, 0.4031374752521515, -0.12558536231517792, 0.27975356578826904, -0.4577072560787201, 0.04672297090291977, -0.45220473408699036, 0.5326219201087952, 0.2755899429321289, -0.003233160823583603, 0.27366387844085693, 0.3930759131908417, 0.02949531003832817, 0.29211390018463135, -0.21149595081806183, 0.057186707854270935, -0.32592570781707764, 0.04001378268003464, -0.418683260679245, -0.07334337383508682, -0.26976075768470764, 0.11645194888114929, -0.31249701976776123, -0.5245508551597595, 0.38697460293769836, 0.6018680334091187, 0.4234752357006073, 0.4160575270652771, -0.0001273650850635022, -0.08668366074562073, 0.20638898015022278, -0.0037869010120630264, -0.20202474296092987, -0.0011565536260604858, 0.1857496201992035, -0.1965184360742569, 0.23781466484069824, -0.15236730873584747, -0.30033746361732483, -0.3974454998970032, 0.1284143328666687, 0.08319619297981262, 0.15361261367797852, 0.022421415895223618, 0.034307029098272324, 0.49500998854637146, -0.05478717386722565, -0.051135893911123276, -0.3007025122642517, 0.547809362411499, -0.38871002197265625, 0.5127073526382446, 0.43898913264274597, -0.014702118933200836, -0.07540664821863174, 0.09133511781692505, -0.12100611627101898, -0.23094488680362701, 0.5278093218803406, 0.07864566147327423, -0.015418566763401031, -0.22246921062469482, -0.19811981916427612, 0.29658034443855286, 0.4732939600944519, -0.33544084429740906, -0.45522722601890564, -0.3139250874519348, -0.002850194461643696, -0.19338084757328033, -0.11160711199045181, 0.2098071575164795, -0.14039309322834015, 0.41716209053993225, -0.28591445088386536, -0.26243242621421814, -0.4137355387210846, 0.28333163261413574, -0.10568413138389587, 0.3065947890281677, -0.12256346642971039, -0.07108446210622787, 0.3273018002510071, -0.06378954648971558, 0.22771449387073517, -0.3597292900085449, 0.13584673404693604, 0.0890594944357872, -0.30672353506088257, -0.3186974823474884, -0.06591848284006119, 0.23701566457748413, 0.22151511907577515, -0.04482971131801605, 0.1306704431772232, 0.20510944724082947, -0.6024088263511658, 0.08569397032260895, 0.08943630754947662, -0.11058591306209564, 0.20541542768478394, 0.353291779756546, 0.38902395963668823, 0.07381736487150192, 0.4344851076602936, -0.011641085147857666, -0.22462233901023865, 0.26375678181648254, -0.3856547176837921, -0.18421980738639832, 0.11610673367977142, -0.21619866788387299, 0.11742981523275375, -0.13615460693836212, 0.5848819613456726, 0.2380298376083374, 0.2284109890460968, 0.30863434076309204, 0.06060423329472542, 0.1459655463695526, -0.14748811721801758, 0.464844286441803, 0.12369462102651596, -0.3070164620876312, -0.007595997303724289, -0.13021884858608246, -0.1508275419473648, 0.06442144513130188, 0.27967754006385803, -0.030102837830781937, -0.1700417846441269, -0.20393173396587372, 0.44769054651260376, 0.2645628750324249, -0.22932441532611847, 0.03948013857007027, 0.15995557606220245, 0.1251991242170334, -0.38976454734802246, 0.1730993688106537, 0.010900415480136871, 0.11403822898864746, -0.28797370195388794, 0.1348554790019989, -0.12682223320007324, -0.049845531582832336, -0.47655045986175537, -0.1018405631184578, -0.10692857950925827, 0.04049128666520119, -0.3245874047279358, 0.15466223657131195, -0.441363126039505, -0.47298336029052734, -0.03492753952741623, -0.16307684779167175, -0.4697894752025604, -0.38315510749816895, 0.0895540863275528, 0.13813434541225433, -0.07713377475738525, -0.025487270206212997, 0.0003894539549946785, -0.1333448737859726, 0.07562978565692902, 0.23344391584396362, -0.17559221386909485, 0.02893798053264618, -0.38741809129714966, 0.34767651557922363, 0.36627262830734253, -0.5261172652244568, -0.1433553397655487, 0.1851874589920044, 0.0644238144159317, 0.13362959027290344, -0.06529710441827774, 0.3793594241142273, 0.18850170075893402, -0.25414279103279114, -0.07049085199832916, 0.2738271951675415, 0.08588369935750961, -0.018861670047044754, -0.039847396314144135, -0.4094996750354767, 0.026346027851104736, 0.3451123535633087, -0.011076670140028, 0.16184981167316437, 0.265365868806839, -0.4876963198184967, 0.3819649815559387, -0.41757771372795105, 0.11683087050914764, 0.04461735859513283, -0.12179994583129883, -0.007217288017272949, -0.09616188704967499, -0.38177868723869324, -0.761704683303833, 0.39789220690727234, -0.02917105332016945, -0.0425572395324707, -0.2771173119544983, -0.44178318977355957, -0.06290291249752045, -0.03454015031456947, -0.08247742056846619, -0.05765188857913017, -0.04855561628937721, 0.011756323277950287, 0.2814818322658539, 0.33854323625564575, -0.24517226219177246, 0.39608505368232727, 0.040571704506874084, 0.2187480628490448, -0.1081489771604538, 0.4403989613056183, 0.13699722290039062, 0.005269565619528294, 0.2570561468601227, 0.2888356149196625, -0.06273772567510605, -0.10063869506120682, 0.04477150738239288, 0.3194522559642792, -0.5240404605865479, 0.08271244168281555, 0.09661366045475006, 0.5493350625038147, 0.2536076009273529, -0.3437272012233734, 0.3368058502674103, -0.0024911724030971527, -0.05453046038746834, -0.18579325079917908, -0.12013504654169083, 0.398351788520813, -0.16556167602539062, -0.1546432375907898, -0.16803237795829773, -0.02069641463458538, 0.011174926534295082, 0.17442883551120758, -0.020980440080165863, 0.014467410743236542, 0.1362837553024292, 0.10797876119613647, 0.20889171957969666, -0.23328755795955658, -0.3549335300922394, 0.006377749145030975, 0.19049377739429474, -0.19664479792118073, 0.13667188584804535, 0.21212062239646912, -0.285299688577652, 0.24455007910728455, 0.2515670359134674, -0.04346763715147972, 0.28644219040870667, 0.12376390397548676, 0.15738998353481293, 0.17393378913402557, -0.20892482995986938, 0.015589870512485504, 0.03262248635292053, -0.07037071883678436, 0.0719665139913559, 0.04266929626464844, -0.05075306072831154, -0.013493661768734455, -0.27965813875198364, -0.2366526871919632, -0.1352183222770691, -0.11413460969924927, -0.11190827935934067, 0.11468478292226791, -0.2917361259460449, -0.5802803039550781, -0.016151458024978638, 0.032530758529901505, -0.1309479922056198, -0.03940829634666443, -0.01324053481221199, 0.33000388741493225, -0.03216671943664551, 0.010184344835579395, -0.276296466588974, 0.4414975643157959, 0.006800783798098564, -0.23265321552753448, -0.2314380556344986, 0.08271703869104385, -0.10102901607751846, -0.04034816473722458, 0.3718584477901459, 0.030754724517464638, 0.43620482087135315, 0.09520377963781357, 0.4560506343841553, -0.2979298233985901, -0.13703827559947968, 0.0418926402926445, 0.05224958062171936, 0.1398669183254242, 0.010608144104480743, -0.014036618173122406, -0.28805968165397644, 0.02602849155664444, -0.046942710876464844, -0.3861047923564911, 0.0055031366646289825, -0.030703937634825706, 0.015230588614940643, -0.10661637037992477, -0.3408429026603699, 0.24928215146064758, -0.49225151538848877, -0.41850078105926514, 0.2641352415084839, -0.28671079874038696, 0.0808030366897583, 0.22620569169521332, -0.17447267472743988, 0.04988770931959152, -0.3042738437652588, -0.26745688915252686, 0.07006669789552689, -0.2425781637430191, 0.4987800121307373, -0.2536590099334717, -0.45243480801582336, -0.051209792494773865, -0.25379717350006104, 0.041715916246175766, 0.05395607650279999, -0.001158207654953003, -0.04957615211606026, -0.15641726553440094, 0.3385984003543854, 0.13680008053779602, 0.036234136670827866, 0.2832675278186798, -0.22131188213825226, 0.08586025983095169, -0.060898229479789734, 0.001395171508193016, -0.22896668314933777, 0.14272010326385498, -0.0957462266087532, 0.2620570659637451, -0.41250085830688477, 0.02906143292784691, -0.03285166621208191, 0.1350170224905014, -0.05702139064669609, 0.2614828944206238, -0.029660334810614586, 0.5106894969940186, 0.07323306798934937, -0.07710936665534973, -0.048264842480421066, 0.0025141537189483643, 0.07046815007925034, 0.44436007738113403, 0.23632922768592834, -0.08413629978895187, -0.14522269368171692, -0.2648329436779022, -0.25584283471107483, -0.09319376945495605, 0.11112654954195023, 0.1504613757133484, 0.33965346217155457, 0.030241023749113083, -0.03674927353858948, 0.01995263248682022, -0.46361061930656433, -0.05094170942902565, 0.48787593841552734, 0.03209321200847626, 0.0036059340927749872, -0.3648670017719269, -0.07955403625965118, -0.5242965221405029, 0.24556374549865723, 0.3184221088886261, 0.16345109045505524, 0.08093860745429993, 0.4108019173145294, 0.05545058101415634, 0.2541182339191437, 0.7427006959915161, -0.31807753443717957, -0.26067978143692017, 0.20103642344474792, 0.11480757594108582, -0.3110896050930023, 0.09436056017875671, -0.20733805000782013, 0.10414066910743713, -0.119113489985466, 0.1619379222393036, 0.0583411380648613, -0.2828844487667084, -0.03137771040201187, 0.3377772867679596, -0.046666406095027924, -0.14535662531852722, -0.015618983656167984, 0.0873878076672554, -0.31320953369140625, -0.14095920324325562, 0.08004242926836014, -0.14057821035385132, -0.20862072706222534, -0.169260174036026, -0.01039368286728859, 0.07354358583688736, 0.24047695100307465, 0.15983828902244568, 0.33697986602783203, 0.193575918674469, -0.013180786743760109, 0.41470280289649963, 0.09078527987003326, 0.05244167149066925, 0.3512408137321472, 0.29463231563568115, -0.14079473912715912, -0.052715592086315155, 0.04269126057624817, 0.2727016508579254, 0.4158899486064911, 0.05966298282146454, 0.03199710324406624, -0.01814204454421997, 0.08554394543170929, -0.4714909791946411, 0.2872218191623688, 0.1969931572675705, -0.07517001032829285, -0.675534188747406, -0.05470278114080429, 0.7160316705703735, 0.1359771490097046, -0.1260521560907364, 0.3344423174858093, 0.5218810439109802, -0.06984615325927734, -0.08296415954828262, -0.08387397974729538, 1.067365288734436, -0.3907729983329773, 0.33145880699157715, 0.37980353832244873, -0.3755234479904175, 0.7052422165870667, -0.16071370244026184, 0.005404618568718433, -0.3218669295310974, -0.048455748707056046, -0.2068667858839035, -0.08305774629116058, 0.3002086877822876, 0.09416425228118896, -0.2642785608768463, 0.286334753036499, 0.41279923915863037, 0.24261096119880676, 0.046187594532966614, 0.1880875527858734, 0.10159032046794891, -0.4035191237926483, -0.05654342472553253, 0.00428013876080513, -0.12819020450115204, -0.06956823170185089, -0.19300588965415955, -0.2709810733795166, -0.1982417106628418, 0.07098415493965149, -0.10136336088180542, -0.04032430425286293, 0.18986617028713226, 0.13876281678676605, 0.17078366875648499, -0.10235001146793365, 0.24416324496269226, 0.34487980604171753, 0.32797902822494507, -0.029491733759641647, -0.5312147736549377, -0.10680252313613892, -0.42352741956710815, 0.020618218928575516, -0.14118535816669464, -0.16700579226016998, 0.3463529050350189, 0.06407257914543152, -0.14364513754844666, 0.08723573386669159, 0.17386798560619354, -0.2615676522254944, -0.09695848822593689, 0.1435772180557251, 0.21221056580543518, -0.2025470733642578, -0.13716110587120056, -0.11607332527637482, -0.07987695932388306, 0.07737159729003906, -0.011582748964428902, 0.32293158769607544, 0.18547311425209045, 0.1000465676188469, 0.2079378068447113, 0.08376865088939667, -0.07192964851856232, 0.0999569296836853, 0.07063139975070953, -0.5591415166854858, -0.0024972669780254364, -0.021969644352793694, -0.3021070957183838, -0.04482557252049446, 0.039028652012348175, 0.014670313335955143, -0.26309433579444885, 0.022581443190574646, 0.10385952144861221, 0.0976724624633789, -0.034324903041124344, 0.304962694644928, 0.13384497165679932, -0.3773573040962219, -0.041657954454422, -0.14291070401668549, -0.17981822788715363, 0.2847557067871094, -0.36963582038879395, 0.39748749136924744, 0.1814013123512268, 0.22005215287208557, -0.0583750456571579, -0.1626019924879074, -0.14984390139579773, 0.06595233827829361, 0.17955568432807922, 0.04114747792482376, 0.4207998812198639, 0.2577221095561981, 0.15178631246089935, -0.31589648127555847, -0.11760634928941727, 0.2075572907924652, -0.3568441569805145, -0.015249480493366718, -0.1171889454126358, 0.2551921010017395, 0.09261476993560791, -0.1237824484705925, 0.06520187109708786, -0.17854028940200806, -0.029188644140958786, -0.23365174233913422, 0.054559703916311264, -0.053441375494003296, -0.03728383034467697, 0.27771347761154175, 0.006129555404186249, 0.15068842470645905, -0.08852449059486389, 0.362927109003067, 0.1486765742301941, 0.5398852229118347, -0.09939052909612656, 0.08885138481855392, -0.3611094355583191, -0.18689066171646118, -0.07670401781797409, 0.1967628449201584, 0.12825214862823486, -0.1939370036125183, 0.4143386483192444, -0.038544662296772, 0.0743291825056076, 0.05288021266460419, 0.5771950483322144, 0.014015890657901764, -0.27342167496681213, -0.1067165657877922, 0.46893155574798584, -0.04299435764551163, -0.0972890555858612, -0.25453969836235046, 0.38703763484954834, 0.004123112186789513, 0.07294535636901855, 0.2976726293563843, 0.4077029824256897, -0.08705030381679535, 0.014176823198795319, -0.11730921268463135, -0.040032945573329926, 0.20019374787807465, 0.10289843380451202, 0.564868152141571, 0.2992900311946869, -0.01706020161509514, 0.18766053020954132, 0.18203479051589966, 0.17202389240264893, 0.8800267577171326, -0.1204068586230278, 0.22729910910129547, 0.061170801520347595, 0.2949402332305908, 0.11798864603042603, -0.2845805287361145, 0.18711398541927338, 0.022525310516357422, 0.05491410195827484, 0.19218644499778748, -0.049728021025657654, 0.052953559905290604, -0.25166055560112, -0.17955927550792694, -0.18326672911643982, 0.2025594860315323, -0.07197822630405426, 0.22696970403194427, 0.1994648426771164, -0.07099946588277817, 0.05946996808052063, -0.0035859979689121246, -0.3177821636199951, -0.06291890144348145, 0.0584077388048172, 0.1296841949224472, 0.1916954219341278, -0.05634359270334244, 0.376725971698761, 0.37591052055358887, 0.32219305634498596, -0.16588352620601654, -0.058961838483810425, 0.25835347175598145, 0.03019591048359871, 0.1370963603258133, 0.27178695797920227, 0.35336679220199585, 0.04215838760137558, 0.12303337454795837, 0.15127529203891754, -0.3505842387676239, -0.044208116829395294, 0.22205492854118347, -0.14934158325195312, 0.1539343297481537, 0.2893011271953583, 0.2755443751811981, -0.034833893179893494, 0.028162579983472824, -0.12779322266578674, -0.011499609798192978, 0.2212420552968979, -0.3363279104232788, -0.010660484433174133, -0.0661902129650116, -0.1995442807674408, 0.0018724463880062103, -0.2291446030139923, -0.2826402187347412, -0.08811572939157486, 0.07945524156093597, -0.054566189646720886, 0.038846708834171295, -0.033184029161930084, -0.043622396886348724, 0.10611255466938019, 0.4048258662223816, 0.3788089454174042, 0.37874212861061096, -0.030582919716835022, -0.5744820237159729, -0.620283842086792, -0.025803394615650177, -0.053371187299489975, -0.4693160951137543, 0.16732504963874817, -0.15931454300880432, 0.021070271730422974, 0.23061373829841614, -0.10627958178520203, -0.14315927028656006, 0.2964801788330078, 0.03254852443933487, -0.1848936825990677, -0.0822562724351883, 0.055069565773010254, 0.024178043007850647, -0.06998559087514877, -0.3976588547229767, 0.2695901691913605, -0.17647461593151093, -0.2585141360759735, -0.0020475853234529495, 0.5505445003509521, -0.34530043601989746, 0.004686631262302399, 0.4293419420719147, 0.12880946695804596, 0.48871466517448425, -0.08739028871059418, -0.11472101509571075, -0.07555881142616272, 0.20113258063793182, 0.006234229542315006, 0.13649073243141174, 0.023568827658891678, 0.7903158664703369, -0.5040962100028992, -0.19568470120429993, -0.0645895004272461, -0.09373050183057785, 0.07006684690713882, 0.08871795237064362, -0.23619845509529114, 0.15525706112384796, -0.38059452176094055, 0.11456848680973053, 0.27009785175323486, 0.4224916100502014, -0.004481259733438492, -0.019720973446965218, 0.05994434654712677, -0.36830753087997437, 0.36092886328697205, -0.0054198033176362514, -0.24560266733169556, 0.01739591732621193, -0.09887252748012543, 0.08322379738092422, -0.04741144925355911, -0.5633256435394287, 0.07255245000123978, 0.17514269053936005, 0.2045646607875824, 0.2033746838569641, 0.38623079657554626, -0.10196840763092041, -0.34382539987564087, -0.12611769139766693, 0.3504898250102997, 0.10907911509275436, -0.221234530210495, 0.02231490984559059, -0.4573742151260376 ]
https://github.com/huggingface/datasets/issues/6537
Adding support for netCDF (*.nc) files
I'd still need to verify that such a conversion would be lossless, especially for multi-dimensional data.
### Feature request netCDF (*.nc) is a file format for storing multidimensional scientific data, which is used by packages like `xarray` (labelled multi-dimensional arrays in Python). It would be nice to have native support for netCDF in `datasets`. ### Motivation When uploading *.nc files onto Huggingface Hub through the `datasets` API, I would like to be able to preview the dataset without converting it to another format. ### Your contribution I can submit a PR, provided I have the time.
16
Adding support for netCDF (*.nc) files ### Feature request netCDF (*.nc) is a file format for storing multidimensional scientific data, which is used by packages like `xarray` (labelled multi-dimensional arrays in Python). It would be nice to have native support for netCDF in `datasets`. ### Motivation When uploading *.nc files onto Huggingface Hub through the `datasets` API, I would like to be able to preview the dataset without converting it to another format. ### Your contribution I can submit a PR, provided I have the time. I'd still need to verify that such a conversion would be lossless, especially for multi-dimensional data.
[ -0.42485079169273376, -0.14924433827400208, -0.016564099118113518, -0.053587354719638824, -0.08428353816270828, 0.03141968697309494, -0.2771836221218109, 0.3843265473842621, -0.10386544466018677, 0.33643078804016113, -0.4233734905719757, 0.005744357593357563, -0.5121451020240784, 0.5744466185569763, 0.14821851253509521, 0.049926482141017914, 0.28135085105895996, 0.357112318277359, -0.018851399421691895, 0.30765634775161743, -0.23594653606414795, 0.07878237217664719, -0.281177282333374, -0.04130401462316513, -0.3436433672904968, -0.009352101013064384, -0.20587080717086792, 0.10002097487449646, -0.38408902287483215, -0.41994455456733704, 0.2844041883945465, 0.5439449548721313, 0.4076133370399475, 0.3921717703342438, -0.00012787988816853613, -0.06004626303911209, 0.156635582447052, -0.027412492781877518, -0.25855761766433716, -0.009328335523605347, 0.14551833271980286, -0.19716328382492065, 0.17874330282211304, -0.10965056717395782, -0.31430989503860474, -0.310985803604126, 0.0813206285238266, -0.1009601503610611, 0.16550837457180023, 0.06603004783391953, 0.03424060344696045, 0.46305420994758606, -0.10078766196966171, -0.04489477351307869, -0.32667574286460876, 0.6654289364814758, -0.4296942353248596, 0.37226390838623047, 0.3683077096939087, 0.09793610125780106, 0.0015141069889068604, 0.17037492990493774, -0.1175876334309578, -0.2935509979724884, 0.5001630187034607, -0.018103070557117462, -0.030435919761657715, -0.19705438613891602, -0.13078805804252625, 0.2927393913269043, 0.4646390676498413, -0.22659948468208313, -0.47479280829429626, -0.26689255237579346, -0.017668507993221283, -0.17837083339691162, -0.144639253616333, 0.1996442824602127, -0.1172894686460495, 0.4139463007450104, -0.37300023436546326, -0.2804580330848694, -0.3934136629104614, 0.212041437625885, -0.10995060205459595, 0.24152950942516327, -0.19224295020103455, -0.09709634631872177, 0.34628695249557495, -0.08684548735618591, 0.16311541199684143, -0.34676843881607056, 0.1277986466884613, 0.02330228127539158, -0.2160416692495346, -0.38183948397636414, -0.11850645393133163, 0.24187496304512024, 0.18497604131698608, -0.048574499785900116, 0.1493351012468338, 0.2352437674999237, -0.6851215958595276, 0.05353754386305809, 0.05527513101696968, -0.1673104614019394, 0.25852862000465393, 0.39163708686828613, 0.3701809048652649, 0.11482775956392288, 0.4965980052947998, 0.008547300472855568, -0.15896715223789215, 0.31273990869522095, -0.4711463749408722, -0.13842079043388367, 0.1546613723039627, -0.27432018518447876, 0.0944444015622139, -0.1315593123435974, 0.5818802714347839, 0.3108183443546295, 0.22713424265384674, 0.26432183384895325, 0.1024114117026329, 0.14752990007400513, -0.061682216823101044, 0.47343283891677856, 0.13872601091861725, -0.41904011368751526, 0.011334143579006195, -0.1286369264125824, -0.17866097390651703, 0.08172118663787842, 0.27666881680488586, 0.057713281363248825, -0.19842056930065155, -0.20446646213531494, 0.36584949493408203, 0.2712806761264801, -0.2074616700410843, 0.07557938992977142, 0.25591620802879333, 0.07968493551015854, -0.4131065011024475, 0.20787999033927917, 0.09349258244037628, 0.056267134845256805, -0.2793605625629425, 0.133840411901474, -0.1069316491484642, 0.022358935326337814, -0.4623773694038391, -0.10815158486366272, -0.0969759076833725, 0.050000935792922974, -0.3250252902507782, 0.19975225627422333, -0.43408259749412537, -0.4855850040912628, -0.015608750283718109, -0.16259020566940308, -0.5609180927276611, -0.3474082946777344, 0.08732329308986664, 0.2319926619529724, -0.10589112341403961, -0.021265536546707153, -0.048880685120821, -0.15716955065727234, 0.12611860036849976, 0.22482922673225403, -0.12715786695480347, -0.0688190683722496, -0.41942575573921204, 0.2734331488609314, 0.35899871587753296, -0.5257559418678284, -0.05449078232049942, 0.2138386219739914, 0.03668670356273651, 0.12074331194162369, -0.1565260887145996, 0.3467128276824951, 0.1903446465730667, -0.3161527216434479, -0.07329551875591278, 0.16330571472644806, 0.09407564997673035, 0.008536139503121376, -0.039804987609386444, -0.44615858793258667, 0.07567617297172546, 0.2834685742855072, -0.04593437537550926, 0.2325829267501831, 0.2490280568599701, -0.43199196457862854, 0.29770708084106445, -0.4198724627494812, 0.18557186424732208, 0.037706974893808365, -0.16138692200183868, -0.0843675285577774, -0.16083627939224243, -0.39972853660583496, -0.7091012001037598, 0.31970512866973877, 0.0408555343747139, -0.0717322826385498, -0.20265613496303558, -0.4522532820701599, -0.04084417223930359, -0.09253280609846115, -0.02431650087237358, -0.049156103283166885, -0.027408521622419357, 0.017273664474487305, 0.21508802473545074, 0.2654232680797577, -0.1957365721464157, 0.3360621929168701, -0.009333573281764984, 0.17706052958965302, -0.09990935027599335, 0.32738223671913147, 0.19428671896457672, 0.07369524985551834, 0.2554408311843872, 0.2812010943889618, -0.013826929032802582, -0.08937683701515198, 0.0069963750429451466, 0.2539944350719452, -0.49810531735420227, 0.11067837476730347, 0.1342860758304596, 0.5915389060974121, 0.2278905212879181, -0.29637691378593445, 0.3915846645832062, -0.01372181624174118, -0.06040631979703903, -0.19526907801628113, -0.21275150775909424, 0.36713945865631104, -0.16562843322753906, -0.10414376109838486, -0.17059272527694702, 0.039199136197566986, -0.016280096024274826, 0.16204096376895905, -0.07626643776893616, -0.04571438580751419, 0.10167977958917618, 0.10344098508358002, 0.12381201982498169, -0.24298276007175446, -0.30838748812675476, 0.05981967970728874, 0.16700296103954315, -0.2179413139820099, 0.10868470370769501, 0.2344515323638916, -0.31611156463623047, 0.22345468401908875, 0.24248826503753662, 0.04515286162495613, 0.3585003614425659, 0.1172177866101265, 0.2604353129863739, 0.20233193039894104, -0.10630970448255539, 0.012772921472787857, 0.06672610342502594, -0.10307225584983826, 0.04891638457775116, 0.04953713342547417, -0.09909870475530624, -0.01526487898081541, -0.2411525845527649, -0.19172464311122894, -0.17256894707679749, -0.14506591856479645, -0.10848549753427505, 0.06709423661231995, -0.3937230110168457, -0.5434691309928894, -0.06391989439725876, 0.12141549587249756, -0.09839451313018799, -0.09228964149951935, 0.013244543224573135, 0.3591483235359192, -0.08546831458806992, -0.06372544914484024, -0.30886179208755493, 0.5402218103408813, -0.056282319128513336, -0.19463293254375458, -0.20079904794692993, 0.13916778564453125, -0.08353763818740845, -0.03757999837398529, 0.40122705698013306, 0.06285785883665085, 0.4502227008342743, 0.0702759250998497, 0.45137453079223633, -0.34790486097335815, -0.0747397318482399, 0.017795011401176453, 0.09189867973327637, 0.08763792365789413, 0.013412773609161377, -0.015082396566867828, -0.2716338038444519, 0.07988599687814713, -0.11486171185970306, -0.3440766930580139, -0.005605696700513363, -0.04309000447392464, -0.0006827355828136206, -0.11101945489645004, -0.36365753412246704, 0.27968189120292664, -0.4566742181777954, -0.4164273142814636, 0.25548312067985535, -0.3172494173049927, 0.03847770392894745, 0.22049015760421753, -0.20025044679641724, 0.05933113023638725, -0.2558222711086273, -0.2659297585487366, 0.030316324904561043, -0.23859035968780518, 0.4504407048225403, -0.281826376914978, -0.4530048370361328, -0.004352260380983353, -0.15762317180633545, 0.03071804903447628, 0.10200617462396622, 0.01361953467130661, -0.006951914168894291, -0.12812365591526031, 0.19659239053726196, 0.08038210868835449, -0.02505415864288807, 0.344633013010025, -0.21938946843147278, 0.08966147154569626, -0.06235310435295105, 0.010724823921918869, -0.22687804698944092, 0.07695809006690979, -0.05450574308633804, 0.21103572845458984, -0.40709033608436584, 0.06332133710384369, -0.03658081591129303, 0.28990525007247925, -0.057384978979825974, 0.1961362063884735, -0.0008772369474172592, 0.5420308709144592, 0.022088102996349335, -0.06316974014043808, 0.006881610490381718, -0.001602470874786377, 0.018263041973114014, 0.39879322052001953, 0.2437973916530609, -0.07833612710237503, -0.10251735895872116, -0.20635373890399933, -0.2612483501434326, -0.13157306611537933, 0.11880116164684296, 0.10997980833053589, 0.33988329768180847, 0.036518678069114685, -0.023509293794631958, 0.020601682364940643, -0.46115392446517944, -0.020307553932070732, 0.6010268330574036, 0.04621678218245506, 0.018197279423475266, -0.422606885433197, -0.06588690727949142, -0.4824017286300659, 0.26039814949035645, 0.27684327960014343, 0.19042524695396423, 0.0010369867086410522, 0.3368169367313385, -0.03557319939136505, 0.310624361038208, 0.6787518858909607, -0.39008671045303345, -0.27032405138015747, 0.23690584301948547, 0.17349500954151154, -0.29218465089797974, 0.10284397006034851, -0.22539573907852173, 0.15483316779136658, -0.12008970975875854, 0.24143622815608978, 0.10390306264162064, -0.30487728118896484, -0.012465212494134903, 0.3573235273361206, 0.0052573345601558685, -0.0602995902299881, 0.048197466880083084, 0.13822942972183228, -0.2942291796207428, -0.16002744436264038, 0.11187004297971725, -0.21026408672332764, -0.26819896697998047, -0.2082718014717102, -0.02390674687922001, 0.12368767708539963, 0.2770000994205475, 0.11433115601539612, 0.30918604135513306, 0.2531224489212036, -0.040441758930683136, 0.40299588441848755, 0.13509321212768555, 0.000024255365133285522, 0.32411661744117737, 0.3390198051929474, -0.0814826488494873, 0.03538208082318306, 0.08010932803153992, 0.2838130295276642, 0.4755699932575226, 0.06193690747022629, -0.035947732627391815, -0.034624528139829636, 0.12617838382720947, -0.5604616403579712, 0.3349898159503937, 0.11949680745601654, -0.08215881884098053, -0.7018895745277405, -0.027997039258480072, 0.6932514905929565, 0.15363162755966187, -0.10810348391532898, 0.32804760336875916, 0.5627964735031128, -0.08596793562173843, -0.0654890313744545, -0.06705949455499649, 1.0609482526779175, -0.3299597501754761, 0.2988264858722687, 0.2794017195701599, -0.3594515919685364, 0.6771497130393982, -0.14433541893959045, -0.02416413277387619, -0.22895413637161255, -0.05093058943748474, -0.2091878354549408, -0.06272565573453903, 0.3259553909301758, 0.09165315330028534, -0.2567462921142578, 0.2600802779197693, 0.4010297656059265, 0.20406299829483032, 0.0013139806687831879, 0.13923190534114838, 0.07139323651790619, -0.42740365862846375, 0.04654295742511749, 0.033759742975234985, -0.13498486578464508, -0.0381314717233181, -0.1121492013335228, -0.24252121150493622, -0.1961170881986618, 0.10430972278118134, -0.13312536478042603, -0.04056898131966591, 0.18227292597293854, 0.1131085604429245, 0.12045654654502869, -0.027463607490062714, 0.3731575608253479, 0.3006701171398163, 0.39909595251083374, 0.07678699493408203, -0.5406423807144165, -0.18699586391448975, -0.42905059456825256, 0.031713537871837616, -0.13119615614414215, -0.20327746868133545, 0.2722196578979492, 0.08304554224014282, -0.049656711518764496, 0.023284174501895905, 0.17919597029685974, -0.17267486453056335, -0.06760238856077194, 0.04535680264234543, 0.23087500035762787, -0.2649422585964203, -0.15119507908821106, -0.004050940275192261, -0.07940126955509186, 0.11994943022727966, -0.019212566316127777, 0.31052857637405396, 0.185133159160614, 0.10343339294195175, 0.24637076258659363, 0.08006957173347473, -0.02585887908935547, 0.12983816862106323, 0.025114331394433975, -0.6331673860549927, -0.027652181684970856, -0.11639404296875, -0.2928360104560852, -0.07638607174158096, 0.16916531324386597, 0.009342100471258163, -0.20959186553955078, 0.049107685685157776, 0.045594241470098495, 0.11610950529575348, -0.005345226731151342, 0.31159770488739014, 0.0978705883026123, -0.34085941314697266, -0.05577724426984787, -0.10235996544361115, -0.17584103345870972, 0.24439667165279388, -0.43544909358024597, 0.44714054465293884, 0.07678214460611343, 0.20531246066093445, -0.14275118708610535, -0.1982099711894989, -0.1425096094608307, 0.09286948293447495, 0.23786133527755737, 0.00838966853916645, 0.4669567942619324, 0.21836423873901367, 0.09708518534898758, -0.3630938231945038, -0.14572913944721222, 0.26287752389907837, -0.38985976576805115, 0.0008463691920042038, -0.11452141404151917, 0.2721877098083496, 0.09112972021102905, -0.11230089515447617, 0.10336414724588394, -0.14839288592338562, -0.04506499692797661, -0.2168523371219635, 0.02468206360936165, -0.031235625967383385, -0.04535273462533951, 0.25383687019348145, -0.1024899035692215, 0.18696358799934387, -0.028604261577129364, 0.3332907557487488, 0.23968926072120667, 0.5707100629806519, -0.15723419189453125, 0.1215398907661438, -0.2884976863861084, -0.18578362464904785, -0.11381728947162628, 0.24106517434120178, 0.11739187687635422, -0.13096243143081665, 0.3923191428184509, 0.026364043354988098, 0.12202568352222443, 0.10306210070848465, 0.4809410274028778, -0.015777550637722015, -0.2753928005695343, -0.12276897579431534, 0.45557260513305664, -0.04853221774101257, -0.026605626568198204, -0.2197674810886383, 0.40183600783348083, -0.0070606404915452, 0.08379364013671875, 0.25448426604270935, 0.3470819592475891, -0.053908996284008026, 0.0620093047618866, -0.17623305320739746, -0.12755444645881653, 0.10809241235256195, 0.18703219294548035, 0.5087073445320129, 0.2565813362598419, -0.020841430872678757, 0.10930640995502472, 0.11857862770557404, 0.17640577256679535, 0.8755051493644714, -0.043595410883426666, 0.2794739305973053, 0.11656757444143295, 0.35119158029556274, 0.08971261233091354, -0.30329543352127075, 0.2050430029630661, 0.024542465806007385, 0.0049187541007995605, 0.2939467132091522, -0.040214285254478455, -0.04237443953752518, -0.3990405797958374, -0.22012461721897125, -0.16284362971782684, 0.1846027821302414, -0.09222962707281113, 0.19062304496765137, 0.2004513442516327, -0.05617595463991165, -0.012119606137275696, 0.004615318030118942, -0.35230663418769836, 0.004314444959163666, 0.03052513301372528, 0.1273985207080841, 0.2253219187259674, 0.06179986894130707, 0.29105764627456665, 0.37491363286972046, 0.40690162777900696, -0.18895964324474335, -0.14300556480884552, 0.27850595116615295, 0.10775180906057358, 0.14556722342967987, 0.2567078173160553, 0.29768022894859314, 0.029716484248638153, 0.19821549952030182, 0.2059522271156311, -0.2977675199508667, -0.07395078241825104, 0.2593529224395752, -0.10424469411373138, 0.20502090454101562, 0.2310941368341446, 0.26051610708236694, -0.04060132056474686, 0.06936521828174591, -0.08464699983596802, -0.08486981689929962, 0.2135258913040161, -0.344382107257843, 0.036301225423812866, -0.06759963184595108, -0.11153270304203033, -0.07558465003967285, -0.2689083516597748, -0.20961806178092957, -0.1604093313217163, 0.05163267254829407, -0.07747356593608856, 0.06494847685098648, -0.011653409339487553, -0.034094519913196564, 0.14679230749607086, 0.3085145652294159, 0.31397610902786255, 0.20378869771957397, -0.02608044072985649, -0.5878445506095886, -0.5225656032562256, -0.10689707845449448, 0.030001817271113396, -0.3688541352748871, 0.10330913960933685, -0.14170695841312408, 0.06708521395921707, 0.3019886016845703, -0.10702002048492432, -0.16588327288627625, 0.3375168740749359, 0.04412374272942543, -0.07098282873630524, -0.10844731330871582, 0.16262775659561157, 0.018416207283735275, -0.04925917088985443, -0.4187459945678711, 0.26928478479385376, -0.018611859530210495, -0.26596295833587646, 0.004905613139271736, 0.5554265379905701, -0.38055941462516785, -0.043698832392692566, 0.33693835139274597, 0.19339852035045624, 0.4060361981391907, -0.0987192764878273, -0.1974858045578003, -0.06369496881961823, 0.28051841259002686, -0.004516208078712225, 0.10210530459880829, 0.022909700870513916, 0.8177701234817505, -0.46864965558052063, -0.10856218636035919, -0.059425365179777145, -0.19456592202186584, 0.08147478103637695, 0.10725101083517075, -0.33163273334503174, 0.18789096176624298, -0.3925001323223114, 0.1229814663529396, 0.29711654782295227, 0.41180649399757385, 0.021621521562337875, 0.0037878546863794327, 0.034258365631103516, -0.31958717107772827, 0.36153337359428406, 0.08831693977117538, -0.21142353117465973, 0.06610922515392303, -0.08216814696788788, 0.06093855947256088, -0.07824477553367615, -0.5897842049598694, -0.01250658929347992, 0.15902112424373627, 0.14124447107315063, 0.3222862482070923, 0.425426185131073, -0.1402263194322586, -0.38791295886039734, -0.15325187146663666, 0.4777991771697998, 0.14257681369781494, -0.24467867612838745, 0.07185637950897217, -0.4522172212600708 ]
https://github.com/huggingface/datasets/issues/6536
datasets.load_dataset raises FileNotFoundError for datasets==2.16.0
Hi ! Thanks for reporting This is a bug in 2.16.0 for some datasets when `cache_dir` is a relative path. I opened https://github.com/huggingface/datasets/pull/6543 to fix this
### Describe the bug Seems `datasets.load_dataset` raises FileNotFoundError for some hub datasets with the latest `datasets==2.16.0` ### Steps to reproduce the bug For example `pip install datasets==2.16.0` then ```python import datasets datasets.load_dataset("wentingzhao/anthropic-hh-first-prompt", cache_dir='cache1')["train"] ``` This will raise: ```bash Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/load.py", line 2545, in load_dataset builder_instance.download_and_prepare( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/builder.py", line 1003, in download_and_prepare self._download_and_prepare( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/builder.py", line 1076, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 43, in _split_generators data_files = dl_manager.download_and_extract(self.config.data_files) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 566, in download_and_extract return self.extract(self.download(url_or_urls)) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 539, in extract extracted_paths = map_nested( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 466, in map_nested mapped = [ File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 467, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 387, in _single_map_nested mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 387, in <listcomp> mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 370, in _single_map_nested return function(data_struct) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 451, in _download out = cached_path(url_or_filename, download_config=download_config) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 188, in cached_path output_path = get_from_cache( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 570, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/wentingzhao/anthropic-hh-first-prompt/resolve/11b393a5545f706a357ebcd4a5285d93db176715/cache1/downloads/87d66c365626feca116cba323c4856c9aae056e4503f09f23e34aa085eb9de15 ``` However, seems it works fine for some datasets, for example, if works fine for `datasets.load_dataset("ag_news", cache_dir='cache2')["test"]` But the dataset works fine for datasets==2.15.0, for example `pip install datasets==2.15.0`, then ```python import datasets datasets.load_dataset("wentingzhao/anthropic-hh-first-prompt", cache_dir='cache3')["train"] Dataset({ features: ['user', 'system', 'source'], num_rows: 8552 }) ``` ### Expected behavior 2.16.0 should work as same as 2.15.0 for all datasets ### Environment info python3.9 conda env tested on MacOS and Linux
26
datasets.load_dataset raises FileNotFoundError for datasets==2.16.0 ### Describe the bug Seems `datasets.load_dataset` raises FileNotFoundError for some hub datasets with the latest `datasets==2.16.0` ### Steps to reproduce the bug For example `pip install datasets==2.16.0` then ```python import datasets datasets.load_dataset("wentingzhao/anthropic-hh-first-prompt", cache_dir='cache1')["train"] ``` This will raise: ```bash Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/load.py", line 2545, in load_dataset builder_instance.download_and_prepare( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/builder.py", line 1003, in download_and_prepare self._download_and_prepare( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/builder.py", line 1076, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/packaged_modules/parquet/parquet.py", line 43, in _split_generators data_files = dl_manager.download_and_extract(self.config.data_files) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 566, in download_and_extract return self.extract(self.download(url_or_urls)) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 539, in extract extracted_paths = map_nested( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 466, in map_nested mapped = [ File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 467, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 387, in _single_map_nested mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 387, in <listcomp> mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 370, in _single_map_nested return function(data_struct) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/download/download_manager.py", line 451, in _download out = cached_path(url_or_filename, download_config=download_config) File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 188, in cached_path output_path = get_from_cache( File "/Users/xxx/miniconda3/envs/env/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 570, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/wentingzhao/anthropic-hh-first-prompt/resolve/11b393a5545f706a357ebcd4a5285d93db176715/cache1/downloads/87d66c365626feca116cba323c4856c9aae056e4503f09f23e34aa085eb9de15 ``` However, seems it works fine for some datasets, for example, if works fine for `datasets.load_dataset("ag_news", cache_dir='cache2')["test"]` But the dataset works fine for datasets==2.15.0, for example `pip install datasets==2.15.0`, then ```python import datasets datasets.load_dataset("wentingzhao/anthropic-hh-first-prompt", cache_dir='cache3')["train"] Dataset({ features: ['user', 'system', 'source'], num_rows: 8552 }) ``` ### Expected behavior 2.16.0 should work as same as 2.15.0 for all datasets ### Environment info python3.9 conda env tested on MacOS and Linux Hi ! Thanks for reporting This is a bug in 2.16.0 for some datasets when `cache_dir` is a relative path. I opened https://github.com/huggingface/datasets/pull/6543 to fix this
[ -0.7334116697311401, -0.0737399235367775, 0.06582650542259216, 0.48953884840011597, 0.32654696702957153, 0.03555208444595337, 0.39158180356025696, 0.4182252287864685, 0.18511220812797546, 0.08222909271717072, -0.02130044996738434, 0.38214045763015747, -0.2367287427186966, -0.1261698603630066, -0.06406204402446747, 0.18891851603984833, 0.09459129720926285, 0.1858685314655304, -0.20660126209259033, -0.09665902704000473, -0.32771897315979004, 0.0546196773648262, -0.2791704833507538, 0.06473307311534882, -0.3932625651359558, 0.05838147550821304, -0.0342358760535717, 0.5014029741287231, -0.17622500658035278, -0.4643514156341553, 0.374803751707077, -0.07743056118488312, 0.20716923475265503, 0.5676159262657166, -0.00011187501513632014, 0.18247349560260773, 0.4646714925765991, -0.024692928418517113, -0.3507278561592102, -0.4181361198425293, -0.39082565903663635, -0.35041242837905884, -0.01946740597486496, -0.15348957479000092, -0.10203687101602554, -0.05538433417677879, 0.10753923654556274, -0.13671186566352844, 0.23907427489757538, 0.27580124139785767, 0.22099530696868896, 0.2887853682041168, 0.09563092887401581, -0.17955282330513, 0.14779265224933624, -0.018791213631629944, -0.18774491548538208, 0.03613796830177307, 0.08326653391122818, -0.07345466315746307, -0.18283888697624207, 0.3996458649635315, -0.23437631130218506, -0.041697148233652115, 0.22398412227630615, -0.05924185365438461, -0.06652101129293442, -0.22903072834014893, 0.1261180192232132, 0.3393901288509369, 0.4789990186691284, -0.29738831520080566, -0.5253121852874756, -0.3059007227420807, -0.013313892297446728, -0.20568586885929108, 0.37002572417259216, 0.09846921265125275, 0.17398986220359802, 0.14292120933532715, 0.05299694091081619, -0.163704052567482, -0.15361078083515167, 0.021813470870256424, -0.08888132125139236, 0.3979455530643463, -0.1295527070760727, 0.038446977734565735, -0.11275620758533478, -0.27871859073638916, 0.12831923365592957, -0.3844696879386902, -0.2160404920578003, 0.19346489012241364, -0.276763916015625, 0.023532375693321228, 0.07561416178941727, 0.22525519132614136, 0.2244139313697815, 0.18717344105243683, -0.1524382084608078, -0.057572588324546814, -0.19607579708099365, 0.06835520267486572, 0.14275877177715302, 0.09259301424026489, 0.193168044090271, 0.3582208454608917, 0.2809012532234192, 0.28562429547309875, 0.07429821789264679, -0.06750163435935974, -0.007580991368740797, -0.1323646903038025, -0.07595719397068024, 0.06683863699436188, 0.6451982855796814, -0.1010117381811142, -0.41922861337661743, 0.06579763442277908, 0.02701437473297119, 0.06763312965631485, 0.2186099886894226, 0.3316718637943268, -0.1318790167570114, 0.13512475788593292, -0.07479597628116608, 0.2857877016067505, -0.29658254981040955, -0.10824134200811386, -0.2708398997783661, -0.0075283776968717575, 0.13243816792964935, -0.0019260160624980927, 0.12966696918010712, -0.245608389377594, 0.33964017033576965, 0.13057982921600342, -0.18292374908924103, 0.053269460797309875, -0.04080543667078018, -0.18569201231002808, 0.021585673093795776, 0.34590744972229004, -0.05674588680267334, 0.19805696606636047, 0.16934387385845184, -0.20127764344215393, -0.028109952807426453, 0.15078550577163696, -0.3380332291126251, -0.30785682797431946, -0.20334945619106293, 0.21800975501537323, -0.34965914487838745, -0.07098071277141571, -0.08573176711797714, -0.0346372164785862, 0.028821729123592377, -0.22245007753372192, 0.0398714542388916, -0.2037447690963745, -0.2598513960838318, -0.25144484639167786, 0.30667534470558167, 0.8850861191749573, -0.10414379835128784, 0.024640507996082306, -0.1501205414533615, -0.30093836784362793, 0.14146074652671814, -0.14088517427444458, -0.05687987059354782, 0.17187637090682983, -0.3672947287559509, 0.2256125658750534, 0.2577997148036957, -0.721161425113678, -0.3965941369533539, 0.1446092426776886, -0.052289366722106934, 0.2655493915081024, 0.12303508073091507, 0.07646334171295166, -0.13091467320919037, -0.14631153643131256, 0.10882692039012909, 0.012647404335439205, -0.10538826882839203, 0.11154036968946457, -0.29383814334869385, -0.26748570799827576, -0.02922932058572769, 0.27861860394477844, 0.1513863205909729, 0.022564247250556946, 0.1384037584066391, 0.3286243677139282, 0.23020896315574646, -0.061047110706567764, -0.012477187439799309, 0.10089892148971558, 0.26347488164901733, -0.0771636962890625, -0.014839928597211838, -0.20733842253684998, -0.571487307548523, 0.3691750764846802, 0.25713449716567993, -0.15350447595119476, -0.19347985088825226, -0.1567240059375763, -0.1694348156452179, 0.024352269247174263, -0.45745232701301575, -0.23761722445487976, 0.1818801313638687, 0.10621073096990585, -0.08780750632286072, 0.04007339105010033, -0.19701431691646576, 0.563283383846283, -0.1587802767753601, 0.17328472435474396, -0.3903677761554718, 0.4175683856010437, -0.008901311084628105, -0.10916552692651749, 0.0418502539396286, 0.2211284637451172, 0.17694833874702454, -0.11648157984018326, -0.058267585933208466, 0.54621422290802, 0.20707310736179352, 0.3025912642478943, 0.15905818343162537, -0.21541254222393036, 0.23012198507785797, 0.00044799596071243286, 0.15208637714385986, 0.13960929214954376, 0.13257922232151031, 0.042218856513500214, -0.0050429776310920715, 0.32253706455230713, 0.046399835497140884, 0.013631187379360199, 0.07528764009475708, -0.07198780030012131, 0.08146966248750687, -0.03706102818250656, 0.06079644709825516, -0.27125564217567444, 0.2562824785709381, 0.22950847446918488, 0.3831849992275238, 0.013221175409853458, -0.1602073609828949, 0.08090754598379135, 0.37770888209342957, 0.15878959000110626, 0.18944701552391052, -0.12900212407112122, -0.21134549379348755, 0.07227300852537155, 0.0782577246427536, 0.30737030506134033, 0.3836079239845276, 0.13877007365226746, -0.16623392701148987, 0.18823236227035522, -0.20597493648529053, -0.07292842864990234, 0.2615811228752136, 0.05709505081176758, 0.2397357076406479, 0.38340553641319275, -0.050174590200185776, 0.05713428184390068, -0.4039178490638733, -0.15578027069568634, -0.08038323372602463, 0.31565752625465393, -0.3966202735900879, -0.11576084792613983, -0.30253517627716064, -0.17416852712631226, -0.10290685296058655, 0.0691063180565834, -0.28306666016578674, -0.18346063792705536, -0.027709096670150757, 0.2706921398639679, -0.12634192407131195, 0.17767834663391113, -0.30102232098579407, 0.02277722954750061, 0.06881783902645111, -0.22023342549800873, -0.15812420845031738, -0.06737977266311646, -0.30998075008392334, 0.03877757862210274, 0.3634099066257477, -0.17076684534549713, 0.261976420879364, -0.19122008979320526, 0.07904066145420074, -0.4329788088798523, -0.20075637102127075, -0.040854521095752716, -0.04519503563642502, 0.4355444312095642, 0.22634734213352203, -0.047343313694000244, 0.1738307625055313, -0.15003789961338043, 0.2518693208694458, -0.13113227486610413, -0.2013668268918991, 0.045618683099746704, -0.10771302133798599, 0.048307228833436966, -0.02904568798840046, -0.45733264088630676, -0.15373215079307556, -0.4844360649585724, -0.21388988196849823, 0.006741747260093689, 0.0980571061372757, 0.48725494742393494, 0.10236764699220657, 0.20753902196884155, 0.009653757326304913, -0.2492731213569641, -0.10760509967803955, -0.2580935060977936, 0.2647089660167694, -0.1674196422100067, -0.24716849625110626, 0.08840203285217285, -0.09459655731916428, 0.03515606001019478, 0.0538807213306427, -0.3899379372596741, -0.3662492632865906, -0.027411827817559242, 0.15343666076660156, -0.09030380845069885, 0.00122930109500885, 0.25809741020202637, 0.0072829811833798885, 0.06656189262866974, -0.25317513942718506, -0.022015899419784546, -0.004857160151004791, -0.10621077567338943, 0.1564043015241623, -0.1671687662601471, 0.25454166531562805, -0.03778134286403656, 0.3965802788734436, 0.2530762255191803, 0.1481734663248062, 0.37120482325553894, -0.13047969341278076, 0.5768004059791565, -0.2843734622001648, -0.30684053897857666, -0.04355680197477341, 0.29683032631874084, -0.016963835805654526, 0.28276318311691284, 0.06265087425708771, 0.04861704260110855, -0.16026625037193298, -0.23973895609378815, -0.22165578603744507, -0.19312700629234314, -0.16154012084007263, -0.14019733667373657, -0.035460300743579865, 0.18872542679309845, 0.22740787267684937, -0.13333182036876678, -0.1767253279685974, -0.07595941424369812, 0.3244739770889282, 0.14330871403217316, -0.0033575259149074554, -0.2628926634788513, -0.12102396041154861, -0.272781640291214, 0.29616206884384155, 0.26627156138420105, 0.3204493522644043, 0.003642212599515915, -0.1761903166770935, -0.11020645499229431, -0.1333521604537964, 0.5206612348556519, -0.3965242803096771, 0.2776808738708496, 0.2074211686849594, 0.11582358181476593, -0.4547473192214966, -0.21826069056987762, -0.08969723433256149, 0.3452546000480652, 0.14269568026065826, 0.4805825650691986, -0.17659185826778412, -0.3999502658843994, 0.3332694470882416, 0.09875815361738205, 0.053675319999456406, 0.04852116107940674, -0.22849774360656738, -0.09838336706161499, -0.15014787018299103, -0.039970286190509796, -0.20484456419944763, 0.21394844353199005, -0.2812734544277191, -0.04676638916134834, -0.16384658217430115, -0.034724727272987366, -0.017392270267009735, 0.15370845794677734, 0.4010477066040039, -0.11679837852716446, 0.35204803943634033, 0.101225346326828, -0.004613414406776428, 0.48786330223083496, 0.5801114439964294, 0.014472626149654388, -0.4357428550720215, -0.08005058765411377, -0.06963638216257095, -0.19166743755340576, 0.24132703244686127, -0.20303095877170563, -0.05147174745798111, -0.22179220616817474, 0.01745317503809929, -0.2985477149486542, -0.07364261150360107, 0.3658711612224579, -0.02953307330608368, -0.43781039118766785, -0.2105071246623993, 0.6365190744400024, 0.1571589559316635, 0.0512995719909668, 0.43686628341674805, 0.030518855899572372, -0.3163014352321625, 0.16973713040351868, -0.1265486180782318, 0.3444141149520874, 0.28040751814842224, 0.07407146692276001, 0.37509316205978394, 0.04167574644088745, 0.6212384104728699, -0.18013127148151398, 0.01366845890879631, -0.504416286945343, -0.26318079233169556, -0.017076902091503143, 0.012242425233125687, 0.4584362506866455, 0.08049086481332779, -0.18373245000839233, 0.3412661552429199, -0.013335682451725006, 0.5770303606987, -0.013143075630068779, 0.15765514969825745, -0.5432259440422058, -0.0365573950111866, -0.3422513008117676, 0.12560565769672394, 0.14904898405075073, 0.18107819557189941, -0.24150094389915466, -0.0625673308968544, -0.20359012484550476, -0.31838732957839966, -0.2594589293003082, 0.22764375805854797, -0.24502626061439514, 0.1716473549604416, 0.03206397965550423, -0.1739034354686737, -0.009217909537255764, 0.28105512261390686, 0.17335590720176697, -0.0029651299118995667, -0.3448083996772766, 0.250557541847229, -0.19815748929977417, 0.1147082969546318, -0.09590910375118256, 0.03442993760108948, 0.29429560899734497, -0.025655169039964676, -0.18853217363357544, -0.19664976000785828, -0.2491426169872284, -0.18698956072330475, 0.21531817317008972, 0.02050957828760147, 0.06142797693610191, -0.09336800128221512, -0.09852419793605804, 0.034234724938869476, 0.02825811877846718, -0.19455301761627197, 0.14548391103744507, 0.011277209967374802, -0.032604511827230453, 0.15364967286586761, -0.0698976069688797, -0.4115552604198456, -0.009854540228843689, 0.4409027397632599, -0.030231773853302002, 0.11912985146045685, 0.4750993549823761, -0.06432364881038666, -0.030136702582240105, -0.3066016435623169, 0.2676434814929962, 0.0730307325720787, -0.22864073514938354, 0.10684669017791748, 0.03172395005822182, 0.18877927958965302, 0.26671966910362244, 0.017392389476299286, 0.08121437579393387, -0.2395448386669159, -0.08028291165828705, -0.4382617771625519, -0.049776941537857056, 0.09378669410943985, -0.18224376440048218, 0.08771218359470367, 0.1657254993915558, 0.008266545832157135, 0.1505441963672638, -0.20613431930541992, -0.3027340769767761, 0.15180431306362152, -0.12702369689941406, 0.15235617756843567, 0.03163856640458107, 0.2566168010234833, 0.2842981517314911, -0.12678934633731842, 0.10043162852525711, -0.18757784366607666, -0.4994715452194214, -0.23754718899726868, -0.15018606185913086, 0.13175135850906372, 0.07463051378726959, -0.11226820945739746, -0.1683449149131775, -0.2161707580089569, -0.01764766499400139, -0.12310685217380524, 0.18324242532253265, 0.2732709050178528, -0.0805436372756958, 0.13848291337490082, 0.32754021883010864, 0.26609277725219727, -0.07920771837234497, 0.21078500151634216, -0.11603783071041107, 0.15811096131801605, -0.12008026242256165, 0.3258274793624878, -0.09495709836483002, 0.015379220247268677, 0.00843674037605524, -0.05198352783918381, -0.16145335137844086, 0.11404541879892349, 0.2743101119995117, -0.2558979392051697, 0.13455218076705933, 0.2355930507183075, 0.16405215859413147, 0.455429345369339, -0.1705881804227829, -0.1458972543478012, 0.0003470005467534065, 0.22417651116847992, -0.2545125186443329, -0.17099779844284058, 0.3349398970603943, 0.06346050649881363, 0.11048828065395355, 0.0985792875289917, 0.2818908095359802, -0.08705577999353409, 0.12792646884918213, 0.25162452459335327, 0.5481113791465759, -0.17336204648017883, 0.46703869104385376, 0.6007341146469116, -0.06564207375049591, 0.2081708163022995, 0.13081508874893188, -0.05816343054175377, 0.0943768322467804, 0.74970543384552, -0.06296174973249435, 0.40575602650642395, 0.12410395592451096, 0.06217764690518379, -0.04166942089796066, -0.6213680505752563, -0.009646538645029068, 0.1861911416053772, -0.15575212240219116, -0.10805898159742355, -0.08283182978630066, 0.13988271355628967, -0.2894335091114044, -0.03928906470537186, -0.2184920310974121, -0.1320943981409073, -0.2002735435962677, -0.03325220197439194, -0.043917737901210785, -0.205173522233963, -0.05994420498609543, -0.03343050926923752, -0.023518186062574387, -0.02110110968351364, -0.04604935646057129, 0.09728985279798508, -0.2524716258049011, -0.21946334838867188, 0.3297979235649109, 0.322400838136673, 0.013990290462970734, -0.3087930977344513, 0.24498198926448822, 0.03318553417921066, 0.0660424530506134, 0.12018351256847382, 0.5941977500915527, 0.5397211909294128, 0.4723544418811798, 0.05677688494324684, -0.056240249425172806, 0.10272307693958282, -0.03433727100491524, -0.06976097822189331, 0.12710565328598022, -0.3009573817253113, -0.00038467347621917725, 0.2756493389606476, 0.2277073860168457, -0.10948620736598969, 0.08068039268255234, 0.09427982568740845, -0.048617299646139145, -0.2889068126678467, 0.34915581345558167, -0.25635573267936707, -0.005311902612447739, -0.11834494769573212, 0.10163743793964386, -0.22394123673439026, 0.1678253710269928, 0.4851608872413635, 0.12133873254060745, 0.23822066187858582, -0.10440757125616074, 0.08960185199975967, 0.02431323751807213, 0.17375560104846954, 0.4744832217693329, -0.1710726022720337, -0.22454284131526947, -0.1839151382446289, -0.7916768193244934, 0.16514401137828827, -0.022805314511060715, 0.11668054759502411, -0.056904055178165436, 0.10139310359954834, -0.22759583592414856, -0.010336324572563171, 0.0980953648686409, -0.1892021894454956, 0.32226571440696716, 0.07625031471252441, -0.34857478737831116, -0.15740880370140076, -0.09492185711860657, -0.14566408097743988, -0.11879309266805649, -0.5791370868682861, 0.1845845729112625, -0.16147279739379883, 0.016113117337226868, 0.10650347173213959, 0.03358449041843414, 0.1879900097846985, -0.3522259593009949, 0.46741706132888794, -0.03602670878171921, 0.316724568605423, -0.15823009610176086, 0.0541817769408226, -0.5838817954063416, -0.3217281103134155, -0.2370004504919052, 0.10506550967693329, -0.01701001450419426, 0.41194137930870056, -0.21257524192333221, -0.1157463937997818, -0.1512274593114853, 0.31815433502197266, 0.026969820261001587, 0.36013126373291016, -0.1694195717573166, 0.15411967039108276, -0.14109835028648376, 0.019205745309591293, -0.1181822419166565, 0.03539162129163742, -0.049964144825935364, 0.1888778954744339, -0.25524234771728516, -0.44960904121398926, 0.3430027961730957, -0.20363885164260864, -0.14965493977069855, -0.2290113866329193, 0.3471253514289856, 0.14688751101493835, -0.22521352767944336, -0.4784625768661499, 0.19436302781105042, 0.49065861105918884, -0.04219993203878403, -0.16187822818756104, 0.16149336099624634, 0.0470302514731884, 0.00710069015622139, -0.019997909665107727, 0.1312389224767685, -0.03792021423578262, -0.2055099755525589, 0.4519684612751007, -0.20682767033576965 ]
https://github.com/huggingface/datasets/issues/6535
IndexError: Invalid key: 47682 is out of bounds for size 0 while using PEFT
This is surely the same issue as https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0/14298/25 that comes from the `transformers` `Trainer`. You should add `remove_unused_columns=False` to `TrainingArguments` Also check your logs: the `Trainer` should log the length of your dataset before training starts and it surely showed length=0.
### Describe the bug I am trying to fine-tune the t5 model on the paraphrasing task. While running the same code without- model = get_peft_model(model, config) the model trains without any issues. However, using the model returned from get_peft_model raises the following error due to datasets- IndexError: Invalid key: 47682 is out of bounds for size 0. I had raised this in https://github.com/huggingface/peft/issues/1299#issue-2056173386 and they suggested that I raise it here. Here is the complete error- IndexError Traceback (most recent call last) in <cell line: 1>() ----> 1 trainer.train() 11 frames [/usr/local/lib/python3.10/dist-packages/transformers/trainer.py](https://localhost:8080/#) in train(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs) 1553 hf_hub_utils.enable_progress_bars() 1554 else: -> 1555 return inner_training_loop( 1556 args=args, 1557 resume_from_checkpoint=resume_from_checkpoint, [/usr/local/lib/python3.10/dist-packages/transformers/trainer.py](https://localhost:8080/#) in _inner_training_loop(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval) 1836 1837 step = -1 -> 1838 for step, inputs in enumerate(epoch_iterator): 1839 total_batched_samples += 1 1840 if rng_to_sync: [/usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py](https://localhost:8080/#) in iter(self) 446 # We iterate one batch ahead to check when we are at the end 447 try: --> 448 current_batch = next(dataloader_iter) 449 except StopIteration: 450 yield [/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in next(self) 628 # TODO(https://github.com/pytorch/pytorch/issues/76750) 629 self._reset() # type: ignore[call-arg] --> 630 data = self._next_data() 631 self._num_yielded += 1 632 if self._dataset_kind == _DatasetKind.Iterable and \ [/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in _next_data(self) 672 def _next_data(self): 673 index = self._next_index() # may raise StopIteration --> 674 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 675 if self._pin_memory: 676 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) [/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py](https://localhost:8080/#) in fetch(self, possibly_batched_index) 47 if self.auto_collation: 48 if hasattr(self.dataset, "getitems") and self.dataset.getitems: ---> 49 data = self.dataset.getitems(possibly_batched_index) 50 else: 51 data = [self.dataset[idx] for idx in possibly_batched_index] [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in getitems(self, keys) 2802 def getitems(self, keys: List) -> List: 2803 """Can be used to get a batch using a list of integers indices.""" -> 2804 batch = self.getitem(keys) 2805 n_examples = len(batch[next(iter(batch))]) 2806 return [{col: array[i] for col, array in batch.items()} for i in range(n_examples)] [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in getitem(self, key) 2798 def getitem(self, key): # noqa: F811 2799 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" -> 2800 return self._getitem(key) 2801 2802 def getitems(self, keys: List) -> List: [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in _getitem(self, key, **kwargs) 2782 format_kwargs = format_kwargs if format_kwargs is not None else {} 2783 formatter = get_formatter(format_type, features=self._info.features, **format_kwargs) -> 2784 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 2785 formatted_output = format_table( 2786 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in query_table(table, key, indices) 581 else: 582 size = indices.num_rows if indices is not None else table.num_rows --> 583 _check_valid_index_key(key, size) 584 # Query the main table 585 if indices is None: [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_index_key(key, size) 534 elif isinstance(key, Iterable): 535 if len(key) > 0: --> 536 _check_valid_index_key(int(max(key)), size=size) 537 _check_valid_index_key(int(min(key)), size=size) 538 else: [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_index_key(key, size) 524 if isinstance(key, int): 525 if (key < 0 and key + size < 0) or (key >= size): --> 526 raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") 527 return 528 elif isinstance(key, slice): IndexError: Invalid key: 47682 is out of bounds for size 0 ### Steps to reproduce the bug device = "cuda:0" if torch.cuda.is_available() else "cpu" #defining model name for tokenizer and model loading model_name= "t5-small" #loading the tokenizer tokenizer = AutoTokenizer.from_pretrained(model_name) def preprocess_function(data, tokenizer): inputs = [f"Paraphrase this sentence: {doc}" for doc in data["text"]] model_inputs = tokenizer(inputs, max_length=150, truncation=True) labels = [ast.literal_eval(i)[0] for i in data['paraphrases']] labels = tokenizer(labels, max_length=150, truncation=True) model_inputs["labels"] = labels["input_ids"] return model_inputs train_dataset = load_dataset("humarin/chatgpt-paraphrases", split="train").shuffle(seed=42).select(range(50000)) val_dataset = load_dataset("humarin/chatgpt-paraphrases", split="train").shuffle(seed=42).select(range(50000,55000)) tokenized_train = train_dataset.map(lambda batch: preprocess_function(batch, tokenizer), batched=True) tokenized_val = val_dataset.map(lambda batch: preprocess_function(batch, tokenizer), batched=True) def print_trainable_parameters(model): """ Prints the number of trainable parameters in the model. """ trainable_params = 0 all_param = 0 for _, param in model.named_parameters(): all_param += param.numel() if param.requires_grad: trainable_params += param.numel() print( f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}" ) config = LoraConfig( r=16, #attention heads lora_alpha=32, #alpha scaling lora_dropout=0.05, bias="none", task_type="Seq2Seq" ) #loading the model model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(device) model = get_peft_model(model, config) print_trainable_parameters(model) #loading the data collator data_collator = DataCollatorForSeq2Seq( tokenizer=tokenizer, model=model, label_pad_token_id=-100, padding="longest" ) #defining the training arguments training_args = Seq2SeqTrainingArguments( output_dir=os.getcwd(), evaluation_strategy="epoch", save_strategy="epoch", learning_rate=2e-5, per_device_train_batch_size=16, per_device_eval_batch_size=16, weight_decay=1e-3, save_total_limit=3, load_best_model_at_end=True, num_train_epochs=1, predict_with_generate=True ) def compute_metric_with_extra(tokenizer): def compute_metrics(eval_preds): metric = evaluate.load('rouge') preds, labels = eval_preds # decode preds and labels labels = np.where(labels != -100, labels, tokenizer.pad_token_id) decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True) decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True) # rougeLSum expects newline after each sentence decoded_preds = ["\n".join(nltk.sent_tokenize(pred.strip())) for pred in decoded_preds] decoded_labels = ["\n".join(nltk.sent_tokenize(label.strip())) for label in decoded_labels] result = metric.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True) return result return compute_metrics trainer = Seq2SeqTrainer( model=model, args=training_args, train_dataset=tokenized_train, eval_dataset=tokenized_val, tokenizer=tokenizer, data_collator=data_collator, compute_metrics= compute_metric_with_extra(tokenizer) ) trainer.train() ### Expected behavior I would want the trainer to train normally as it was before I used- model = get_peft_model(model, config) ### Environment info datasets version- 2.16.0 peft version- 0.7.1 transformers version- 4.35.2 accelerate version- 0.25.0 python- 3.10.12 enviroment- google colab
41
IndexError: Invalid key: 47682 is out of bounds for size 0 while using PEFT ### Describe the bug I am trying to fine-tune the t5 model on the paraphrasing task. While running the same code without- model = get_peft_model(model, config) the model trains without any issues. However, using the model returned from get_peft_model raises the following error due to datasets- IndexError: Invalid key: 47682 is out of bounds for size 0. I had raised this in https://github.com/huggingface/peft/issues/1299#issue-2056173386 and they suggested that I raise it here. Here is the complete error- IndexError Traceback (most recent call last) in <cell line: 1>() ----> 1 trainer.train() 11 frames [/usr/local/lib/python3.10/dist-packages/transformers/trainer.py](https://localhost:8080/#) in train(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs) 1553 hf_hub_utils.enable_progress_bars() 1554 else: -> 1555 return inner_training_loop( 1556 args=args, 1557 resume_from_checkpoint=resume_from_checkpoint, [/usr/local/lib/python3.10/dist-packages/transformers/trainer.py](https://localhost:8080/#) in _inner_training_loop(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval) 1836 1837 step = -1 -> 1838 for step, inputs in enumerate(epoch_iterator): 1839 total_batched_samples += 1 1840 if rng_to_sync: [/usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py](https://localhost:8080/#) in iter(self) 446 # We iterate one batch ahead to check when we are at the end 447 try: --> 448 current_batch = next(dataloader_iter) 449 except StopIteration: 450 yield [/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in next(self) 628 # TODO(https://github.com/pytorch/pytorch/issues/76750) 629 self._reset() # type: ignore[call-arg] --> 630 data = self._next_data() 631 self._num_yielded += 1 632 if self._dataset_kind == _DatasetKind.Iterable and \ [/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py](https://localhost:8080/#) in _next_data(self) 672 def _next_data(self): 673 index = self._next_index() # may raise StopIteration --> 674 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 675 if self._pin_memory: 676 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) [/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py](https://localhost:8080/#) in fetch(self, possibly_batched_index) 47 if self.auto_collation: 48 if hasattr(self.dataset, "getitems") and self.dataset.getitems: ---> 49 data = self.dataset.getitems(possibly_batched_index) 50 else: 51 data = [self.dataset[idx] for idx in possibly_batched_index] [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in getitems(self, keys) 2802 def getitems(self, keys: List) -> List: 2803 """Can be used to get a batch using a list of integers indices.""" -> 2804 batch = self.getitem(keys) 2805 n_examples = len(batch[next(iter(batch))]) 2806 return [{col: array[i] for col, array in batch.items()} for i in range(n_examples)] [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in getitem(self, key) 2798 def getitem(self, key): # noqa: F811 2799 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" -> 2800 return self._getitem(key) 2801 2802 def getitems(self, keys: List) -> List: [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in _getitem(self, key, **kwargs) 2782 format_kwargs = format_kwargs if format_kwargs is not None else {} 2783 formatter = get_formatter(format_type, features=self._info.features, **format_kwargs) -> 2784 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) 2785 formatted_output = format_table( 2786 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in query_table(table, key, indices) 581 else: 582 size = indices.num_rows if indices is not None else table.num_rows --> 583 _check_valid_index_key(key, size) 584 # Query the main table 585 if indices is None: [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_index_key(key, size) 534 elif isinstance(key, Iterable): 535 if len(key) > 0: --> 536 _check_valid_index_key(int(max(key)), size=size) 537 _check_valid_index_key(int(min(key)), size=size) 538 else: [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_index_key(key, size) 524 if isinstance(key, int): 525 if (key < 0 and key + size < 0) or (key >= size): --> 526 raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") 527 return 528 elif isinstance(key, slice): IndexError: Invalid key: 47682 is out of bounds for size 0 ### Steps to reproduce the bug device = "cuda:0" if torch.cuda.is_available() else "cpu" #defining model name for tokenizer and model loading model_name= "t5-small" #loading the tokenizer tokenizer = AutoTokenizer.from_pretrained(model_name) def preprocess_function(data, tokenizer): inputs = [f"Paraphrase this sentence: {doc}" for doc in data["text"]] model_inputs = tokenizer(inputs, max_length=150, truncation=True) labels = [ast.literal_eval(i)[0] for i in data['paraphrases']] labels = tokenizer(labels, max_length=150, truncation=True) model_inputs["labels"] = labels["input_ids"] return model_inputs train_dataset = load_dataset("humarin/chatgpt-paraphrases", split="train").shuffle(seed=42).select(range(50000)) val_dataset = load_dataset("humarin/chatgpt-paraphrases", split="train").shuffle(seed=42).select(range(50000,55000)) tokenized_train = train_dataset.map(lambda batch: preprocess_function(batch, tokenizer), batched=True) tokenized_val = val_dataset.map(lambda batch: preprocess_function(batch, tokenizer), batched=True) def print_trainable_parameters(model): """ Prints the number of trainable parameters in the model. """ trainable_params = 0 all_param = 0 for _, param in model.named_parameters(): all_param += param.numel() if param.requires_grad: trainable_params += param.numel() print( f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}" ) config = LoraConfig( r=16, #attention heads lora_alpha=32, #alpha scaling lora_dropout=0.05, bias="none", task_type="Seq2Seq" ) #loading the model model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(device) model = get_peft_model(model, config) print_trainable_parameters(model) #loading the data collator data_collator = DataCollatorForSeq2Seq( tokenizer=tokenizer, model=model, label_pad_token_id=-100, padding="longest" ) #defining the training arguments training_args = Seq2SeqTrainingArguments( output_dir=os.getcwd(), evaluation_strategy="epoch", save_strategy="epoch", learning_rate=2e-5, per_device_train_batch_size=16, per_device_eval_batch_size=16, weight_decay=1e-3, save_total_limit=3, load_best_model_at_end=True, num_train_epochs=1, predict_with_generate=True ) def compute_metric_with_extra(tokenizer): def compute_metrics(eval_preds): metric = evaluate.load('rouge') preds, labels = eval_preds # decode preds and labels labels = np.where(labels != -100, labels, tokenizer.pad_token_id) decoded_preds = tokenizer.batch_decode(preds, skip_special_tokens=True) decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True) # rougeLSum expects newline after each sentence decoded_preds = ["\n".join(nltk.sent_tokenize(pred.strip())) for pred in decoded_preds] decoded_labels = ["\n".join(nltk.sent_tokenize(label.strip())) for label in decoded_labels] result = metric.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True) return result return compute_metrics trainer = Seq2SeqTrainer( model=model, args=training_args, train_dataset=tokenized_train, eval_dataset=tokenized_val, tokenizer=tokenizer, data_collator=data_collator, compute_metrics= compute_metric_with_extra(tokenizer) ) trainer.train() ### Expected behavior I would want the trainer to train normally as it was before I used- model = get_peft_model(model, config) ### Environment info datasets version- 2.16.0 peft version- 0.7.1 transformers version- 4.35.2 accelerate version- 0.25.0 python- 3.10.12 enviroment- google colab This is surely the same issue as https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0/14298/25 that comes from the `transformers` `Trainer`. You should add `remove_unused_columns=False` to `TrainingArguments` Also check your logs: the `Trainer` should log the length of your dataset before training starts and it surely showed length=0.
[ -0.21287032961845398, -0.5975079536437988, -0.021510977298021317, 0.5354568362236023, 0.2863747477531433, -0.0014904364943504333, 0.16571851074695587, 0.5132600665092468, 0.1871633231639862, 0.06414587795734406, -0.05213215947151184, -0.19202247262001038, 0.008951925672590733, 0.44905367493629456, -0.2533906400203705, -0.39287373423576355, -0.03005889803171158, -0.0009357184171676636, 0.18383635580539703, 0.08560141921043396, -0.29316776990890503, 0.04037342593073845, 0.013849347829818726, 0.265561580657959, -0.22884000837802887, -0.006906980648636818, 0.17141269147396088, 0.2383139431476593, -0.18324795365333557, 0.061338216066360474, 0.1960093080997467, -0.5431766510009766, 0.312274694442749, 0.40835806727409363, -0.00012402185529936105, 0.24495278298854828, -0.05127996206283569, -0.07198471575975418, 0.1905278116464615, 0.1606358140707016, 0.2696671187877655, 0.18954229354858398, -0.11262369900941849, -0.21375888586044312, -0.11645104736089706, -0.09986548870801926, -0.16319991648197174, 0.5159098505973816, 0.4833795428276062, 0.4190363585948944, 0.1295231282711029, 0.3328537344932556, 0.15467381477355957, 0.09620518982410431, 0.15507838129997253, -0.21187560260295868, -0.15440478920936584, -0.20532046258449554, -0.09040738642215729, -0.08246391266584396, -0.05472371727228165, 0.032614290714263916, 0.10974918305873871, -0.06009649857878685, 0.0644463375210762, -0.04685405641794205, 0.5929166674613953, -0.5907230377197266, -0.009368546307086945, 0.0971260815858841, 0.0936286523938179, 0.005056485533714294, -0.3654504418373108, -0.39107534289360046, -0.07346096634864807, -0.5092145204544067, 0.05515209585428238, -0.04354075342416763, -0.1571791172027588, 0.27124685049057007, 0.4189634919166565, 0.0012306652497500181, 0.005158022046089172, -0.05884535610675812, -0.1584484875202179, 0.21743561327457428, 0.2336287498474121, 0.1302179992198944, 0.1877063512802124, -0.26886606216430664, -0.10559011995792389, 0.2562188506126404, -0.14010018110275269, 0.12271512299776077, -0.22308383882045746, -0.21275240182876587, 0.4024931490421295, -0.12340951710939407, 0.1411116123199463, 0.23534522950649261, -0.23655657470226288, -0.045399874448776245, 0.33853575587272644, -0.34961050748825073, 0.1852230429649353, 0.23027200996875763, -0.22377833724021912, 0.4895820915699005, -0.023181170225143433, 0.11141721904277802, -0.20493416488170624, -0.0918978825211525, 0.062234699726104736, -0.16069573163986206, 0.1875198632478714, -0.008618824183940887, 0.0877632349729538, -0.25325486063957214, -0.13718140125274658, 0.21573282778263092, -0.23557394742965698, 0.009644858539104462, 0.353511244058609, 0.42792487144470215, 0.3656603693962097, 0.3587600886821747, 0.0428071990609169, 0.09230471402406693, -0.5156785845756531, -0.08351130038499832, -0.2179732769727707, 0.21541596949100494, -0.005296442657709122, -0.13049647212028503, -0.04172943904995918, -0.12184658646583557, 0.1380046159029007, -0.07340620458126068, 0.33325040340423584, -0.2574259042739868, -0.024800799787044525, -0.345199316740036, 0.02178637683391571, 0.43217548727989197, -0.28228285908699036, 0.1041690930724144, 0.0913577675819397, -0.12237852811813354, -0.01981111615896225, 0.26172906160354614, -0.669925332069397, -0.7280267477035522, 0.06274623423814774, 0.08750907331705093, -0.5003777146339417, 0.010474065318703651, 0.3879719078540802, 0.03350815176963806, 0.17157703638076782, -0.20779363811016083, 0.09859811514616013, -0.36765390634536743, -0.3791221082210541, -0.1256929636001587, 0.1764472872018814, 0.2724490165710449, -0.20780204236507416, -0.027015667408704758, 0.1018330380320549, 0.05436163395643234, -0.06368342787027359, 0.33390283584594727, -0.05020987242460251, 0.3576222360134125, -0.2456224113702774, 0.6113250255584717, 0.6455833315849304, -0.3322063386440277, -0.5473970770835876, 0.12039225548505783, -0.15913426876068115, -0.05880294740200043, -0.0608670637011528, -0.15986712276935577, -0.04173633083701134, 0.025118157267570496, 0.021975040435791016, 0.06649244576692581, -0.1363878846168518, 0.06825986504554749, -0.26514285802841187, -0.052060630172491074, 0.4267921447753906, 0.10316523909568787, 0.3352837562561035, -0.15310487151145935, -0.03611012548208237, 0.5415659546852112, -0.06584206968545914, 0.015407111495733261, -0.07597687840461731, 0.18642322719097137, 0.33384913206100464, -0.21899880468845367, 0.22260186076164246, -0.13962385058403015, 0.010582752525806427, 0.41057610511779785, -0.18441826105117798, 0.013455409556627274, -0.05970783531665802, 0.26350271701812744, -0.26694342494010925, 0.10480276495218277, -0.050847526639699936, -0.25029149651527405, 0.009931635111570358, -0.24408426880836487, 0.24212217330932617, -0.29054945707321167, 0.06290596723556519, -0.327045738697052, -0.34419092535972595, 0.031229553744196892, -0.15371686220169067, 0.31655168533325195, -0.030089134350419044, -0.31617817282676697, -0.4384259283542633, 0.22590520977973938, 0.17501553893089294, 0.0319531075656414, -0.14090922474861145, 0.2704559564590454, 0.07085762172937393, -0.5356631875038147, -0.0980188176035881, 0.940079927444458, 0.043189093470573425, 0.06783626973628998, -0.061175696551799774, -0.08391989767551422, 0.08314170688390732, -0.03245537728071213, 0.30492106080055237, 0.49910402297973633, 0.2948993742465973, 0.3668377697467804, -0.08251789212226868, -0.21566078066825867, -0.05528074502944946, 0.04022854194045067, 0.1676405817270279, 0.10869577527046204, 0.1490681767463684, -0.21057523787021637, 0.04301263764500618, -0.09325382858514786, -0.05456414073705673, 0.12874305248260498, 0.26042723655700684, 0.035384681075811386, 0.2234407663345337, 0.16660970449447632, 0.10299219191074371, -0.009879093617200851, -0.011286916211247444, 0.0029459111392498016, 0.3017736077308655, 0.1896960586309433, -0.11951671540737152, 0.08738221973180771, 0.027638476341962814, 0.05808218568563461, 0.148762047290802, 0.2047763615846634, -0.0886702686548233, 0.45231467485427856, 0.05145052820444107, 0.10285810381174088, 0.009478054940700531, -0.20415902137756348, 0.055717356503009796, 0.5352023243904114, -0.5994270443916321, 0.02606792561709881, 0.008507007732987404, -0.31130251288414, -0.008946104906499386, 0.35863614082336426, -0.39237263798713684, -0.35263723134994507, 0.2424902617931366, 0.04843730106949806, -0.05855930969119072, -0.12404929846525192, -0.20189034938812256, -0.029061928391456604, 0.25770822167396545, 0.031215226277709007, -0.015345219522714615, 0.19122757017612457, -0.05982835590839386, -0.028301095589995384, 0.15146823227405548, -0.14626796543598175, 0.04686097800731659, 0.07394730299711227, -0.09732329100370407, -0.012599168345332146, -0.38834309577941895, 0.3025793731212616, -0.3040269613265991, 0.3967277407646179, 0.11644895374774933, 0.36671918630599976, -0.16555172204971313, 0.02532108873128891, 0.2981661558151245, -0.10796932876110077, -0.23955988883972168, 0.09087547659873962, -0.09296758472919464, 0.4494931995868683, -0.21610350906848907, 0.026847369968891144, 0.14720211923122406, -0.2718904912471771, 0.10324878990650177, 0.14992740750312805, 0.1604917049407959, 0.3336223363876343, 0.14434775710105896, 0.09791024029254913, -0.030779076740145683, 0.08185552805662155, -0.09005817025899887, -0.01041492074728012, 0.30309659242630005, 0.207303985953331, -0.2544763684272766, -0.06105008348822594, 0.10610365867614746, -0.2091098129749298, -0.01701323129236698, -0.25613635778427124, -0.5755210518836975, -0.04508519172668457, 0.33632317185401917, -0.3807228207588196, 0.2688854932785034, 0.1943957805633545, -0.15799987316131592, 0.09424734115600586, 0.06753993779420853, 0.00036519020795822144, 0.07160089164972305, 0.2887163460254669, 0.1952810138463974, -0.2060803472995758, 0.39690810441970825, 0.037643831223249435, 0.8766027092933655, 0.030354343354701996, 0.020274152979254723, -0.008277371525764465, -0.2946724593639374, -0.17668510973453522, -0.36223429441452026, 0.17963862419128418, 0.17808043956756592, 0.15231075882911682, -0.30005180835723877, 0.1346045434474945, 0.022132018581032753, 0.17285391688346863, -0.021019285544753075, -0.16661706566810608, -0.37177976965904236, -0.1826246827840805, 0.2905014157295227, 0.061851657927036285, 0.027536828070878983, -0.3617083430290222, 0.3486842215061188, -0.20320776104927063, -0.13928833603858948, -0.007934251800179482, -0.0735422819852829, 0.1388934999704361, 0.012314721010625362, 0.37747374176979065, -0.49375563859939575, -0.5113925933837891, 0.3244437277317047, 0.17764446139335632, 0.227835550904274, -0.10385230928659439, -0.5623242855072021, 0.1390683799982071, -0.16487984359264374, 0.644271731376648, -0.13345682621002197, 0.13191351294517517, 0.005559384822845459, -0.2845063805580139, -0.3022259473800659, -0.3760749399662018, -0.30394673347473145, 0.1591590791940689, -0.22348259389400482, 0.30330711603164673, -0.31953802704811096, -0.20297081768512726, 0.01222576666623354, -0.02326236478984356, -0.23639924824237823, -0.015806030482053757, -0.1261337548494339, -0.2208826243877411, -0.14256170392036438, 0.12718549370765686, 0.34984222054481506, 0.3451091945171356, -0.016527652740478516, 0.5062042474746704, 0.11640094220638275, -0.030532535165548325, -0.0015689656138420105, 0.12028095126152039, 0.28683266043663025, -0.04585122689604759, 0.11100040376186371, -0.051442019641399384, 0.20666815340518951, -0.153889000415802, 0.3027200698852539, 0.2505328357219696, 0.07310383766889572, 0.18987628817558289, 0.27523499727249146, -0.12467695027589798, 0.21249011158943176, 0.02265433594584465, 0.17552784085273743, -0.1718708723783493, 0.33629995584487915, -0.10953079909086227, -0.18860282003879547, 0.3955034911632538, 0.030348755419254303, -0.25004157423973083, -0.019558213651180267, 0.24269339442253113, 0.10626576840877533, 0.13605444133281708, 0.09915098547935486, 0.09246768057346344, -0.13161426782608032, 0.47557276487350464, -0.04503772407770157, 0.8062431812286377, -0.006495684385299683, 0.003065541386604309, 0.4439108967781067, 0.23362518846988678, 0.31944504380226135, -0.3124028444290161, -0.0458163321018219, -0.17098665237426758, -0.48325061798095703, -0.027281079441308975, 0.09162989258766174, -0.3868556320667267, -0.10322670638561249, 0.18874946236610413, 0.12488076835870743, -0.07606315612792969, -0.2641275227069855, -0.2090788185596466, 0.11043867468833923, 0.19094666838645935, 0.10818599164485931, -0.2525106370449066, 0.01967843621969223, -0.2713850736618042, 0.2984204888343811, -0.2059699296951294, -0.026537712663412094, -0.018447361886501312, -0.4216049313545227, -0.21087415516376495, -0.12634998559951782, -0.11582928150892258, 0.05309354513883591, 0.17309720814228058, -0.1663869023323059, 0.06874307990074158, -0.11153727769851685, -0.1763692945241928, -0.09326255321502686, -0.2938266694545746, 0.16074073314666748, 0.21687522530555725, 0.12125024944543839, 0.20437058806419373, 0.04871043190360069, 0.32412949204444885, -0.028947580605745316, -0.21730902791023254, -0.09990762919187546, -0.18131676316261292, -0.13042956590652466, -0.2833663821220398, -0.09892749786376953, -0.10834980010986328, -0.38294124603271484, 0.05409206077456474, -0.08328455686569214, -0.16962219774723053, -0.03780166432261467, 0.04327421635389328, 0.02348334714770317, -0.19661617279052734, -0.15702348947525024, -0.018960576504468918, -0.5118918418884277, -0.08980709314346313, 0.5029295682907104, -0.007832176983356476, 0.12889467179775238, 0.5800577402114868, 0.1990828514099121, -0.011793112382292747, -0.11156073957681656, 0.029214590787887573, 0.43436315655708313, -0.5924548506736755, 0.08664117008447647, 0.054174430668354034, 0.053994566202163696, 0.045849863439798355, 0.11086947470903397, 0.32369327545166016, -0.07241205126047134, -0.20668943226337433, -0.22691503167152405, -0.3650803864002228, 0.3188011050224304, 0.023229653015732765, -0.08177495002746582, -0.5254514217376709, 0.18854455649852753, 0.08677665144205093, -0.3614562451839447, -0.2111302614212036, 0.0003184590023010969, -0.27346569299697876, 0.018479876220226288, 0.23159165680408478, -0.090898297727108, 0.1377587616443634, 0.09950919449329376, -0.021014170721173286, 0.12939390540122986, -0.29240599274635315, -0.12394420802593231, -0.05987508222460747, 0.18145480751991272, 0.09353970736265182, -0.06264331936836243, -0.04906133562326431, -0.11980710923671722, -0.07748058438301086, -0.038630153983831406, 0.10066747665405273, 0.09972239285707474, 0.03783908113837242, 0.38089442253112793, 0.4198525846004486, 0.22558745741844177, -0.23955759406089783, 0.1080217957496643, 0.2024657130241394, 0.5082212090492249, 0.12708495557308197, 0.3352166414260864, 0.10870888084173203, 0.14420294761657715, -0.5887001752853394, -0.007406599819660187, -0.17436210811138153, 0.06433472782373428, 0.04026757925748825, -0.1100379079580307, 0.022431839257478714, 0.1618175357580185, 0.3150503635406494, 0.43197211623191833, -0.2941875457763672, 0.20411433279514313, 0.15271863341331482, 0.11652732640504837, -0.03820982575416565, 0.1008085310459137, 0.24648067355155945, -0.07806925475597382, -0.0941125750541687, 0.4005235433578491, 0.0491977296769619, 0.08130589127540588, 0.03451648727059364, 0.11871711164712906, -0.1666840761899948, 0.0382549874484539, 0.018609579652547836, 0.8789008855819702, -0.11265543103218079, -0.1744612157344818, 0.3471280634403229, -0.2084258645772934, 0.10816989094018936, 0.36693596839904785, -0.12024030834436417, 0.16732972860336304, -0.2866964638233185, 0.11079660058021545, -0.20313256978988647, -0.5328012108802795, -0.10622847080230713, -0.21398770809173584, 0.2523994743824005, 0.023463286459445953, -0.2776202857494354, 0.37106338143348694, 0.08815214782953262, -0.24053850769996643, -0.2396571934223175, 0.16151724755764008, -0.3605417311191559, -0.07412029802799225, -0.026753533631563187, -0.1865592896938324, -0.318139910697937, 0.026921045035123825, -0.09643581509590149, -0.08855567872524261, -0.05707688629627228, 0.18431229889392853, -0.32843297719955444, 0.4315192699432373, -0.2691117823123932, 0.2839328944683075, 0.2733254134654999, -0.36677372455596924, 0.22450532019138336, 0.1509600430727005, -0.4629213511943817, 0.3372061848640442, 0.027009300887584686, 0.34906667470932007, -0.0206921249628067, -0.43529435992240906, 0.017752472311258316, 0.27944666147232056, -0.006619244813919067, -0.03847365453839302, 0.08440344035625458, -0.0056803226470947266, 0.44935405254364014, 0.333884060382843, 0.0005349256098270416, -0.2378181368112564, -0.12393005192279816, -0.20129133760929108, 0.6778603196144104, -0.2654394209384918, 0.2669994831085205, 0.08210225403308868, -0.09357371181249619, -0.04807380586862564, 0.05320923402905464, -0.18592563271522522, 0.2288883477449417, 0.09521637856960297, 0.15340556204319, 0.06613899767398834, 0.10370200127363205, 0.003993069753050804, -0.21850518882274628, 0.4998416304588318, 0.4369279444217682, -0.3334617018699646, -0.17358361184597015, 0.5076466202735901, -0.27391764521598816, 0.14948013424873352, -0.18929804861545563, 0.034039996564388275, 0.4126569926738739, 0.275679349899292, -0.13583189249038696, -0.03423701971769333, 0.46880632638931274, -0.35844552516937256, 0.09809388965368271, 0.5012232065200806, -0.2585510015487671, -0.21049074828624725, -0.42259645462036133, 0.08587872236967087, 0.0739016979932785, -0.05317917838692665, 0.008417699486017227, 0.08025747537612915, 0.021880120038986206, 0.008419271558523178, -0.4086513817310333, -0.11958055198192596, -0.20927080512046814, 0.6342658996582031, 0.1820909082889557, 0.09886818379163742, 0.029401622712612152, 0.17434169352054596, -0.43538805842399597, -0.33070307970046997, -0.1329275667667389, 0.1217317283153534, -0.27158498764038086, 0.24862423539161682, 0.0337689071893692, -0.1125735491514206, -0.35857143998146057, -0.45848315954208374, -0.20321929454803467, -0.2864379286766052, -0.16897039115428925, 0.08640653640031815, -0.02904023602604866, -0.00047916348557919264, -0.06520377099514008, 0.33629563450813293, 0.11753515899181366, -0.17326147854328156, -0.20965448021888733, -0.3169637620449066, 0.4150776267051697, -0.10761133581399918, -0.15981747210025787, 0.17661632597446442, 0.23348014056682587, -0.07369043678045273, 0.04489801079034805, -0.68454909324646, 0.034858785569667816, 0.1909540295600891, 0.07308773696422577, -0.4257243573665619, -0.015228226780891418, -0.2465122640132904, 0.0014263689517974854, 0.15323467552661896, 0.03203549608588219, -0.10352049022912979, -0.06636445969343185, 0.2233850657939911, 0.01181308925151825 ]
https://github.com/huggingface/datasets/issues/6532
[Feature request] Indexing datasets by a customly-defined id field to enable random access dataset items via the id
You can simply use a python dict as index: ```python >>> from datasets import load_dataset >>> ds = load_dataset("BeIR/dbpedia-entity", "corpus", split="corpus") >>> index = {key: idx for idx, key in enumerate(ds["_id"])} >>> ds[index["<dbpedia:Pikachu>"]] {'_id': '<dbpedia:Pikachu>', 'title': 'Pikachu', 'text': 'Pikachu (Japanese: ピカチュウ) are a fictional species of Pokémon. Pokémon are fictional creatures that appear in an assortment of comic books, animated movies and television shows, video games, and trading card games licensed by The Pokémon Company, a Japanese corporation. The Pikachu design was conceived by Ken Sugimori.'} ```
### Feature request Some datasets may contain an id-like field, for example the `id` field in [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) and the `_id` field in [BeIR/dbpedia-entity](https://huggingface.co/datasets/BeIR/dbpedia-entity). HF datasets support efficient random access via row, but not via this kinds of id fields. I wonder if it is possible to add support for indexing by a custom "id-like" field to enable random access via such ids. The ids may be numbers or strings. ### Motivation In some cases, especially during inference/evaluation, I may want to find out the item that has a specified id, defined by the dataset itself. For example, in a typical re-ranking setting in information retrieval, the user may want to re-rank the set of candidate documents of each query. The input is usually presented in a TREC-style run file, with the following format: ``` <qid> Q0 <docno> <rank> <score> <tag> ``` The re-ranking program should be able to fetch the queries and documents according to the `<qid>` and `<docno>`, which are the original id defined in the query/document datasets. To accomplish this, I have to iterate over the whole HF dataset to get the mapping from real ids to row ids every time I start the program, which is time-consuming. Thus I want HF dataset to provide options for users to index by a custom id column, not by row. ### Your contribution I'm not an expert in this project and I'm afraid that I'm not able to make contributions on the code.
87
[Feature request] Indexing datasets by a customly-defined id field to enable random access dataset items via the id ### Feature request Some datasets may contain an id-like field, for example the `id` field in [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) and the `_id` field in [BeIR/dbpedia-entity](https://huggingface.co/datasets/BeIR/dbpedia-entity). HF datasets support efficient random access via row, but not via this kinds of id fields. I wonder if it is possible to add support for indexing by a custom "id-like" field to enable random access via such ids. The ids may be numbers or strings. ### Motivation In some cases, especially during inference/evaluation, I may want to find out the item that has a specified id, defined by the dataset itself. For example, in a typical re-ranking setting in information retrieval, the user may want to re-rank the set of candidate documents of each query. The input is usually presented in a TREC-style run file, with the following format: ``` <qid> Q0 <docno> <rank> <score> <tag> ``` The re-ranking program should be able to fetch the queries and documents according to the `<qid>` and `<docno>`, which are the original id defined in the query/document datasets. To accomplish this, I have to iterate over the whole HF dataset to get the mapping from real ids to row ids every time I start the program, which is time-consuming. Thus I want HF dataset to provide options for users to index by a custom id column, not by row. ### Your contribution I'm not an expert in this project and I'm afraid that I'm not able to make contributions on the code. You can simply use a python dict as index: ```python >>> from datasets import load_dataset >>> ds = load_dataset("BeIR/dbpedia-entity", "corpus", split="corpus") >>> index = {key: idx for idx, key in enumerate(ds["_id"])} >>> ds[index["<dbpedia:Pikachu>"]] {'_id': '<dbpedia:Pikachu>', 'title': 'Pikachu', 'text': 'Pikachu (Japanese: ピカチュウ) are a fictional species of Pokémon. Pokémon are fictional creatures that appear in an assortment of comic books, animated movies and television shows, video games, and trading card games licensed by The Pokémon Company, a Japanese corporation. The Pikachu design was conceived by Ken Sugimori.'} ```
[ -0.18381492793560028, 0.1862204670906067, -0.08400572836399078, 0.07549075782299042, -0.17324188351631165, 0.13344833254814148, 0.427153617143631, 0.21261221170425415, 0.41409698128700256, 0.08223038166761398, -0.14501743018627167, 0.451375275850296, -0.1339075267314911, 0.13514851033687592, 0.07874757051467896, -0.08257214725017548, -0.12613269686698914, 0.17514494061470032, 0.3834618628025055, 0.17360498011112213, -0.5029159784317017, -0.1569906622171402, -0.10193800926208496, 0.09797563403844833, 0.07946626096963882, 0.0112389475107193, -0.055420465767383575, 0.09904374182224274, -0.05407553166151047, -0.6075032949447632, 0.2313021570444107, 0.570752739906311, 0.24796158075332642, 0.16295850276947021, -0.00011804694077000022, 0.0030319765210151672, -0.08329993486404419, 0.08524078130722046, -0.11510662734508514, -0.1674865037202835, -0.23688378930091858, 0.1820080727338791, -0.10029053688049316, -0.23036888241767883, -0.050834864377975464, -0.22327132523059845, -0.03310856223106384, -0.3715987205505371, -0.46164005994796753, 0.0007862430065870285, 0.10242411494255066, 0.035985980182886124, -0.025729138404130936, 0.0888960137963295, 0.6263260245323181, 0.23183296620845795, -0.1578637659549713, 0.013384494930505753, 0.1648288071155548, -0.19340571761131287, -0.03149924427270889, 0.16251900792121887, 0.14103323221206665, -0.029586952179670334, 0.519053041934967, 0.08752065896987915, -0.46111273765563965, 0.021387631073594093, -0.07693365216255188, 0.2896271049976349, 0.23597916960716248, -0.3622637987136841, -0.5475104451179504, -0.1797674000263214, 0.1405041515827179, -0.2589466869831085, -0.00849410891532898, -0.05016380548477173, 0.008990654721856117, 0.26331719756126404, 0.12453992664813995, 0.06891702860593796, -0.1530541181564331, 0.23129984736442566, -0.027414266020059586, 0.13075155019760132, 0.20247937738895416, 0.09981551766395569, 0.03884686529636383, -0.34873515367507935, 0.26252803206443787, -0.04720281809568405, -0.10233113169670105, 0.24612587690353394, -0.2657007873058319, -0.40934911370277405, 0.03358589857816696, -0.210961252450943, 0.2143520712852478, 0.1486532986164093, -0.17416299879550934, 0.19068875908851624, -0.1753462255001068, -0.12678319215774536, -0.04555535688996315, 0.07283642888069153, -0.13411179184913635, 0.36261579394340515, 0.19002410769462585, -0.07434157282114029, -0.2750062346458435, -0.08458968251943588, -0.14508917927742004, 0.23881274461746216, 0.07869680225849152, -0.09929917007684708, -0.3612542748451233, 0.05817997828125954, -0.26142287254333496, 0.04360462725162506, -0.33284488320350647, -0.20047025382518768, -0.024839971214532852, 0.28027576208114624, 0.25145581364631653, -0.2733165919780731, -0.0070765018463134766, 0.02870064042508602, -0.1635797619819641, -0.047461628913879395, 0.061319466680288315, 0.15004660189151764, 0.08485390245914459, 0.1286391168832779, 0.19599643349647522, -0.15684399008750916, -0.11127552390098572, -0.003157501108944416, -0.13623085618019104, 0.11041074991226196, 0.2767467200756073, -0.15365280210971832, 0.07551537454128265, 0.028108393773436546, -0.352247953414917, -0.25180181860923767, 0.11442190408706665, -0.13138267397880554, -0.28202682733535767, 0.05273999273777008, -0.10833006352186203, -0.4052266478538513, 0.016952164471149445, 0.04408615827560425, 0.107479527592659, -0.2687893211841583, 0.1962018609046936, 0.46330440044403076, -0.14709880948066711, -0.04190836101770401, 0.14658784866333008, -0.020820211619138718, -0.34276115894317627, 0.0027883860748261213, -0.08010449260473251, 0.27877503633499146, -0.1490556299686432, -0.13592416048049927, 0.06947705894708633, 0.18200990557670593, -0.16188332438468933, -0.0010156221687793732, -0.22413769364356995, 0.31947076320648193, -0.35031944513320923, 0.33334672451019287, 0.14517319202423096, -0.3215511441230774, -0.3804020285606384, 0.2508656680583954, 0.050124719738960266, 0.21145960688591003, 0.25191572308540344, 0.3836403489112854, 0.363022118806839, -0.050944432616233826, 0.5299721956253052, 0.08662018179893494, -0.008423494175076485, -0.27524036169052124, 0.003690361976623535, -0.5447368621826172, -0.11771005392074585, 0.20865009725093842, 0.22521422803401947, 0.26931893825531006, 0.4957037568092346, -0.2452177256345749, 0.1141972467303276, -0.14559990167617798, -0.18196386098861694, -0.19743020832538605, 0.14898937940597534, 0.37258070707321167, 0.10081642121076584, -0.48470935225486755, -0.06344915181398392, 0.26425695419311523, 0.1576242297887802, 0.03328058123588562, -0.08789707720279694, -0.43238353729248047, -0.06182865425944328, 0.1890721470117569, -0.13392750918865204, 0.09734994173049927, 0.01842915639281273, -0.1721721887588501, -0.13541550934314728, -0.17640285193920135, -0.440520703792572, 0.16104939579963684, -0.15013571083545685, 0.024478280916810036, -0.12032702565193176, 0.13768470287322998, 0.1726633608341217, 0.24818041920661926, -0.1773541271686554, 0.2908593416213989, 0.07489761710166931, 0.04963726922869682, 0.048597898334264755, 0.13028711080551147, 0.2357948273420334, -0.313518762588501, 0.6215791702270508, 0.47759175300598145, 0.2373061180114746, -0.08307535201311111, 0.21958602964878082, 0.03211014345288277, 0.12510623037815094, 0.02877582609653473, 0.0260419063270092, 0.6936212182044983, -0.2749295234680176, 0.22604253888130188, -0.047167789191007614, -0.2023017555475235, 0.2632926404476166, -0.005536150187253952, 0.06994699686765671, -0.22088344395160675, 0.04687650501728058, 0.04401011765003204, -0.025750311091542244, -0.07887286692857742, -0.6568862795829773, 0.21870160102844238, -0.16281916201114655, -0.055497653782367706, 0.049072276800870895, 0.18949085474014282, 0.023228030651807785, 0.19474130868911743, -0.02479328028857708, 0.18742991983890533, 0.21922177076339722, 0.22125747799873352, -0.14566129446029663, 0.02511625923216343, 0.08875671774148941, 0.08463510870933533, 0.18090775609016418, -0.19740481674671173, -0.3933178782463074, 0.2960710823535919, 0.15510915219783783, 0.07391664385795593, 0.07294969260692596, -0.47849521040916443, 0.04817652702331543, 0.13474659621715546, -0.47955653071403503, 0.0956793874502182, -0.1666160523891449, -0.11867961287498474, 0.16691966354846954, -0.3636658787727356, 0.00501473993062973, -0.026832766830921173, 0.12497127056121826, 0.20219995081424713, 0.07957415282726288, -0.029443902894854546, -0.4632038176059723, 0.41307881474494934, -0.07372066378593445, -0.5105582475662231, 0.11475618183612823, -0.028086133301258087, 0.07546116411685944, 0.028566282242536545, 0.02037559449672699, 0.14036047458648682, 0.41315412521362305, 0.0878787562251091, 0.16911742091178894, -0.46261948347091675, -0.15263912081718445, 0.08465933799743652, -0.029318250715732574, 0.36021676659584045, 0.3694566488265991, -0.2511674165725708, -0.20080912113189697, 0.01467097271233797, 0.10888025909662247, 0.23301774263381958, -0.0393066368997097, -0.05191362276673317, -0.06834086775779724, 0.33395916223526, 0.022396530956029892, 0.052632980048656464, -0.20739620923995972, -0.07097114622592926, 0.14858639240264893, 0.13176210224628448, 0.32578182220458984, 0.06727318465709686, 0.0647740513086319, 0.002912178635597229, 0.3782835900783539, -0.3941323459148407, -0.24162743985652924, -0.46742546558380127, 0.4228397607803345, -0.2932724952697754, 0.05672835558652878, -0.16025090217590332, -0.3091491460800171, -0.42949432134628296, 0.4188358783721924, -0.27441591024398804, 0.08692046999931335, -0.04958168417215347, 0.6124124526977539, -0.10950936377048492, 0.01159714162349701, 0.09520650655031204, 0.11365608125925064, 0.02553502283990383, -0.08422014117240906, -0.08743664622306824, 0.13288922607898712, -0.02737480401992798, -0.10982904583215714, 0.6706768274307251, 0.17483532428741455, -0.06522512435913086, 0.9710159301757812, -0.12698793411254883, 0.006462007761001587, 0.5416053533554077, -0.12552380561828613, 0.10184739530086517, -0.12692371010780334, -0.31927284598350525, -0.32377079129219055, 0.11021073907613754, -0.11004596203565598, 0.2128051370382309, -0.014456875622272491, -0.016264965757727623, 0.01117028295993805, -0.2512476146221161, 0.22815772891044617, -0.2040180265903473, 0.09473885595798492, -0.08312717080116272, 0.2458365261554718, -0.07941929250955582, 0.21757492423057556, -0.6325733065605164, -0.20864591002464294, 0.14788782596588135, 0.08489898592233658, 0.2731224000453949, -0.14536772668361664, 0.0793817937374115, -0.3027143180370331, -0.28080567717552185, 0.10593712329864502, 0.28638756275177, 0.3346821367740631, 0.08445876836776733, 0.10183980315923691, 0.14406989514827728, -0.00683284318074584, 0.6538885831832886, -0.47266122698783875, 0.03493014723062515, 0.09749148786067963, -0.02114170230925083, 0.1610780954360962, 0.13645125925540924, 0.12762638926506042, -0.12746037542819977, -0.395941823720932, 0.5287178754806519, -0.21420931816101074, -0.003364735748618841, 0.23531273007392883, -0.34181615710258484, -0.11474278569221497, -0.6051795482635498, 0.02020636573433876, 0.06563246250152588, -0.12381062656641006, -0.11838366836309433, 0.018898101523518562, -0.057968609035015106, 0.2693450152873993, 0.21635685861110687, -0.5535827279090881, 0.30943062901496887, 0.30679214000701904, 0.024418413639068604, -0.07133887708187103, 0.18160051107406616, 0.3257941007614136, 0.35365748405456543, -0.30329376459121704, 0.38097867369651794, 0.4104325771331787, -0.22644010186195374, -0.16127237677574158, -0.41032665967941284, -0.24983695149421692, -0.011350378394126892, 0.23413491249084473, 0.0570426806807518, 0.4658530652523041, -0.1975361853837967, 0.041956763714551926, -0.4572707712650299, -0.26801082491874695, -0.05267985165119171, -0.10540889948606491, -0.1733407825231552, -0.6631364226341248, 0.3715638518333435, -0.26776134967803955, -0.23542028665542603, 0.28159618377685547, 0.6877222061157227, -0.323514461517334, 0.4576631784439087, 0.11189959943294525, 0.8206660151481628, -0.07785584032535553, -0.023289579898118973, -0.02379433810710907, -0.39795833826065063, 0.01806090772151947, -0.16980628669261932, 0.03634724020957947, -0.3124675452709198, -0.3533681631088257, -0.26327481865882874, 0.05419357493519783, 0.18439173698425293, 0.11704283952713013, 0.04384073242545128, 0.15123236179351807, -0.07422920316457748, -0.2928236424922943, -0.15854381024837494, 0.3106882870197296, -0.025354227051138878, -0.40165337920188904, 0.07298336923122406, 0.040606789290905, 0.05203056335449219, 0.019214067608118057, -0.020049933344125748, -0.08312701433897018, -0.058444805443286896, 0.23650388419628143, -0.1831057369709015, -0.3773992359638214, -0.06587918847799301, 0.02700958028435707, -0.03266168758273125, 0.004366688430309296, 0.3829329013824463, -0.33872726559638977, 0.22840993106365204, -0.15731695294380188, -0.09453180432319641, 0.05358652025461197, 0.31908220052719116, 0.2119693160057068, 0.1704500913619995, -0.018344614654779434, 0.25272783637046814, 0.32882893085479736, -0.40152832865715027, 0.03394228219985962, 0.0522332563996315, -0.5063411593437195, -0.11591622233390808, -0.0993354469537735, 0.12116934359073639, -0.3321288526058197, -0.00992627628147602, -0.22688794136047363, 0.030829530209302902, -0.033101797103881836, 0.02175874263048172, -0.18604932725429535, 0.1872125118970871, 0.13446271419525146, -0.15692634880542755, -0.13029536604881287, -0.1266390085220337, 0.21175214648246765, -0.22861817479133606, 0.4610765278339386, 0.2979624271392822, -0.12644393742084503, -0.43596214056015015, -0.09803598374128342, 0.24963676929473877, 0.39676418900489807, 0.0545625314116478, -0.14561565220355988, -0.1912195086479187, 0.003850609064102173, 0.15892967581748962, 0.1914074420928955, 0.15452516078948975, 0.0550011545419693, 0.031210284680128098, -0.3555479347705841, -0.06449989229440689, 0.10155075043439865, -0.01611144468188286, 0.2356867641210556, -0.12907615303993225, -0.16965292394161224, -0.41450992226600647, -0.12301962077617645, -0.2192905992269516, 0.15591339766979218, -0.015383287332952023, -0.03373538702726364, -0.26285919547080994, 0.3074357509613037, -0.019029781222343445, 0.057383839040994644, 0.07528665661811829, -0.07585497200489044, -0.01893412135541439, -0.08942962437868118, -0.34205588698387146, 0.1450556218624115, -0.02957446128129959, 0.0002477518282830715, -0.16582591831684113, -0.289268434047699, -0.24941638112068176, -0.22562523186206818, -0.0017347391694784164, 0.38194701075553894, -0.11411961913108826, 0.09160082787275314, 0.2465212494134903, -0.23154598474502563, -0.17499804496765137, 0.36995238065719604, 0.556182324886322, 0.3483763337135315, 0.0047888257540762424, -0.0015105605125427246, -0.5035330057144165, 0.18125790357589722, -0.055188342928886414, 0.39873841404914856, 0.2801952362060547, -0.12323308736085892, 0.3887155055999756, -0.05134531855583191, 0.2685280740261078, 0.436252236366272, 0.10829505324363708, 0.1499224305152893, -0.09476659446954727, -0.20005179941654205, 0.3386240303516388, 0.05581425130367279, -0.1846022605895996, -0.06346028298139572, 0.12983550131320953, -0.0615343376994133, 0.2594471871852875, 0.601709246635437, 0.3237156569957733, 0.09723451733589172, -0.45665282011032104, -0.28061240911483765, 0.3497621715068817, 0.0568743571639061, -0.42935749888420105, 0.16441895067691803, 0.3177948594093323, -0.1363464891910553, 0.36764779686927795, 0.3087002635002136, 0.20495560765266418, 0.619240939617157, -0.07782240957021713, 0.07344654202461243, 0.5035554766654968, 0.2753572165966034, 0.03758445754647255, -0.2365216463804245, 0.529960572719574, 0.2289111316204071, 0.24456344544887543, 0.01507103443145752, 0.3988518714904785, -0.10158731788396835, 0.15429574251174927, 0.12910166382789612, 0.0731302872300148, -0.018681176006793976, 0.33193477988243103, -0.2747544050216675, 0.15876813232898712, -0.2615809142589569, -0.06508798897266388, -0.26115044951438904, -0.0648559182882309, -0.19099561870098114, -0.06671446561813354, 0.07600940018892288, 0.3997984528541565, -0.4640546441078186, 0.3665620684623718, 0.06055565923452377, 0.5365706086158752, -0.3535088002681732, -0.2685602903366089, -0.042180418968200684, 0.04076548293232918, 0.7217864394187927, 0.08154846727848053, -0.10048426687717438, -0.03091339021921158, -0.2398962378501892, -0.04908303916454315, -0.46542710065841675, 0.05026956647634506, 0.1293104887008667, -0.13285735249519348, -0.27890104055404663, -0.09860062599182129, 0.28072690963745117, -0.01684722863137722, 0.01961645856499672, -0.2599997818470001, 0.37798717617988586, 0.3564503788948059, -0.405418336391449, 0.16474050283432007, 0.09434214234352112, -0.08384884893894196, 0.4569036066532135, 0.029335051774978638, -0.09740079939365387, 0.1852511167526245, 0.10075309872627258, -0.15541738271713257, 0.2602992653846741, 0.3349725306034088, 0.023334890604019165, -0.2586631774902344, 0.052820004522800446, 0.08602786809206009, -0.0711386576294899, -0.08088772743940353, 0.10009858012199402, -0.2772406339645386, -0.24335181713104248, -0.04176507517695427, -0.4460735023021698, 0.4033624827861786, 0.12823882699012756, 0.06037670373916626, -0.10210086405277252, 0.019521944224834442, -0.29020047187805176, 0.2838636040687561, 0.8251069784164429, -0.019942300394177437, -0.24251799285411835, -0.28813445568084717, 0.24404466152191162, -0.22640009224414825, -0.2381916642189026, -0.11945870518684387, 0.04375443235039711, -0.10388927161693573, 0.08748035132884979, 0.027882225811481476, 0.29310694336891174, -0.0636785626411438, 0.2761232554912567, -0.22712107002735138, 0.2646588981151581, -0.05715026706457138, 0.2838082015514374, -0.06117928400635719, -0.0333850234746933, -0.27438822388648987, 0.19145567715168, -0.11169959604740143, 0.07942324131727219, -0.004828233737498522, -0.26229459047317505, -0.0315544456243515, 0.09753695130348206, -0.10236143320798874, 0.09212406724691391, -0.3848501145839691, 0.4223460555076599, -0.3103329539299011, -0.09863056987524033, -0.34071192145347595, 0.3426664471626282, 0.18989036977291107, 0.39625993371009827, 0.2684563398361206, -0.07238356024026871, 0.19091932475566864, -0.49213364720344543, -0.19021795690059662, 0.11430935561656952, 0.12541860342025757, 0.2004050463438034, -0.08370640873908997, -0.389403373003006, -0.07076425105333328, 0.37457242608070374, -0.03686603158712387, 0.3239173889160156, -0.051194097846746445, -0.09315086901187897, 0.17673487961292267, -0.2612006962299347, -0.18059948086738586, -0.03665895760059357, 0.3927461504936218, -0.23095649480819702, -0.025898344814777374 ]
https://github.com/huggingface/datasets/issues/6532
[Feature request] Indexing datasets by a customly-defined id field to enable random access dataset items via the id
Thanks for your reply. Yes, I can do that, but it is time-consuming to do that every time I launch the program (some datasets are extremely big). HF Datasets has a nice feature to support instant data loading and efficient random access via row ids. I'm curious if this beneficial feature could be further extended to custom data columns.
### Feature request Some datasets may contain an id-like field, for example the `id` field in [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) and the `_id` field in [BeIR/dbpedia-entity](https://huggingface.co/datasets/BeIR/dbpedia-entity). HF datasets support efficient random access via row, but not via this kinds of id fields. I wonder if it is possible to add support for indexing by a custom "id-like" field to enable random access via such ids. The ids may be numbers or strings. ### Motivation In some cases, especially during inference/evaluation, I may want to find out the item that has a specified id, defined by the dataset itself. For example, in a typical re-ranking setting in information retrieval, the user may want to re-rank the set of candidate documents of each query. The input is usually presented in a TREC-style run file, with the following format: ``` <qid> Q0 <docno> <rank> <score> <tag> ``` The re-ranking program should be able to fetch the queries and documents according to the `<qid>` and `<docno>`, which are the original id defined in the query/document datasets. To accomplish this, I have to iterate over the whole HF dataset to get the mapping from real ids to row ids every time I start the program, which is time-consuming. Thus I want HF dataset to provide options for users to index by a custom id column, not by row. ### Your contribution I'm not an expert in this project and I'm afraid that I'm not able to make contributions on the code.
59
[Feature request] Indexing datasets by a customly-defined id field to enable random access dataset items via the id ### Feature request Some datasets may contain an id-like field, for example the `id` field in [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) and the `_id` field in [BeIR/dbpedia-entity](https://huggingface.co/datasets/BeIR/dbpedia-entity). HF datasets support efficient random access via row, but not via this kinds of id fields. I wonder if it is possible to add support for indexing by a custom "id-like" field to enable random access via such ids. The ids may be numbers or strings. ### Motivation In some cases, especially during inference/evaluation, I may want to find out the item that has a specified id, defined by the dataset itself. For example, in a typical re-ranking setting in information retrieval, the user may want to re-rank the set of candidate documents of each query. The input is usually presented in a TREC-style run file, with the following format: ``` <qid> Q0 <docno> <rank> <score> <tag> ``` The re-ranking program should be able to fetch the queries and documents according to the `<qid>` and `<docno>`, which are the original id defined in the query/document datasets. To accomplish this, I have to iterate over the whole HF dataset to get the mapping from real ids to row ids every time I start the program, which is time-consuming. Thus I want HF dataset to provide options for users to index by a custom id column, not by row. ### Your contribution I'm not an expert in this project and I'm afraid that I'm not able to make contributions on the code. Thanks for your reply. Yes, I can do that, but it is time-consuming to do that every time I launch the program (some datasets are extremely big). HF Datasets has a nice feature to support instant data loading and efficient random access via row ids. I'm curious if this beneficial feature could be further extended to custom data columns.
[ -0.22591298818588257, 0.24693679809570312, -0.0808679386973381, 0.09924039244651794, -0.20660282671451569, 0.08933370560407639, 0.42412880063056946, 0.19678808748722076, 0.39071783423423767, 0.07601112872362137, -0.12071589380502701, 0.4350597560405731, -0.10443027317523956, 0.14166022837162018, 0.09195273369550705, -0.07049985975027084, -0.0760694071650505, 0.20588095486164093, 0.37435388565063477, 0.1976153701543808, -0.470578134059906, -0.18048927187919617, -0.09796728193759918, 0.1303870677947998, 0.050637129694223404, 0.021243207156658173, -0.027857761830091476, 0.07585172355175018, -0.026410570368170738, -0.590324878692627, 0.18088415265083313, 0.5956895351409912, 0.2761915624141693, 0.09541066735982895, -0.00011836771591333672, -0.04116315022110939, -0.06417478621006012, 0.11493128538131714, -0.1293812245130539, -0.07396300137042999, -0.2474917471408844, 0.1991359442472458, -0.1275225281715393, -0.21929338574409485, -0.0008607767522335052, -0.17130976915359497, 0.015337239019572735, -0.3811034560203552, -0.514273464679718, -0.11681389808654785, 0.08256816118955612, 0.036545075476169586, -0.10681536048650742, 0.07284017652273178, 0.6560941934585571, 0.22512087225914001, -0.2177397906780243, 0.062421444803476334, 0.20949245989322662, -0.16917234659194946, -0.09255669265985489, 0.18434371054172516, 0.17351742088794708, -0.0168764665722847, 0.5613363981246948, 0.03607447072863579, -0.4425998330116272, 0.10608404874801636, -0.09955122321844101, 0.33275306224823, 0.27064597606658936, -0.29764991998672485, -0.5672346949577332, -0.18987682461738586, 0.19282583892345428, -0.23828156292438507, 0.008045002818107605, -0.06557371467351913, 0.0030546896159648895, 0.2964385449886322, 0.08417654782533646, 0.001407837262377143, -0.14466607570648193, 0.21120773255825043, 0.020647935569286346, 0.07709495723247528, 0.155091792345047, 0.08925922960042953, 0.06297853589057922, -0.3432222604751587, 0.31831756234169006, -0.06447568535804749, -0.08102200925350189, 0.2218010127544403, -0.2454356700181961, -0.36007940769195557, 0.01504150778055191, -0.1409880816936493, 0.2657979726791382, 0.18573841452598572, -0.10280648618936539, 0.24381181597709656, -0.1815708875656128, -0.12445511668920517, -0.05691847577691078, 0.07227180898189545, -0.09851115196943283, 0.31722912192344666, 0.14935708045959473, -0.06832649558782578, -0.3096308410167694, -0.06265541911125183, -0.20565545558929443, 0.2989601492881775, 0.029888387769460678, -0.1268855333328247, -0.45998144149780273, 0.08157022297382355, -0.26046672463417053, 0.04524748772382736, -0.3229997456073761, -0.21206620335578918, -0.008275392465293407, 0.24073976278305054, 0.2353428453207016, -0.28625673055648804, -0.06297066062688828, 0.006514806300401688, -0.18675623834133148, -0.11145545542240143, 0.07020744681358337, 0.10270896553993225, 0.03863314166665077, 0.22534418106079102, 0.1991884857416153, -0.17930996417999268, -0.16111677885055542, -0.012564101256430149, -0.19115938246250153, 0.18406355381011963, 0.24565428495407104, -0.16051365435123444, 0.04542176052927971, -0.029184114187955856, -0.34679102897644043, -0.294566810131073, 0.041106484830379486, -0.02005460485816002, -0.2544873058795929, 0.07523404061794281, -0.13661983609199524, -0.3819885849952698, 0.029359128326177597, 0.015516025945544243, 0.1061888337135315, -0.23236054182052612, 0.23227733373641968, 0.4940119981765747, -0.19344913959503174, -0.10912743210792542, 0.11329488456249237, 0.00007012858986854553, -0.2902382016181946, 0.03250179439783096, -0.09355568140745163, 0.26276299357414246, -0.18643306195735931, -0.1713416576385498, 0.054725855588912964, 0.12276604771614075, -0.15885117650032043, -0.02223968878388405, -0.25493165850639343, 0.31634625792503357, -0.37880846858024597, 0.31136971712112427, 0.11920316517353058, -0.17906256020069122, -0.37862610816955566, 0.2739053964614868, -0.00019199401140213013, 0.18680956959724426, 0.2890032231807709, 0.42325344681739807, 0.2957809865474701, -0.028594136238098145, 0.5159186720848083, 0.07497753202915192, 0.013830143958330154, -0.3074479103088379, 0.02063237503170967, -0.6022546887397766, -0.18034237623214722, 0.2562157213687897, 0.22049938142299652, 0.33517661690711975, 0.5463445782661438, -0.237582266330719, 0.09080992639064789, -0.12175160646438599, -0.17216257750988007, -0.2406304031610489, 0.09368368983268738, 0.3662608861923218, 0.06797036528587341, -0.4467219412326813, -0.08778322488069534, 0.2501438856124878, 0.13918128609657288, -0.06311676651239395, 0.009301871061325073, -0.43099409341812134, 0.017797015607357025, 0.2088152915239334, -0.08086651563644409, 0.1994861364364624, -0.012008454650640488, -0.0904773473739624, -0.16770216822624207, -0.19223996996879578, -0.4083230495452881, 0.16227009892463684, -0.19602154195308685, -0.0013352599926292896, -0.11008667945861816, 0.12823453545570374, 0.19590988755226135, 0.27718281745910645, -0.20038239657878876, 0.2724718749523163, 0.008586559444665909, 0.029114656150341034, 0.08944760262966156, 0.1242828369140625, 0.1441645622253418, -0.25275731086730957, 0.65156489610672, 0.5232976078987122, 0.19980809092521667, -0.025564808398485184, 0.2158876210451126, -0.06453917920589447, 0.09191931039094925, 0.03003566712141037, -0.02704751491546631, 0.7112703323364258, -0.3433447480201721, 0.21512192487716675, -0.002131868153810501, -0.3044510781764984, 0.2593119144439697, -0.021418150514364243, 0.04531474411487579, -0.21068993210792542, 0.08168679475784302, 0.07945265620946884, 0.03254639729857445, -0.08318895846605301, -0.6953184604644775, 0.25142955780029297, -0.1792711317539215, -0.04903938248753548, 0.04641006886959076, 0.1739823818206787, 0.025164097547531128, 0.15455299615859985, 0.016065526753664017, 0.1833600401878357, 0.2493038922548294, 0.24493110179901123, -0.10903690755367279, -0.03647824376821518, 0.10016075521707535, 0.0553998202085495, 0.1660291850566864, -0.22180162370204926, -0.33059877157211304, 0.3512232303619385, 0.12980450689792633, 0.10444020479917526, 0.057920463383197784, -0.4613553583621979, 0.10652894526720047, 0.09631846845149994, -0.4839666485786438, 0.04039879888296127, -0.18884626030921936, -0.13562095165252686, 0.19667106866836548, -0.28683146834373474, 0.044674403965473175, -0.02268291637301445, 0.14094053208827972, 0.1979261040687561, 0.04157761111855507, -0.029361510649323463, -0.5225544571876526, 0.5515961647033691, -0.09325245022773743, -0.4470447599887848, 0.09474460780620575, 0.005421916022896767, 0.10617560893297195, 0.018472716212272644, 0.06273874640464783, 0.08087599277496338, 0.42801547050476074, 0.09798821806907654, 0.22431066632270813, -0.5098126530647278, -0.15590938925743103, 0.1597769558429718, 0.08853073418140411, 0.3403873145580292, 0.2876276671886444, -0.24770663678646088, -0.21479372680187225, -0.016643192619085312, 0.07357577234506607, 0.21589936316013336, -0.020828844979405403, -0.115032859146595, -0.07356855273246765, 0.28885751962661743, 0.03601408377289772, 0.086557537317276, -0.14576396346092224, -0.06671735644340515, 0.16270701587200165, 0.0580129437148571, 0.2987409234046936, -0.015715546905994415, 0.05672811344265938, 0.06098434701561928, 0.2898373007774353, -0.40505415201187134, -0.28547829389572144, -0.5155573487281799, 0.4049474596977234, -0.2977319061756134, 0.03952213004231453, -0.22955086827278137, -0.3038318157196045, -0.46156853437423706, 0.48571228981018066, -0.2943578064441681, 0.12960968911647797, 0.009099723771214485, 0.6278023719787598, -0.14805522561073303, -0.020423097535967827, 0.10378660261631012, 0.07358473539352417, 0.024555331096053123, -0.08428443968296051, -0.10212302207946777, 0.1307670623064041, -0.10662425309419632, -0.07824913412332535, 0.6849719882011414, 0.17059239745140076, -0.05775301530957222, 1.0087531805038452, -0.19269607961177826, 0.016692565754055977, 0.53368079662323, -0.10640544444322586, 0.1568039357662201, -0.09548652917146683, -0.2598719596862793, -0.288625031709671, 0.0695793554186821, -0.0874536782503128, 0.2828381359577179, -0.044172223657369614, -0.07164886593818665, 0.026556506752967834, -0.2418859452009201, 0.22683590650558472, -0.16192936897277832, 0.080507792532444, -0.07011081278324127, 0.2923154830932617, -0.07050786912441254, 0.19379264116287231, -0.6496572494506836, -0.2067115604877472, 0.1557830274105072, 0.09552004188299179, 0.3692680895328522, -0.13788342475891113, -0.006381671875715256, -0.32695943117141724, -0.1669616997241974, 0.10324757546186447, 0.31013473868370056, 0.3125287890434265, 0.041400086134672165, 0.052945576608181, 0.15998883545398712, -0.03781997412443161, 0.6436517238616943, -0.41947078704833984, 0.03164253011345863, 0.03564221039414406, 0.02659766376018524, 0.23051489889621735, 0.09136366844177246, 0.18761363625526428, -0.16514365375041962, -0.3707819879055023, 0.5571917295455933, -0.20423445105552673, 0.006443789228796959, 0.25655823945999146, -0.3936629295349121, -0.0768069326877594, -0.6506324410438538, 0.0960821658372879, 0.2052423655986786, -0.0932452604174614, -0.07923147827386856, -0.07222092896699905, -0.07786670327186584, 0.2652815282344818, 0.1740102767944336, -0.5333215594291687, 0.34012025594711304, 0.24867366254329681, -0.014625908806920052, -0.10944458097219467, 0.2179703414440155, 0.348896324634552, 0.333402156829834, -0.30579063296318054, 0.39102703332901, 0.42490455508232117, -0.2501916289329529, -0.11898183822631836, -0.3028019964694977, -0.2810378968715668, -0.03050040453672409, 0.30220890045166016, 0.07184319943189621, 0.44741037487983704, -0.18736501038074493, 0.06302779912948608, -0.46058300137519836, -0.2660546600818634, -0.10227794945240021, -0.18393994867801666, -0.1306319534778595, -0.60279381275177, 0.38752591609954834, -0.28910428285598755, -0.2676815390586853, 0.2565048933029175, 0.6854825019836426, -0.263285368680954, 0.36190295219421387, 0.11681871116161346, 0.8351327776908875, -0.037989504635334015, -0.018144454807043076, -0.029122304171323776, -0.3643715977668762, 0.004546809941530228, -0.17039217054843903, 0.039884038269519806, -0.3346824645996094, -0.3909838795661926, -0.23881152272224426, 0.040115807205438614, 0.19226735830307007, 0.19751915335655212, 0.07153306901454926, 0.06092454120516777, -0.013959556818008423, -0.2554062008857727, -0.15473096072673798, 0.30953553318977356, -0.016846591606736183, -0.4050290584564209, 0.14388936758041382, 0.030488304793834686, 0.0662541389465332, -0.023893386125564575, -0.03897511214017868, -0.06729361414909363, -0.028931638225913048, 0.26486659049987793, -0.1523330807685852, -0.3295819163322449, -0.0847024992108345, -0.01662731170654297, -0.04148595407605171, 0.04186631739139557, 0.37135034799575806, -0.4250609576702118, 0.2049623429775238, -0.1823650449514389, -0.11197596788406372, 0.05652127414941788, 0.3061722218990326, 0.20459239184856415, 0.1498199999332428, -0.054170187562704086, 0.2600717842578888, 0.31221985816955566, -0.2954653799533844, -0.03217577934265137, 0.04668506234884262, -0.507559061050415, -0.15944094955921173, -0.09362766146659851, 0.13961470127105713, -0.3189539611339569, -0.04798299819231033, -0.18316444754600525, 0.10162238776683807, -0.03365069255232811, 0.008135623298585415, -0.18547211587429047, 0.25291967391967773, 0.0652308315038681, -0.11024056375026703, -0.06483755260705948, -0.15076123178005219, 0.24829033017158508, -0.22753477096557617, 0.42646363377571106, 0.2785550057888031, -0.15561793744564056, -0.42844969034194946, -0.08425849676132202, 0.28314921259880066, 0.45571112632751465, 0.016376428306102753, -0.18526789546012878, -0.17911455035209656, -0.048719584941864014, 0.19430074095726013, 0.11374610662460327, 0.14830833673477173, 0.01678047701716423, 0.060890521854162216, -0.3572915196418762, 0.002060333266854286, 0.14333784580230713, -0.09859555959701538, 0.2321338951587677, -0.06235022842884064, -0.2508246600627899, -0.44741034507751465, -0.0633750781416893, -0.2020905613899231, 0.1220741719007492, 0.034560032188892365, -0.04141458123922348, -0.2447432279586792, 0.34814703464508057, -0.0738164633512497, 0.085517019033432, 0.051139235496520996, -0.09276293963193893, -0.02351856231689453, -0.06629954278469086, -0.3226069211959839, 0.1688511073589325, -0.0006063263863325119, 0.05978623777627945, -0.1299227774143219, -0.28634607791900635, -0.2547474801540375, -0.1964465081691742, 0.030635330826044083, 0.27676233649253845, -0.1461007297039032, 0.024368610233068466, 0.2644394636154175, -0.20604631304740906, -0.19192980229854584, 0.3951588571071625, 0.5939582586288452, 0.37418365478515625, -0.02474820241332054, 0.016169432550668716, -0.5281627774238586, 0.19098925590515137, -0.07992010563611984, 0.3941230773925781, 0.3424304127693176, -0.10669767111539841, 0.42465004324913025, -0.018892474472522736, 0.2849847078323364, 0.4146876931190491, 0.061715200543403625, 0.11774173378944397, -0.0712290108203888, -0.237318217754364, 0.3168238401412964, 0.03421362489461899, -0.18380610644817352, -0.12436399608850479, 0.07148154079914093, -0.10369335860013962, 0.20998388528823853, 0.5504425764083862, 0.3604094684123993, 0.12669599056243896, -0.36535656452178955, -0.28253668546676636, 0.3159216046333313, 0.08104196935892105, -0.44036808609962463, 0.206015482544899, 0.3221798241138458, -0.11157211661338806, 0.3935263752937317, 0.3127005696296692, 0.1867569088935852, 0.5491564273834229, -0.06849344819784164, 0.016909431666135788, 0.523440957069397, 0.3416852355003357, 0.04660109803080559, -0.30295804142951965, 0.47573816776275635, 0.28566741943359375, 0.21597880125045776, 0.0687229260802269, 0.3537048399448395, -0.09823078662157059, 0.13662295043468475, 0.13938279449939728, 0.04044998437166214, -0.024442557245492935, 0.33127570152282715, -0.2422420084476471, 0.09240865707397461, -0.3132897615432739, -0.0648234486579895, -0.20059873163700104, -0.11047922074794769, -0.12448373436927795, -0.06433364748954773, 0.04663983732461929, 0.4087158441543579, -0.4334845244884491, 0.3650900423526764, 0.09357178211212158, 0.47311878204345703, -0.38404491543769836, -0.24645943939685822, -0.10530263185501099, 0.047287460416555405, 0.7379851937294006, 0.12824364006519318, -0.14677003026008606, -0.027746137231588364, -0.1300736367702484, -0.14938287436962128, -0.44878828525543213, 0.06624185293912888, 0.13037924468517303, -0.13266193866729736, -0.18651235103607178, -0.2108592838048935, 0.3078303635120392, -0.03905320540070534, 0.027352791279554367, -0.16889405250549316, 0.3533700406551361, 0.3329627811908722, -0.4108581244945526, 0.1252719908952713, 0.10695917159318924, -0.08703457564115524, 0.472932368516922, 0.02220233529806137, -0.04704491049051285, 0.23330050706863403, 0.04361385479569435, -0.20542234182357788, 0.2074892818927765, 0.3237459361553192, 0.016151469200849533, -0.27234557271003723, 0.08407974243164062, 0.10196571052074432, -0.14753887057304382, -0.07677239924669266, 0.06944587826728821, -0.2620856761932373, -0.1884523332118988, 0.009798698127269745, -0.3551273047924042, 0.4644676446914673, 0.12262222170829773, 0.07254400849342346, -0.10796989500522614, -0.028492629528045654, -0.34657880663871765, 0.3206334114074707, 0.8217917680740356, -0.038017455488443375, -0.23256100714206696, -0.19920803606510162, 0.22198650240898132, -0.2649683356285095, -0.27357056736946106, -0.05715462192893028, 0.05058825761079788, -0.14666779339313507, 0.14886964857578278, 0.04320383071899414, 0.2470490038394928, -0.07175929099321365, 0.3304738700389862, -0.2563295066356659, 0.23319359123706818, -0.035761669278144836, 0.280184268951416, -0.09768365323543549, -0.06411750614643097, -0.2827300429344177, 0.17814801633358002, -0.1080365777015686, 0.08943315595388412, 0.01697678677737713, -0.25460848212242126, 0.0005711331614293158, 0.06008468568325043, -0.1623336374759674, 0.15120600163936615, -0.37287983298301697, 0.40299364924430847, -0.31716474890708923, -0.07558626681566238, -0.28051963448524475, 0.3098335266113281, 0.22139187157154083, 0.37149083614349365, 0.21889333426952362, 0.002201259136199951, 0.12185541540384293, -0.4477307200431824, -0.12668970227241516, 0.12848235666751862, 0.13468855619430542, 0.25934889912605286, -0.0998392328619957, -0.3744891583919525, -0.10839862376451492, 0.39983755350112915, -0.04947150498628616, 0.3598230481147766, -0.008488375693559647, -0.08994126319885254, 0.17361336946487427, -0.2881103456020355, -0.2205648124217987, -0.006062779575586319, 0.33023717999458313, -0.26215076446533203, -0.0388004370033741 ]
https://github.com/huggingface/datasets/issues/6530
Impossible to save a mapped dataset to disk
I solved it with `train_dataset.with_format(None)` But then faced some more issues (which i later solved too). Huggingface does not seem to care, so I do. Here is an updated training script which saves a pre-processed (mapped) dataset to your local directory if you specify `--save_precomputed_data_dir=DIR_NAME`. Then use `--train_precomputed_data_dir` with the same dir to load it instead of `--dataset_name`. [Proper SDXL trainer code](https://github.com/kopyl/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py) [Notebook for pre-computing a dataset and saving locally](https://colab.research.google.com/drive/17Yo08hePx-NlHs99RecdeiNc8CQg4O7l?usp=sharing) Example: 1st run (nothing is pre-computed yet): ``` accelerate launch train_text_to_image_sdxl.py \ --pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \ --pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix \ --dataset_name=lambdalabs/pokemon-blip-captions \ --save_precomputed_data_dir="test-5" ``` 2nd run (the pre-computed dataset is saved to `test-5` directory): ``` accelerate launch train_text_to_image_sdxl.py \ --pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \ --pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix \ --train_precomputed_data_dir test-5 ``` This way when you're gonna be using your pre-computed dataset you don't need to worry about re-mapping your dataset when you change an argument for your trainer script
### Describe the bug I want to play around with different hyperparameters when training but don't want to re-map my dataset with 3 million samples each time for tens of hours when I [fully fine-tune SDXL](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py). After I do the mapping like this: ``` train_dataset = train_dataset.map(compute_embeddings_fn, batched=True) train_dataset = train_dataset.map( compute_vae_encodings_fn, batched=True, batch_size=16, ) ``` and try to save it like this: `train_dataset.save_to_disk("test")` i get this error ([full traceback](https://pastebin.com/kq3vt739)): ``` TypeError: Object of type function is not JSON serializable The format kwargs must be JSON serializable, but key 'transform' isn't. ``` But what is interesting is that pushing to hub works like that: `train_dataset.push_to_hub("kopyl/mapped-833-icons-sdxl-1024-dataset", token=True)` Here is the link of the pushed dataset: https://huggingface.co/datasets/kopyl/mapped-833-icons-sdxl-1024-dataset ### Steps to reproduce the bug Here is the self-contained notebook: https://colab.research.google.com/drive/1RtCsEMVcwWcMwlWURk_cj_9xUBHz065M?usp=sharing ### Expected behavior It should be easily saved to disk ### Environment info NVIDIA A100, Linux (NC24ads A100 v4 from Azure), CUDA 12.2. [pip freeze](https://pastebin.com/QTNb6iru)
140
Impossible to save a mapped dataset to disk ### Describe the bug I want to play around with different hyperparameters when training but don't want to re-map my dataset with 3 million samples each time for tens of hours when I [fully fine-tune SDXL](https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py). After I do the mapping like this: ``` train_dataset = train_dataset.map(compute_embeddings_fn, batched=True) train_dataset = train_dataset.map( compute_vae_encodings_fn, batched=True, batch_size=16, ) ``` and try to save it like this: `train_dataset.save_to_disk("test")` i get this error ([full traceback](https://pastebin.com/kq3vt739)): ``` TypeError: Object of type function is not JSON serializable The format kwargs must be JSON serializable, but key 'transform' isn't. ``` But what is interesting is that pushing to hub works like that: `train_dataset.push_to_hub("kopyl/mapped-833-icons-sdxl-1024-dataset", token=True)` Here is the link of the pushed dataset: https://huggingface.co/datasets/kopyl/mapped-833-icons-sdxl-1024-dataset ### Steps to reproduce the bug Here is the self-contained notebook: https://colab.research.google.com/drive/1RtCsEMVcwWcMwlWURk_cj_9xUBHz065M?usp=sharing ### Expected behavior It should be easily saved to disk ### Environment info NVIDIA A100, Linux (NC24ads A100 v4 from Azure), CUDA 12.2. [pip freeze](https://pastebin.com/QTNb6iru) I solved it with `train_dataset.with_format(None)` But then faced some more issues (which i later solved too). Huggingface does not seem to care, so I do. Here is an updated training script which saves a pre-processed (mapped) dataset to your local directory if you specify `--save_precomputed_data_dir=DIR_NAME`. Then use `--train_precomputed_data_dir` with the same dir to load it instead of `--dataset_name`. [Proper SDXL trainer code](https://github.com/kopyl/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py) [Notebook for pre-computing a dataset and saving locally](https://colab.research.google.com/drive/17Yo08hePx-NlHs99RecdeiNc8CQg4O7l?usp=sharing) Example: 1st run (nothing is pre-computed yet): ``` accelerate launch train_text_to_image_sdxl.py \ --pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \ --pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix \ --dataset_name=lambdalabs/pokemon-blip-captions \ --save_precomputed_data_dir="test-5" ``` 2nd run (the pre-computed dataset is saved to `test-5` directory): ``` accelerate launch train_text_to_image_sdxl.py \ --pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0 \ --pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix \ --train_precomputed_data_dir test-5 ``` This way when you're gonna be using your pre-computed dataset you don't need to worry about re-mapping your dataset when you change an argument for your trainer script
[ -0.2592863440513611, -0.19739553332328796, 0.07933427393436432, 0.14602425694465637, 0.6141027808189392, 0.16964304447174072, 0.29752081632614136, 0.24852529168128967, 0.13375835120677948, 0.26897186040878296, -0.04194638133049011, 0.4190550148487091, -0.3757169842720032, 0.10039270669221878, 0.11267516016960144, 0.13539060950279236, 0.29498469829559326, -0.05475212633609772, -0.03362729400396347, -0.11771062016487122, -0.36431917548179626, -0.06978538632392883, 0.09431594610214233, -0.3228881359100342, -0.3813156187534332, -0.20905917882919312, 0.08079592883586884, -0.1254419982433319, -0.04505324363708496, 0.04235532134771347, 0.2058831751346588, -0.014326006174087524, 0.13835971057415009, 0.3753872513771057, -0.00012428614718373865, 0.03832124173641205, 0.06405220925807953, -0.25334620475769043, -0.25954076647758484, -0.18022678792476654, 0.07702071219682693, -0.23295770585536957, -0.07904712855815887, -0.45910459756851196, 0.041107818484306335, -0.04366084560751915, 0.002583807334303856, -0.29006099700927734, 0.37904906272888184, 0.08811946213245392, 0.1768675446510315, -0.04345473647117615, 0.001837015151977539, 0.11413095891475677, -0.05446513742208481, 0.6468517184257507, -0.4882706105709076, 0.1914999634027481, 0.09649999439716339, 0.19203297793865204, 0.19850200414657593, 0.2966108024120331, 0.0944160744547844, -0.43314170837402344, 0.21435943245887756, -0.07649675756692886, -0.030452124774456024, -0.15887536108493805, 0.21288350224494934, -0.06861484795808792, 0.03867904469370842, -0.4176766574382782, -0.2831687927246094, -0.1991848349571228, -0.202179953455925, -0.30176928639411926, 0.20073053240776062, 0.1445978432893753, -0.2473689466714859, -0.09306280314922333, -0.43146952986717224, -0.23372171819210052, -0.09676360338926315, -0.008846290409564972, 0.2981822192668915, 0.11371630430221558, -0.12184999883174896, 0.1787920892238617, 0.19907337427139282, -0.14274205267429352, 0.017881635576486588, -0.1904214471578598, 0.1953790932893753, -0.01927322894334793, -0.36496680974960327, -0.10672460496425629, -0.30193987488746643, -0.3985854387283325, 0.1468801498413086, 0.16255611181259155, 0.05480661988258362, -0.13253533840179443, 0.18769019842147827, 0.025864461436867714, 0.1392473727464676, 0.4633042514324188, 0.10912775993347168, 0.31767284870147705, 0.22916564345359802, 0.10812563449144363, -0.20512717962265015, 0.07563261687755585, -0.05753336474299431, 0.15619076788425446, 0.4275088310241699, 0.02314627729356289, 0.28287631273269653, -0.1691560447216034, -0.1660434901714325, 0.19953563809394836, -0.08934971690177917, 0.1568017601966858, -0.04005742073059082, 0.28383639454841614, 0.24322672188282013, 0.06304976344108582, -0.06496565043926239, 0.3318811058998108, 0.02515803463757038, 0.3230922520160675, -0.12381395697593689, 0.010043725371360779, 0.00017081201076507568, 0.12389978021383286, 0.12828092277050018, -0.36220821738243103, 0.20849427580833435, -0.058868348598480225, -0.1704450100660324, -0.2627022862434387, -0.23918603360652924, -0.10854177176952362, 0.3320856988430023, 0.22597871720790863, -0.08082087337970734, 0.4279351830482483, 0.04379158094525337, -0.20249450206756592, -0.24781888723373413, 0.2407783567905426, -0.07630922645330429, -0.07352843135595322, 0.006539691239595413, 0.07214897125959396, -0.06637974828481674, 0.03947370499372482, -0.5444641709327698, 0.08140245079994202, 0.15635700523853302, 0.04166394844651222, 0.17982584238052368, -0.15700027346611023, -0.09578326344490051, -0.3434470593929291, 0.21769873797893524, -0.018756598234176636, -0.3072657585144043, 0.035081297159194946, 0.20722141861915588, 0.11359626054763794, 0.1677037477493286, 0.22468742728233337, -0.023238597437739372, 0.0981968566775322, -0.011809558607637882, 0.23449699580669403, 0.09591277688741684, -0.5612459778785706, -0.6583874225616455, -0.0039559719152748585, -0.09783213585615158, -0.00099211186170578, -0.1725195348262787, 0.21569393575191498, 0.628300666809082, -0.13613192737102509, 0.002390652894973755, 0.1015171930193901, -0.007241485640406609, 0.08299588412046432, -0.33335864543914795, -0.3072811961174011, 0.3548983335494995, -0.01872178725898266, -0.03950465843081474, 0.04973860830068588, 0.12821471691131592, 0.5321049094200134, 0.25736865401268005, 0.0005094744265079498, 0.35270047187805176, 0.33458977937698364, 0.39682093262672424, -0.3786746859550476, -0.09237046539783478, -0.19231626391410828, -0.5376288890838623, 0.08079235255718231, 0.4123639464378357, -0.20546752214431763, -0.16058482229709625, -0.10014066100120544, -0.14985957741737366, 0.08482573926448822, -0.2847244441509247, -0.19649364054203033, 0.04176587611436844, -0.10135042667388916, -0.04085257649421692, 0.16997748613357544, -0.20191729068756104, -0.12035202234983444, -0.1158829778432846, -0.013907612301409245, -0.29765111207962036, 0.08157451450824738, -0.05505204200744629, -0.3979886472225189, -0.06798212975263596, 0.22248509526252747, 0.1283433437347412, -0.3434974253177643, -0.20337048172950745, 0.13062059879302979, 0.16807080805301666, 0.11733045428991318, -0.20909270644187927, 0.2039552927017212, 0.15192443132400513, -0.10467495024204254, -0.20019182562828064, 0.3690769672393799, 0.18333978950977325, -0.12495771050453186, -0.4850170314311981, 0.19066661596298218, 0.1901322454214096, 0.22539332509040833, -0.16271892189979553, 0.17616897821426392, 0.18851961195468903, -0.05389731749892235, -0.09604080766439438, -0.08355344086885452, 0.031561147421598434, 0.08595132827758789, 0.3906654119491577, -0.25371986627578735, -0.1300499588251114, 0.2197696417570114, 0.45170873403549194, 0.1061512678861618, 0.3593880236148834, 0.08924803882837296, -0.2343517243862152, -0.017061598598957062, 0.15819475054740906, 0.20698420703411102, 0.15096227824687958, -0.17578892409801483, -0.13707734644412994, 0.07901006191968918, -0.2352505624294281, -0.0637010782957077, 0.02590390294790268, -0.018629036843776703, 0.41796475648880005, 0.194349467754364, 0.23032605648040771, 0.049744341522455215, -0.34798285365104675, 0.20195233821868896, 0.051926568150520325, 0.15317761898040771, -0.05033151060342789, -0.027354786172509193, -0.24572928249835968, 0.322346031665802, -0.10882951319217682, -0.13590174913406372, -0.27218949794769287, -0.3237089514732361, -0.14643028378486633, 0.5523239374160767, -0.1370118409395218, 0.2663126587867737, -0.043116770684719086, 0.2800068259239197, -0.005635695531964302, -0.2342572957277298, -0.26535359025001526, -0.1340961456298828, -0.1763727068901062, -0.06073862314224243, 0.22914858162403107, -0.2004477083683014, 0.4786139726638794, 0.20078618824481964, 0.19174107909202576, -0.5003024935722351, -0.029677294194698334, -0.02280750870704651, -0.25083667039871216, 0.3059161901473999, -0.13265374302864075, 0.29844027757644653, -0.14192599058151245, -0.21030138432979584, 0.3575535714626312, -0.22461962699890137, -0.3700406551361084, 0.01118597574532032, 0.047859277576208115, -0.16092093288898468, -0.13606438040733337, -0.12584400177001953, -0.20614838600158691, -0.22927604615688324, 0.3073384165763855, -0.2807948887348175, 0.05992633476853371, 0.047624148428440094, 0.10635020583868027, 0.06960424035787582, 0.057316605001688004, -0.469674676656723, -0.20870989561080933, -0.2629567086696625, 0.4255303144454956, -0.12344813346862793, -0.5533238649368286, 0.1415795087814331, 0.13685323297977448, 0.011502373963594437, 0.11928372830152512, -0.4929239749908447, -0.15428638458251953, -0.032740071415901184, 0.12217840552330017, 0.04706748574972153, -0.16082996129989624, 0.45931652188301086, -0.03851279988884926, 0.17582279443740845, -0.14741910994052887, -0.5130261778831482, 0.33872079849243164, 0.3885233700275421, 0.4315485954284668, -0.1448765993118286, 0.4239646792411804, 0.09246265888214111, 0.4053303599357605, 0.3161506652832031, -0.1694655865430832, 0.27693086862564087, 0.03250313177704811, 0.1128777489066124, -0.3023946285247803, -0.43282023072242737, 0.3779628276824951, -0.271141916513443, -0.21195216476917267, -0.09926895797252655, -0.017960060387849808, 0.026893112808465958, 0.11121043562889099, -0.02873520366847515, -0.0600777268409729, -0.378275066614151, 0.05735476315021515, -0.139105424284935, 0.016360711306333542, 0.09858986735343933, 0.26747584342956543, -0.021114494651556015, -0.05061269551515579, 0.30674034357070923, 0.1398731768131256, 0.19218109548091888, 0.03328465297818184, -0.5182561874389648, -0.3872672915458679, -0.7132973670959473, 0.13585297763347626, 0.07693786174058914, 0.5294749140739441, -0.17123734951019287, 0.1251474916934967, 0.09644594043493271, 0.0027253590524196625, 0.7561725378036499, -0.2974601089954376, 0.1117044985294342, 0.2121652513742447, -0.1777995377779007, -0.5474602580070496, 0.0006280876696109772, 0.0592203326523304, -0.08587650954723358, -0.23792631924152374, 0.9509987831115723, -0.2646973431110382, -0.05901172384619713, -0.1430758386850357, 0.14723698794841766, -0.4412342607975006, -0.10351941734552383, -0.031056826934218407, -0.5605180263519287, -0.3467821776866913, 0.024924784898757935, 0.16071194410324097, 0.23720650374889374, 0.09064363688230515, -0.06926381587982178, -0.2501915395259857, -0.060823697596788406, -0.05663105845451355, -0.17753975093364716, 0.33892160654067993, 0.17570719122886658, 0.2552874684333801, 0.19835318624973297, 0.5048590898513794, 0.07110005617141724, 0.2885131239891052, 0.019544070586562157, -0.08385500311851501, 0.32149457931518555, -0.18712104856967926, 0.06164674088358879, 0.27072417736053467, -0.04190388321876526, 0.08065169304609299, -0.04392271488904953, 0.019203700125217438, -0.5492880344390869, 0.07883010804653168, 0.23404578864574432, 0.045502327382564545, -0.4052971601486206, -0.08727862685918808, 0.4519319534301758, -0.013450492173433304, 0.07321210205554962, 0.129083514213562, -0.1495901644229889, -0.24073168635368347, 0.35720956325531006, 0.4549520015716553, 1.0092066526412964, -0.17565247416496277, 0.30990296602249146, 0.23221388459205627, -0.14790429174900055, 0.21555344760417938, 0.06985010206699371, 0.16427840292453766, -0.38754144310951233, -0.10226976871490479, -0.03942939639091492, 0.04517043009400368, -0.14881977438926697, -0.07825811207294464, -0.19563227891921997, 0.0866585224866867, -0.3101860284805298, 0.29180991649627686, -0.22256189584732056, -0.03938715532422066, 0.0060288747772574425, -0.2980388402938843, -0.13974358141422272, 0.13035491108894348, -0.08162441849708557, 0.22245551645755768, 0.04632248356938362, -0.18757694959640503, -0.32242676615715027, -0.2775849401950836, -0.22682254016399384, 0.13124892115592957, -0.33779439330101013, 0.3769901990890503, -0.15987592935562134, -0.2667328417301178, -0.2121776044368744, 0.2720698416233063, 0.3341691493988037, -0.015389334410429, -0.2995055615901947, -0.1839062124490738, -0.23021084070205688, 0.13962428271770477, -0.04941543936729431, -0.25027382373809814, 0.2522323727607727, -0.1405595988035202, 0.2074640989303589, -0.09462551027536392, -0.04328230768442154, -0.2583896517753601, -0.2704925835132599, -0.04537453502416611, -0.1689462512731552, -0.2256585657596588, -0.22387132048606873, -0.04900488257408142, -0.031069207936525345, -0.37632980942726135, 0.02741221711039543, -0.039487823843955994, 0.14653897285461426, 0.5637865662574768, 0.019647715613245964, -0.008624926209449768, 0.15033774077892303, 0.3984314203262329, 0.09921395033597946, -0.03587771952152252, 0.5596493482589722, -0.20689910650253296, -0.12078942358493805, -0.2062014937400818, 0.44996553659439087, 0.25632432103157043, -0.4260904788970947, 0.381341814994812, -0.5714001059532166, -0.13354703783988953, -0.17674954235553741, 0.3476024270057678, 0.3289395570755005, -0.36274296045303345, -0.1628756821155548, -0.14604386687278748, -0.4152170419692993, 0.17866283655166626, 0.07345304638147354, 0.14903458952903748, -0.21179571747779846, 0.1701413094997406, -0.09763611853122711, 0.18313993513584137, -0.21599102020263672, 0.049955978989601135, -0.3055233061313629, 0.17613662779331207, -0.2815568745136261, 0.010217219591140747, 0.2831866443157196, -0.20489077270030975, -0.03219705820083618, 0.2722383141517639, -0.17371398210525513, -0.09274907410144806, -0.4300958216190338, 0.11979322135448456, 0.20098698139190674, 0.2183629423379898, -0.11648046970367432, -0.17274542152881622, -0.13027913868427277, -0.13054011762142181, -0.13897526264190674, 0.318247526884079, -0.011450804769992828, -0.25648948550224304, 0.28420862555503845, 0.3031868040561676, 0.14384174346923828, 0.08364890515804291, 0.09338673204183578, 0.26923733949661255, 0.04796751216053963, 0.010241292417049408, 0.2838757634162903, -0.027417272329330444, -0.4729643762111664, -0.09848511964082718, 0.1675412356853485, 0.16313990950584412, 0.21751156449317932, -0.22024287283420563, -0.00032640621066093445, 0.09250134974718094, 0.33737799525260925, 0.12941069900989532, -0.45417287945747375, -0.0110330143943429, 0.24479028582572937, 0.08632105588912964, 0.06916385143995285, -0.10265505313873291, 0.32704293727874756, -0.06774712353944778, -0.12961481511592865, 0.21477973461151123, 0.1507640928030014, 0.08352126181125641, -0.26669371128082275, -0.11121916770935059, 0.42278340458869934, -0.22283777594566345, 0.07618185877799988, 0.3103431761264801, 0.00032864511013031006, 0.28351643681526184, 0.3608396351337433, 0.20950531959533691, 0.21585944294929504, 0.2833947241306305, 0.10424861311912537, 0.46143609285354614, 0.5349857807159424, 0.10077778995037079, 0.16453151404857635, -0.03511760011315346, -0.01754220947623253, -0.06801843643188477, -0.3256973922252655, 0.3683684766292572, -0.07485799491405487, 0.13369955122470856, -0.4383905827999115, -0.2484717220067978, -0.1303633749485016, 0.3690311312675476, -0.3143349587917328, 0.011398671194911003, -0.10806369036436081, -0.10100030899047852, 0.024012334644794464, 0.09740668535232544, -0.1647193878889084, -0.269015371799469, 0.40457385778427124, -0.054270192980766296, -0.06085078418254852, 0.2046782225370407, -0.18637996912002563, 0.23183414340019226, 0.2796388268470764, -0.19829562306404114, 0.21466197073459625, -0.0950341671705246, -0.05219201743602753, -0.3018951416015625, 0.49427446722984314, 0.2064385563135147, 0.5217580795288086, -0.12870976328849792, 0.2209508866071701, 0.3445800244808197, 0.0743367075920105, 0.09917860478162766, 0.2849874198436737, 0.034554727375507355, -0.06850428879261017, 0.5279606580734253, 0.07590192556381226, -0.01284708920866251, 0.07551971822977066, 0.11837711185216904, 0.23749643564224243, 0.33481457829475403, 0.2930382788181305, -0.24915727972984314, -0.15602970123291016, 0.06744589656591415, 0.01082620769739151, -0.14197823405265808, -0.0661645159125328, 0.2733575105667114, -0.24286925792694092, 0.3853686451911926, -0.16769248247146606, 0.06854461133480072, -0.16677814722061157, 0.5524358153343201, 0.2866528630256653, -0.47959157824516296, -0.2345069944858551, -0.11297928541898727, -0.39030733704566956, 0.16395457088947296, 0.0037222392857074738, 0.03881268948316574, -0.07669336348772049, 0.19058692455291748, 0.08486218005418777, 0.043063823133707047, -0.02687421441078186, -0.12619414925575256, 0.02879447117447853, 0.47207996249198914, -0.2770957946777344, -0.03633257374167442, 0.265585333108902, 0.23930807411670685, 0.1493242383003235, -0.40271368622779846, 0.5896511673927307, 0.33211782574653625, -0.006841868162155151, -0.051703646779060364, 0.4405500292778015, -0.25693079829216003, -0.10663193464279175, 0.3719325065612793, 0.1343749463558197, 0.11017152667045593, -0.040724173188209534, -0.27008718252182007, 0.02087436243891716, 0.17627951502799988, -0.024556711316108704, -0.2615489065647125, 0.11489291489124298, 0.4856613576412201, -0.08892114460468292, -0.020201217383146286, -0.2890804409980774, -0.025008495897054672, -0.0506109893321991, 0.11083586513996124, -0.2299836277961731, 0.24387779831886292, -0.056737035512924194, -0.018167193979024887, 0.35773083567619324, 0.2769319713115692, -0.19790983200073242, 0.2538662254810333, -0.2974058985710144, -0.29695403575897217, 0.499991774559021, -0.05749620869755745, -0.4401860535144806, 0.20442868769168854, 0.15688684582710266, 0.11899593472480774, 0.044173628091812134, -0.43581080436706543, -0.12303238362073898, 0.13930296897888184, -0.20102322101593018, -0.15307043492794037, 0.3090202808380127, -0.22862496972084045, -0.1328023374080658, 0.092323899269104, 0.3257093131542206, 0.08456295728683472, 0.007316736504435539, 0.277072548866272, -0.2687278389930725 ]
https://github.com/huggingface/datasets/issues/6529
Impossible to only download a test split
This feature has been proposed for a long time. I'm looking forward to the implementation. On clusters `streaming=True` is not an option since we do not have Internet on compute nodes. See: https://github.com/huggingface/datasets/discussions/1896#discussioncomment-2359593
I've spent a significant amount of time trying to locate the split object inside my _split_generators() custom function. Then after diving [in the code](https://github.com/huggingface/datasets/blob/5ff3670c18ed34fa8ddfa70a9aa403ae6cc9ad54/src/datasets/load.py#L2558) I realized that `download_and_prepare` is executed before! split is passed to the dataset builder in `as_dataset`. If I'm not missing something, this seems like bad design, for the following use case: > Imagine there is a huge dataset that has an evaluation test set and you want to just download and run just to compare your method. Is there a current workaround that can help me achieve the same result? Thank you,
33
Impossible to only download a test split I've spent a significant amount of time trying to locate the split object inside my _split_generators() custom function. Then after diving [in the code](https://github.com/huggingface/datasets/blob/5ff3670c18ed34fa8ddfa70a9aa403ae6cc9ad54/src/datasets/load.py#L2558) I realized that `download_and_prepare` is executed before! split is passed to the dataset builder in `as_dataset`. If I'm not missing something, this seems like bad design, for the following use case: > Imagine there is a huge dataset that has an evaluation test set and you want to just download and run just to compare your method. Is there a current workaround that can help me achieve the same result? Thank you, This feature has been proposed for a long time. I'm looking forward to the implementation. On clusters `streaming=True` is not an option since we do not have Internet on compute nodes. See: https://github.com/huggingface/datasets/discussions/1896#discussioncomment-2359593
[ -0.6835600137710571, -0.0565028116106987, -0.032896701246500015, 0.08022906631231308, -0.04810930788516998, -0.0803137943148613, 0.2135942578315735, 0.40247973799705505, 0.051800090819597244, 0.3356485366821289, -0.352792888879776, 0.023413686081767082, 0.0721280500292778, 0.5051763653755188, 0.16886718571186066, -0.07111167907714844, -0.1814020872116089, 0.5307368040084839, 0.004626944661140442, 0.17680612206459045, -0.14612606167793274, 0.015793751925230026, -0.1388549506664276, -0.16328823566436768, 0.06207677349448204, -0.144662544131279, 0.025000909343361855, 0.014548815786838531, -0.31473010778427124, -0.23258814215660095, 0.23281033337116241, 0.3917000889778137, -0.32182109355926514, 0.10229606926441193, -0.00012662206427194178, 0.09168736636638641, 0.3236205577850342, -0.05257454514503479, -0.5068740248680115, -0.14391477406024933, -0.2428402304649353, 0.21245765686035156, 0.08862660825252533, -0.08425530046224594, 0.01421356201171875, 0.16697710752487183, 0.07558169215917587, -0.2540132999420166, 0.434162437915802, 0.18890723586082458, 0.06768849492073059, 0.25160282850265503, -0.10561254620552063, -0.16833233833312988, 0.0917542427778244, 0.27842217683792114, -0.1600751280784607, -0.22539083659648895, 0.07162417471408844, 0.19849886000156403, -0.12514185905456543, -0.05156811699271202, 0.05036109685897827, 0.2973710000514984, 0.16478264331817627, 0.10861724615097046, -0.2195809781551361, -0.4536797106266022, -0.1557013988494873, 0.2766224443912506, 0.34141722321510315, -0.10047944635152817, -0.34002554416656494, -0.37591519951820374, -0.1390732228755951, -0.3258737027645111, 0.11658532172441483, 0.3228781223297119, -0.4405825734138489, 0.37270769476890564, -0.46051695942878723, -0.2981140613555908, -0.06966017931699753, 0.12651781737804413, 0.028557300567626953, 0.06772051006555557, -0.11778125911951065, 0.1729506552219391, 0.29396548867225647, 0.5356006622314453, 0.12436159700155258, -0.0938834622502327, -0.09330156445503235, 0.16552193462848663, -0.14702458679676056, -0.03255952149629593, 0.00036081671714782715, -0.10778629034757614, 0.35725879669189453, 0.5140974521636963, -0.05886761099100113, 0.042140018194913864, 0.09455215185880661, 0.03009413368999958, 0.28199684619903564, 0.07621115446090698, 0.2504269778728485, 0.12528719007968903, 0.08655794709920883, 0.46256405115127563, -0.11741499602794647, -0.10855703800916672, 0.4296312630176544, -0.09668251127004623, -0.346334308385849, 0.026675252243876457, 0.1486901342868805, -0.04472695663571358, -0.21386849880218506, -0.4724303185939789, -0.02249760553240776, -0.1467067152261734, 0.1244167685508728, 0.1871262490749359, 0.03409138321876526, 0.04090574383735657, -0.0757211446762085, 0.2988387942314148, -0.27702048420906067, -0.5942829251289368, -0.15187020599842072, 0.041378453373909, -0.08332619816064835, 0.3052685260772705, 0.26610738039016724, -0.3248444199562073, 0.1955108642578125, 0.1389186531305313, 0.27268487215042114, -0.2608996033668518, 0.013889329507946968, -0.02736767567694187, 0.14622847735881805, 0.5143566131591797, 0.39290013909339905, 0.11821737140417099, -0.1814441680908203, -0.10000362247228622, -0.2004832625389099, -0.08517033606767654, 0.023866433650255203, -0.47101637721061707, 0.383207231760025, 0.030301831662654877, -0.3133563995361328, 0.37086769938468933, -0.01908653974533081, 0.1517646759748459, -0.08596863597631454, -0.22526563704013824, -0.12427540868520737, 0.23649577796459198, -0.6469402313232422, -0.06318340450525284, 0.37048599123954773, 0.5566920638084412, -0.2755143344402313, -0.047750454396009445, -0.5406438112258911, -0.29293304681777954, 0.17840518057346344, -0.07112307846546173, -0.10680623352527618, 0.5516366958618164, -0.3642154932022095, 0.2052905410528183, 0.7288016676902771, 0.09732195734977722, -0.5622313618659973, 0.4912705719470978, -0.3527756333351135, 0.09670397639274597, 0.06560437381267548, 0.08883704245090485, 0.4752017557621002, -0.04014157876372337, -0.24958175420761108, 0.4714275002479553, -0.17842364311218262, -0.025887396186590195, -0.03971192240715027, -0.47807273268699646, -0.07863020151853561, -0.03330391272902489, 0.2411922812461853, 0.39424821734428406, 0.18237923085689545, 0.10707452893257141, 0.3374408185482025, 0.05866019427776337, 0.22833901643753052, -0.1497475951910019, 0.03028811514377594, 0.032781489193439484, -0.30455678701400757, -0.29051560163497925, -0.5538539290428162, 0.34798961877822876, -0.0858403742313385, -0.26294124126434326, 0.026899076998233795, -0.3102976679801941, -0.31027474999427795, -0.11726579815149307, -0.10671217739582062, -0.19070188701152802, -0.10010260343551636, -0.009545363485813141, 0.36409059166908264, 0.0026380755007267, -0.1914345920085907, 0.24542060494422913, 0.03723100572824478, 0.20986907184123993, -0.05083991959691048, -0.06482070684432983, 0.20214904844760895, -0.008644104935228825, 0.07129642367362976, -0.2812293469905853, 0.09390996396541595, -0.13950391113758087, -0.028853237628936768, 0.6204347610473633, 0.18832464516162872, 0.2675316035747528, -0.18285289406776428, -0.3185967206954956, 0.051966115832328796, 0.05518849566578865, -0.1626766324043274, 0.009011509828269482, 0.024085458368062973, -0.16204451024532318, -0.3339022099971771, 0.35971206426620483, -0.16045953333377838, 0.29056093096733093, 0.09724126756191254, 0.11801891773939133, 0.026310769841074944, -0.15514060854911804, -0.014785680919885635, -0.18715018033981323, 0.05142102763056755, -0.28108447790145874, 0.36962172389030457, -0.07558467239141464, -0.09959623217582703, 0.17479541897773743, 0.4868954122066498, 0.001409655436873436, -0.0037372782826423645, 0.027067475020885468, 0.14097753167152405, -0.04630430415272713, 0.02038782835006714, 0.24929730594158173, 0.6582434177398682, 0.02172333374619484, 0.4224563539028168, 0.26778221130371094, 0.14242097735404968, -0.21231181919574738, 0.21659761667251587, 0.11772014200687408, 0.04994354024529457, 0.20483428239822388, -0.05908060818910599, -0.39654654264450073, -0.3018950819969177, 0.32279157638549805, 0.11314194649457932, -0.015348242595791817, -0.3103877604007721, -0.002855975180864334, -0.3046889901161194, 0.1456488072872162, -0.12757684290409088, 0.1720215380191803, 0.038126565515995026, -0.3293985426425934, 0.1212461069226265, 0.25474318861961365, -0.10956653952598572, -0.09736210852861404, -0.0650206059217453, 0.4402613639831543, -0.21399886906147003, -0.18788041174411774, -0.09748589992523193, 0.16606558859348297, 0.03989409655332565, -0.058481454849243164, 0.12899808585643768, 0.31423237919807434, 0.40451836585998535, -0.08308801054954529, -0.26855671405792236, -0.08601795881986618, 0.019992925226688385, 0.16245809197425842, 0.09356092661619186, 0.2540181577205658, 0.35346806049346924, 0.13808393478393555, 0.3842114210128784, -0.20630811154842377, 0.027377208694815636, -0.38322705030441284, -0.22604556381702423, -0.18125329911708832, 0.28072240948677063, 0.3951837718486786, -0.3820928633213043, -0.5105982422828674, -0.021382132545113564, -0.29831433296203613, 0.4873535633087158, -0.08897396922111511, 0.03267873451113701, -0.5672605633735657, -0.036214616149663925, -0.19872476160526276, -0.05415778607130051, -0.08883140236139297, -0.2353454977273941, -0.2644515037536621, 0.11237651854753494, -0.25034835934638977, -0.11197540163993835, 0.02808748558163643, 0.007932886481285095, 0.1729043871164322, 0.3469567894935608, -0.2990511655807495, 0.19869112968444824, -0.16621890664100647, 0.03567511960864067, -0.09383790194988251, -0.025198357179760933, 0.2424272745847702, -0.20236897468566895, 0.11848026514053345, -0.07680390775203705, 0.17116162180900574, 0.23966571688652039, -0.29591846466064453, -0.018478497862815857, 0.09381238371133804, 0.39979368448257446, 0.23256197571754456, 0.9830504059791565, 0.21140287816524506, 0.23138286173343658, -0.15450143814086914, -0.234421044588089, 0.11287244409322739, -0.33006370067596436, -0.1969476342201233, 0.02366269752383232, -0.18530184030532837, -0.2599296569824219, 0.2187393605709076, -0.1030321717262268, -0.10504495352506638, -0.28921419382095337, 0.2573753893375397, -0.2726137638092041, -0.4609556496143341, 0.0018028095364570618, 0.13336658477783203, 0.17417111992835999, 0.1229604035615921, 0.36053070425987244, 0.18534208834171295, 0.044975437223911285, 0.05444178357720375, 0.059370994567871094, 0.37040257453918457, -0.011970513500273228, -0.1273678094148636, 0.20937374234199524, -0.3166733682155609, 0.1325705200433731, 0.14024624228477478, -0.027991250157356262, -0.09701760858297348, -0.036117736250162125, 0.28579115867614746, 0.09208357334136963, 0.7179566025733948, -0.1716337352991104, 0.25500383973121643, 0.06614893674850464, -0.314240962266922, 0.05908314138650894, -0.012177113443613052, 0.0019384883344173431, 0.15556935966014862, 0.10496024787425995, -0.014150306582450867, -0.4201437830924988, -0.15305136144161224, 0.292318731546402, 0.20287075638771057, -0.16972941160202026, -0.18742336332798004, -0.16591908037662506, -0.22611144185066223, -0.23236560821533203, 0.20816928148269653, 0.08840254694223404, 0.11701743304729462, -0.24256794154644012, -0.015439284965395927, -0.20787076652050018, -0.015265178866684437, -0.006533496081829071, -0.04057629406452179, 0.028262430801987648, -0.0989857092499733, 0.2902207672595978, 0.48300832509994507, -0.2814990282058716, -0.35320422053337097, 0.5289473533630371, -0.03954729810357094, -0.1861402690410614, -0.01737358421087265, -0.21029192209243774, 0.19001969695091248, 0.6230216026306152, -0.16467629373073578, 0.08313994109630585, -0.04579908400774002, 0.036516785621643066, -0.4575747549533844, 0.2527124881744385, 0.05434483289718628, -0.4055560529232025, -0.02958446368575096, -0.4809127151966095, 0.47382017970085144, 0.0985579788684845, -0.1613745093345642, 0.4295581877231598, 0.10845047980546951, -0.10069193691015244, -0.10753434151411057, -0.026617862284183502, 0.8483591675758362, -0.04902251064777374, -0.08128230273723602, 0.18386736512184143, -0.21066002547740936, 0.3565559983253479, -0.5507088899612427, 0.3005324602127075, -0.3149949908256531, -0.4150576889514923, -0.12811025977134705, -0.2378379851579666, 0.07524261623620987, 0.24425610899925232, -0.08087380975484848, 0.2892920970916748, -0.17020507156848907, 0.3065943717956543, 0.08387061208486557, 0.27983325719833374, -0.30568650364875793, -0.20156601071357727, 0.14650873839855194, 0.004408106207847595, 0.0140230692923069, 0.4732477068901062, 0.004478165879845619, -0.0646047443151474, 0.22627246379852295, -0.11212083697319031, -0.234635129570961, 0.19849026203155518, -0.2200685441493988, 0.04404844716191292, -0.4160766303539276, -0.050433121621608734, 0.34952789545059204, 0.14434897899627686, -0.033596962690353394, 0.21663308143615723, 0.011963163502514362, 0.2523752450942993, -0.22947636246681213, 0.21091488003730774, 0.04658638313412666, -0.02288690209388733, -0.05764947831630707, 0.05735211819410324, -0.06237063556909561, -0.00730837881565094, -0.15035922825336456, -0.22525654733181, 0.017838478088378906, 0.02141987532377243, 0.13027727603912354, -0.45787563920021057, -0.02629254385828972, 0.061708301305770874, 0.3089609742164612, -0.2343164086341858, -0.07812906801700592, -0.13745014369487762, -0.3496246933937073, 0.08384085446596146, -0.2114718109369278, -0.35055625438690186, -0.03574076667428017, 0.4095252454280853, -0.08063404262065887, 0.15202975273132324, 0.12384303659200668, -0.015026595443487167, -0.1822885125875473, -0.2613508403301239, -0.05132302641868591, -0.23438948392868042, -0.5241361856460571, 0.3586370646953583, -0.4574430584907532, 0.1196027547121048, -0.21652618050575256, 0.28586581349372864, -0.13106279075145721, -0.016301967203617096, -0.23794344067573547, -0.2443043738603592, 0.05613981932401657, -0.09233325719833374, 0.011934105306863785, 0.32840391993522644, 0.18706855177879333, 0.17416460812091827, 0.006839016452431679, 0.45798981189727783, -0.1397182196378708, -0.02194804698228836, 0.16103704273700714, 0.04976765811443329, -0.026661116629838943, 0.1680019348859787, 0.2791205942630768, -0.10069364309310913, -0.11240364611148834, 0.17159222066402435, -0.24503061175346375, -0.0008914954960346222, -0.14298202097415924, 0.23442962765693665, -0.2221497893333435, 0.2541021704673767, 0.14753957092761993, -0.03891905024647713, -0.19006307423114777, -0.13737402856349945, 0.38599225878715515, -0.13859319686889648, 0.07885777205228806, -0.09015655517578125, 0.3484663963317871, 0.1436200737953186, -0.6281142830848694, 0.3078863024711609, -0.10547040402889252, 0.3066014051437378, -0.21247197687625885, 0.26641958951950073, -0.022019468247890472, -0.06155359745025635, 0.1489819437265396, -0.06392670422792435, 0.3839382529258728, 0.1923660933971405, 0.3155524730682373, 0.11324001103639603, 0.07986322045326233, -0.32235080003738403, 0.502434253692627, 0.5932378768920898, 0.15203961730003357, 0.1366955041885376, -0.09338770061731339, -0.005689248442649841, -0.012351704761385918, -0.12450623512268066, 0.22476708889007568, 0.08231651782989502, 0.11284856498241425, 0.40639743208885193, 0.04874327406287193, 0.16145320236682892, 0.009354695677757263, 0.1071297898888588, 0.29470205307006836, 0.027245881035923958, 0.20416128635406494, 0.7687293887138367, -0.1039816364645958, 0.27745312452316284, 0.13763250410556793, -0.04806363210082054, 0.10478394478559494, 0.26798325777053833, -0.22156700491905212, 0.39879634976387024, -0.2644486725330353, 0.19344276189804077, 0.15648004412651062, -0.28714719414711, -0.14323703944683075, 0.14595569670200348, -0.16586393117904663, 0.1251741647720337, -0.11410307884216309, 0.35685572028160095, -0.32948604226112366, -0.2052232325077057, -0.3246617019176483, 0.2734101116657257, 0.1563965231180191, -0.04936342313885689, -0.12169062346220016, -0.23355770111083984, -0.3246263265609741, 0.419844388961792, 0.19183841347694397, -0.20933453738689423, 0.43922123312950134, 0.04172666370868683, 0.1905096173286438, 0.14815662801265717, -0.08434094488620758, -0.09694557636976242, 0.19104322791099548, -0.3988364040851593, -0.16695250570774078, -0.08613653481006622, 0.22950425744056702, 0.18279141187667847, 0.06782254576683044, -0.06017952039837837, -0.08235430717468262, -0.20088103413581848, -0.2690817415714264, 0.13202138245105743, 0.05281837284564972, -0.2591715455055237, 0.09706036001443863, -0.11541794240474701, 0.12569360435009003, 0.40137648582458496, 0.03033926524221897, -0.039532385766506195, 0.02172323688864708, 0.22650453448295593, 0.13860249519348145, -0.4782199263572693, 0.597873866558075, 0.08206801116466522, 0.06604281812906265, -0.09126850962638855, 0.0023139044642448425, -0.04051593691110611, -0.04732939973473549, -0.1258627325296402, -0.36656564474105835, 0.14184007048606873, 0.06422485411167145, -0.007136325351893902, 0.1799735575914383, 0.40938231348991394, -0.03154803439974785, 0.03655192628502846, -0.30240458250045776, -0.3571845293045044, -0.4182197153568268, -0.13357329368591309, -0.05892801657319069, -0.035747822374105453, 0.11532272398471832, 0.39403003454208374, -0.09933409839868546, 0.4434005618095398, -0.023594379425048828, -0.0280058141797781, 0.01956481859087944, 0.4247995615005493, 0.12061133980751038, -0.13946618139743805, -0.2914639115333557, -0.20759637653827667, -0.09191875904798508, -0.4429810643196106, 0.2365785837173462, -0.11727792024612427, -0.11291416734457016, 0.36430102586746216, 0.017162494361400604, 0.3913881182670593, -0.38872450590133667, 0.22824987769126892, 0.09976202249526978, 0.27249374985694885, -0.15719904005527496, 0.08985403180122375, -0.19464397430419922, 0.1985824555158615, -0.2870613932609558, 0.01048988476395607, -0.14539942145347595, 0.11782863736152649, -0.1731671839952469, 0.32712340354919434, -0.5083281993865967, 0.19255703687667847, 0.28181368112564087, 0.4140115976333618, -0.3466058373451233, -0.027196131646633148, -0.4259801208972931, 0.46519824862480164, 0.5619802474975586, 0.3547731935977936, -0.4275849461555481, -0.1852964162826538, -0.1813575178384781, -0.1448386311531067, 0.48133033514022827, -0.041840121150016785, -0.235274076461792, -0.16189409792423248, 0.2937203645706177, 0.47290271520614624, -0.18975858390331268, -0.25864219665527344, -0.28529053926467896, 0.20876872539520264, -0.3929705321788788, 0.20102259516716003, 0.3973047435283661, 0.1130513995885849, -0.17755649983882904, -0.07914666086435318, 0.23306021094322205, 0.2223493456840515, -0.2179006189107895, 0.013436179608106613, -0.3645961880683899 ]
https://github.com/huggingface/datasets/issues/6524
Streaming the Pile: Missing Files
Hello @FelixLabelle, As you can see in the Community tab of the corresponding dataset, it is a known issue: https://huggingface.co/datasets/EleutherAI/pile/discussions/15 The data has been taken down due to reported copyright infringement. Feel free to continue the discussion there.
### Describe the bug The pile does not stream, a "File not Found error" is returned. It looks like the Pile's files have been moved. ### Steps to reproduce the bug To reproduce run the following code: ``` from datasets import load_dataset dataset = load_dataset('EleutherAI/pile', 'en', split='train', streaming=True) next(iter(dataset)) ``` I get the following error: `FileNotFoundError: https://the-eye.eu/public/AI/pile/train/00.jsonl.zst` ### Expected behavior Return the data in a stream. ### Environment info - `datasets` version: 2.12.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.11.5 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.3
38
Streaming the Pile: Missing Files ### Describe the bug The pile does not stream, a "File not Found error" is returned. It looks like the Pile's files have been moved. ### Steps to reproduce the bug To reproduce run the following code: ``` from datasets import load_dataset dataset = load_dataset('EleutherAI/pile', 'en', split='train', streaming=True) next(iter(dataset)) ``` I get the following error: `FileNotFoundError: https://the-eye.eu/public/AI/pile/train/00.jsonl.zst` ### Expected behavior Return the data in a stream. ### Environment info - `datasets` version: 2.12.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.11.5 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.3 Hello @FelixLabelle, As you can see in the Community tab of the corresponding dataset, it is a known issue: https://huggingface.co/datasets/EleutherAI/pile/discussions/15 The data has been taken down due to reported copyright infringement. Feel free to continue the discussion there.
[ -0.010011963546276093, -0.0032870545983314514, 0.022553451359272003, 0.16257643699645996, 0.1053953543305397, 0.04117199778556824, 0.24604424834251404, 0.3479253351688385, 0.035747431218624115, 0.07959219813346863, 0.07477732747793198, 0.17447493970394135, -0.15698176622390747, 0.04747070372104645, 0.1371728479862213, -0.04033654183149338, 0.13708831369876862, 0.11854282021522522, -0.053147658705711365, -0.26345568895339966, 0.07103855162858963, -0.04448681324720383, -0.23175673186779022, -0.21143464744091034, -0.059361718595027924, 0.1227288469672203, -0.4385738968849182, 0.18385235965251923, -0.11421229690313339, 0.10816674679517746, 0.14071045815944672, -0.13157586753368378, 0.24080199003219604, 0.6721792221069336, -0.00011332632129779086, 0.03656066954135895, 0.1343897432088852, -0.188994899392128, -0.3146525025367737, -0.5125759243965149, 0.02230791002511978, -0.3521554470062256, -0.12705793976783752, -0.01437842845916748, -0.11459716409444809, -0.34768855571746826, 0.2555430829524994, -0.09489038586616516, 0.3086974024772644, 0.447469562292099, 0.12258227169513702, 0.42658349871635437, 0.1350100338459015, 0.033742502331733704, 0.17085757851600647, -0.10793282091617584, -0.05749216675758362, 0.37623944878578186, 0.06217431649565697, 0.05187700688838959, -0.16253206133842468, 0.3671284019947052, 0.07919853925704956, -0.21741646528244019, 0.1629106104373932, 0.13225333392620087, -0.1784507930278778, -0.20707781612873077, -0.26938170194625854, 0.11182470619678497, 0.2445036768913269, -0.21067893505096436, -0.5167704820632935, -0.2562578022480011, 0.06262436509132385, -0.2275691032409668, 0.06235771253705025, 0.4124951660633087, -0.09918604791164398, 0.16573165357112885, 0.27795326709747314, -0.0411401130259037, -0.24536652863025665, 0.17251409590244293, 0.07527697086334229, -0.070000559091568, -0.03126637637615204, -0.18554675579071045, -0.14632132649421692, 0.21437425911426544, 0.21236424148082733, -0.08111747354269028, 0.01871132105588913, 0.28811416029930115, -0.3800777196884155, -0.08532752096652985, 0.2915569245815277, 0.04057089239358902, -0.21175384521484375, 0.12095626443624496, 0.41925543546676636, -0.13330653309822083, -0.11118128150701523, 0.1516382396221161, 0.5258632898330688, 0.09918490052223206, -0.26835888624191284, -0.2687913477420807, 0.2921944260597229, 0.4843916594982147, -0.03363434597849846, -0.5080322623252869, -0.026931341737508774, -0.0056358762085437775, 0.03208592161536217, -0.11978652328252792, 0.37299466133117676, -0.022209372371435165, -0.10298603773117065, -0.10051395744085312, -0.33709239959716797, -0.1100037470459938, 0.1220056414604187, 0.07757300138473511, -0.1978166103363037, 0.43176886439323425, -0.03686770424246788, 0.33167046308517456, 0.016589781269431114, -0.12881861627101898, -0.3356953263282776, 0.15540066361427307, -0.16654476523399353, -0.08909929543733597, 0.1477564126253128, -0.4577881693840027, 0.2985464930534363, 0.033122994005680084, 0.2139441967010498, 0.11981292068958282, 0.008488407358527184, -0.11484706401824951, 0.18334819376468658, 0.3867127299308777, 0.16125579178333282, -0.01955585367977619, 0.10360406339168549, 0.11502772569656372, -0.1467810869216919, 0.2113947570323944, -0.15551018714904785, -0.38415446877479553, -0.07283110916614532, 0.13816037774085999, -0.3606281280517578, -0.008950240910053253, -0.36439138650894165, -0.0657733827829361, -0.32804831862449646, -0.2876134514808655, 0.12275911867618561, -0.1374829262495041, 0.33921000361442566, -0.21828989684581757, 0.35067179799079895, 0.3148411512374878, -0.17364434897899628, -0.23509620130062103, -0.34502559900283813, 0.13723428547382355, 0.3320847749710083, 0.20717963576316833, 0.0013873932184651494, 0.044227633625268936, -0.37316444516181946, 0.237873837351799, 0.48245787620544434, -0.21409191191196442, -0.4749014377593994, 0.12755869328975677, -0.17809757590293884, 0.38106369972229004, 0.2707943916320801, 0.18648643791675568, 0.04376688599586487, -0.2468569427728653, 0.01573607698082924, 0.17040126025676727, -0.07217422127723694, -0.0589890256524086, -0.19003866612911224, -0.0857197642326355, -0.0481821745634079, 0.26134413480758667, 0.120085209608078, 0.09505298733711243, 0.1855325996875763, -0.006329849362373352, 0.27299678325653076, 0.13225893676280975, 0.10740920901298523, 0.060109272599220276, 0.6114177107810974, 0.17929735779762268, 0.011567959561944008, -0.06174524500966072, -0.3763616979122162, 0.08688949793577194, 0.003877200186252594, -0.039911381900310516, -0.04958850145339966, 0.05753891170024872, 0.02965094894170761, -0.05442208796739578, -0.11561204493045807, -0.30081093311309814, 0.11618220806121826, 0.10998134315013885, -0.03735560178756714, 0.16478696465492249, -0.5341473817825317, 0.2667199373245239, -0.2712494432926178, 0.10088573396205902, -0.5077943205833435, 0.7092071771621704, -0.11423037201166153, -0.2775370180606842, 0.05393988639116287, 0.04914463683962822, -0.0747114047408104, 0.00617808336392045, -0.0024900268763303757, 0.26337429881095886, -0.42839515209198, 0.1904400885105133, 0.2697165310382843, 0.3306983709335327, 0.5082699656486511, -0.2924727201461792, 0.16956175863742828, 0.35518261790275574, 0.12791523337364197, 0.0003526434302330017, -0.21244460344314575, 0.031008154153823853, -0.09431853890419006, 0.1493297517299652, 0.28620004653930664, -0.11720629036426544, 0.19094659388065338, 0.020538154989480972, -0.1657567173242569, 0.19536635279655457, 0.2762899398803711, -0.19299428164958954, 0.0676221251487732, 0.08762785792350769, -0.335316002368927, 0.18053938448429108, 0.6572650671005249, 0.03701687231659889, -0.09363017231225967, 0.4286055862903595, -0.37303876876831055, -0.11551013588905334, 0.16685999929904938, -0.13755767047405243, 0.4717027544975281, 0.19324781000614166, 0.17526012659072876, -0.027493352070450783, 0.17853610217571259, -0.245910182595253, 0.0010419860482215881, 0.09084758907556534, -0.09943298250436783, 0.3183733820915222, 0.18523135781288147, 0.14079883694648743, -0.32466843724250793, -0.29368168115615845, -0.2437848448753357, 0.05543708801269531, -0.10792278498411179, -0.08826746046543121, -0.11295410990715027, -0.3285590708255768, -0.16023394465446472, -0.2720448970794678, -0.21550729870796204, -0.3103678822517395, 0.018431279808282852, 0.5851937532424927, -0.16360577940940857, -0.1300826221704483, -0.09763909876346588, 0.07924430072307587, 0.07241109758615494, 0.10090217739343643, -0.6300557851791382, 0.01870063878595829, -0.14730185270309448, 0.09129014611244202, 0.00227443128824234, 0.11177795380353928, 0.07951048016548157, -0.1337270438671112, 0.06937872618436813, -0.40342849493026733, -0.23549610376358032, -0.043661460280418396, -0.046270228922367096, 0.32808637619018555, -0.027845442295074463, 0.5890783667564392, 0.025116629898548126, -0.2024180293083191, 0.1651623696088791, -0.5025312304496765, -0.1606171876192093, 0.30836689472198486, 0.0737791657447815, 0.1653374880552292, -0.11562618613243103, -0.3257454037666321, -0.2897326648235321, -0.47882965207099915, 0.3311777710914612, -0.02414429746568203, -0.07641217112541199, 0.04790527746081352, 0.2597759962081909, 0.12053874135017395, 0.06948377937078476, -0.11772662401199341, 0.14090655744075775, -0.6602532267570496, 0.5287446975708008, -0.040668655186891556, -0.3833222985267639, 0.17801569402217865, 0.12786425650119781, -0.1754254698753357, -0.03331780433654785, -0.43604332208633423, -0.26201552152633667, -0.16473977267742157, 0.014861680567264557, 0.009715426713228226, 0.1090698093175888, 0.3879300355911255, -0.1800568699836731, -0.09889195114374161, -0.1317349374294281, -0.023495834320783615, 0.019146956503391266, 0.6284863948822021, 0.398503839969635, -0.08746261149644852, 0.42881014943122864, 0.3345194160938263, 0.5393118262290955, 0.1477135568857193, 0.031875237822532654, 0.5506266951560974, 0.09152114391326904, 0.5690035223960876, -0.15347427129745483, -0.33504781126976013, 0.27288323640823364, -0.24415582418441772, -0.20813800394535065, 0.35133451223373413, 0.2077816128730774, 0.11322025954723358, -0.26735803484916687, -0.18969662487506866, -0.2713194489479065, -0.10813887417316437, 0.16896472871303558, 0.15468980371952057, -0.11829058080911636, 0.10331393778324127, -0.09762562811374664, 0.05742811784148216, -0.3423454463481903, 0.15560603141784668, 0.4760640263557434, 0.43465983867645264, 0.2556009590625763, -0.041353244334459305, -0.20513024926185608, -0.4795311689376831, -0.041151583194732666, -0.04831782355904579, 0.03177284076809883, -0.005998294800519943, -0.2797009348869324, 0.061550650745630264, 0.13536430895328522, 0.547813892364502, 0.04070845991373062, -0.06127411872148514, -0.04111659526824951, 0.1898615062236786, 0.001957489177584648, -0.20299126207828522, -0.25975704193115234, -0.057845208793878555, 0.5163770318031311, 0.3777318000793457, -0.15480220317840576, 0.11307579278945923, 0.03127744048833847, 0.09330148249864578, 0.09007935225963593, -0.22970783710479736, -0.4242493212223053, -0.24249035120010376, -0.14515836536884308, 0.06331498920917511, 0.2096167653799057, -0.03985222801566124, -0.3398858308792114, -0.1193891167640686, 0.18309646844863892, -0.09477651864290237, 0.09664478152990341, -0.11311900615692139, 0.24429479241371155, 0.03133898973464966, 0.09368468821048737, 0.2456788271665573, 0.39035922288894653, 0.4057481288909912, 0.4950816333293915, 0.3520386815071106, -0.5315307378768921, 0.0917188972234726, -0.33167266845703125, 0.27386200428009033, 0.3060165047645569, 0.016299966722726822, -0.12277007848024368, 0.2540961503982544, 0.3047017455101013, -0.051207561045885086, 0.15141163766384125, 0.2927931249141693, -0.08902791887521744, -0.1987995058298111, -0.2716992497444153, 0.1912306696176529, -0.1439749300479889, 0.23516850173473358, 0.5243909358978271, -0.007701002061367035, -0.06570688635110855, 0.19176609814167023, -0.17914021015167236, 0.9852909445762634, 0.20217517018318176, 0.23860281705856323, 0.2870945632457733, -0.21944010257720947, 0.2525450587272644, -0.37182044982910156, 0.236061230301857, -0.09053220599889755, -0.6551406383514404, -0.085213303565979, -0.12377028167247772, 0.08648239821195602, 0.18081660568714142, -0.14778795838356018, 0.5042141079902649, -0.0016577169299125671, 0.4272960126399994, 0.10258057713508606, -0.08174437284469604, -0.16560551524162292, -0.06914052367210388, -0.5009552836418152, 0.08196478337049484, 0.030521037057042122, 0.4883967339992523, -0.037148941308259964, -0.35765546560287476, -0.09623542428016663, 0.010546833276748657, -0.09162091463804245, 0.35645487904548645, 0.10688460618257523, -0.14695681631565094, -0.17002862691879272, -0.30515366792678833, -0.32240381836891174, 0.2819575369358063, 0.02810913696885109, -0.25868886709213257, -0.08396673947572708, 0.25115662813186646, 0.15931826829910278, 0.032288119196891785, 0.2797563374042511, 0.12686996161937714, 0.4207576513290405, -0.12443509697914124, -0.1565704345703125, 0.26230257749557495, -0.23784366250038147, -0.35997438430786133, -0.054457418620586395, 0.03722003474831581, 0.03219657018780708, 0.06446819007396698, -0.09405574202537537, 0.021276772022247314, -0.05870732665061951, -0.24183034896850586, 0.13162395358085632, 0.12920162081718445, -0.04281322658061981, -0.14287886023521423, -0.2611260414123535, -0.07176712155342102, -0.32677769660949707, 0.4370339810848236, -0.12455717474222183, -0.05109987035393715, 0.36805590987205505, 0.226144477725029, -0.17721150815486908, -0.04452412202954292, -0.13041368126869202, 0.14423562586307526, -0.38809335231781006, 0.20209743082523346, -0.0790991261601448, 0.23508025705814362, -0.14222726225852966, 0.036762434989213943, 0.1380448341369629, -0.2150791883468628, -0.2629389762878418, -0.47398531436920166, -0.1421574205160141, 0.18404154479503632, 0.20250269770622253, -0.04580363258719444, -0.1550222933292389, -0.04243314266204834, 0.4247739613056183, -0.31667327880859375, -0.30048632621765137, 0.0013078192714601755, -0.22571337223052979, 0.017186488956212997, -0.0644085481762886, 0.12587064504623413, 0.4417150914669037, -0.1770603507757187, 0.14328119158744812, -0.09123046696186066, 0.057852618396282196, -0.16264769434928894, -0.09321755170822144, 0.07845044881105423, 0.2287764549255371, 0.19947600364685059, -0.1396426558494568, -0.1501532793045044, -0.1280922144651413, -0.13175828754901886, -0.10352255403995514, 0.01620117574930191, 0.12142549455165863, 0.02838488295674324, 0.4018858075141907, 0.060005947947502136, -0.11435113102197647, -0.012818623334169388, 0.015982240438461304, 0.15167543292045593, 0.004006120841950178, -0.11059434711933136, 0.09666066616773605, 0.08610373735427856, -0.09407385438680649, -0.2530290484428406, -0.03618009388446808, 0.32056474685668945, 0.4333648979663849, -0.1228514164686203, 0.008796483278274536, -0.1155863031744957, 0.34134641289711, 0.32591742277145386, -0.06306496262550354, 0.05955301225185394, 0.21037375926971436, 0.21868304908275604, -0.4663199782371521, 0.14699803292751312, 0.25781169533729553, 0.16899952292442322, -0.12291823327541351, -0.1900126338005066, -0.10589471459388733, -0.04921218752861023, 0.0543225072324276, 0.26902440190315247, 0.1591600775718689, -0.16086699068546295, 0.13547715544700623, 0.29296451807022095, 0.11003807187080383, 0.2473386824131012, -0.05883999168872833, -0.008897744119167328, 0.007354654371738434, 0.25994449853897095, -0.017782211303710938, 0.09346964210271835, -0.016558483242988586, -0.03826243057847023, -0.25843775272369385, -0.4033327102661133, -0.6301029920578003, 0.31316739320755005, -0.023820921778678894, 0.28868165612220764, -0.07990512251853943, 0.30940183997154236, 0.05407479405403137, 0.01362258568406105, -0.16670000553131104, -0.09223154187202454, 0.01866035908460617, 0.3461199104785919, 0.10329088568687439, -0.08426286280155182, 0.02666405588388443, 0.10321544110774994, 0.4120674431324005, 0.0743754580616951, -0.06867018342018127, 0.22273126244544983, -0.06247371435165405, -0.23866380751132965, -0.3402044475078583, 0.11642643064260483, 0.21288180351257324, -0.1429082453250885, 0.0677829310297966, 0.38272029161453247, -0.24776053428649902, 0.16041184961795807, 0.1133432537317276, 0.2539829909801483, 0.14665408432483673, 0.264183908700943, 0.35870087146759033, 0.20672105252742767, -0.24385154247283936, -0.12312007695436478, 0.25909435749053955, 0.13816897571086884, 0.07007647305727005, -0.030398286879062653, 0.2186315804719925, -0.2361215353012085, 0.3318161070346832, -0.25879013538360596, 0.2819244861602783, -0.38990411162376404, 0.5134843587875366, -0.23077329993247986, -0.16373556852340698, -0.19344529509544373, -0.3037906289100647, -0.5236949324607849, 0.021648578345775604, 0.01329774409532547, -0.11453205347061157, -0.18432274460792542, -0.06040230765938759, 0.07918835431337357, -0.09018194675445557, 0.0602799654006958, 0.7335802912712097, -0.13271310925483704, -0.09577654302120209, -0.2643345892429352, -0.6546865105628967, 0.13818152248859406, 0.10578951239585876, 0.26828089356422424, -0.07218386977910995, 0.3091500401496887, -0.09462035447359085, -0.15794554352760315, 0.11247126758098602, -0.21210572123527527, -0.015958137810230255, 0.28679072856903076, -0.39991068840026855, -0.26632705330848694, -0.3116500973701477, 0.47539061307907104, -0.04625143110752106, 0.03211361914873123, 0.08452584594488144, -0.23722493648529053, 0.06965953856706619, 0.14208588004112244, -0.12098832428455353, -0.135108083486557, -0.09400427341461182, 0.40381619334220886, -0.13372758030891418, -0.15778520703315735, -0.0751919373869896, -0.3078373968601227, -0.24284306168556213, -0.1293400079011917, -0.2061241716146469, 0.03081601858139038, -0.22963544726371765, 0.46811291575431824, -0.18161296844482422, 0.048574551939964294, -0.2733115553855896, 0.12547406554222107, 0.12578578293323517, -0.39496368169784546, -0.3849382996559143, 0.08794654905796051, -0.0751822367310524, 0.2848374545574188, 0.1597754955291748, 0.11407341063022614, -0.19881314039230347, -0.3292285203933716, -0.2836693823337555, -0.24250659346580505, 0.5499696731567383, -0.6593599915504456, -0.10038955509662628, -0.06856267899274826, 0.042897313833236694, -0.02663232386112213, 0.015602977946400642, -0.33464521169662476, 0.13487347960472107, 0.22894012928009033, 0.11301654577255249, -0.07370062172412872, 0.009372929111123085, -0.10492604970932007, 0.24709095060825348, 0.023276153951883316, -0.11922267079353333, 0.1784103810787201, -0.23299041390419006, 0.40509864687919617, -0.13688373565673828 ]
https://github.com/huggingface/datasets/issues/6521
The order of the splits is not preserved
After investigation, I think the issue was introduced by the use of the Parquet export: - #6448 I am proposing a fix. CC: @lhoestq
We had a regression and the order of the splits is not preserved. They are alphabetically sorted, instead of preserving original "train", "validation", "test" order. Check: In branch "main" ```python In [9]: dataset = load_dataset("adversarial_qa", '"adversarialQA") In [10]: dataset Out[10]: DatasetDict({ test: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 30000 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) }) ``` Before (2.15.0) it was: ```python DatasetDict({ train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 30000 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) test: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) }) ``` See issues: - https://huggingface.co/datasets/adversarial_qa/discussions/3 - https://huggingface.co/datasets/beans/discussions/4 This is a regression because it was previously fixed. See: - #6196 - #5728
24
The order of the splits is not preserved We had a regression and the order of the splits is not preserved. They are alphabetically sorted, instead of preserving original "train", "validation", "test" order. Check: In branch "main" ```python In [9]: dataset = load_dataset("adversarial_qa", '"adversarialQA") In [10]: dataset Out[10]: DatasetDict({ test: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 30000 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) }) ``` Before (2.15.0) it was: ```python DatasetDict({ train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 30000 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) test: Dataset({ features: ['id', 'title', 'context', 'question', 'answers', 'metadata'], num_rows: 3000 }) }) ``` See issues: - https://huggingface.co/datasets/adversarial_qa/discussions/3 - https://huggingface.co/datasets/beans/discussions/4 This is a regression because it was previously fixed. See: - #6196 - #5728 After investigation, I think the issue was introduced by the use of the Parquet export: - #6448 I am proposing a fix. CC: @lhoestq
[ 0.06278690695762634, -0.09385653585195541, -0.061401739716529846, 0.1778932511806488, 0.1143125370144844, -0.1434212625026703, 0.1864897459745407, 0.014444030821323395, 0.05687864497303963, 0.07198089361190796, 0.03695257008075714, 0.29690486192703247, 0.03535196930170059, 0.14106637239456177, 0.1722814291715622, -0.2979613244533539, 0.06859900057315826, 0.057850126177072525, -0.32958224415779114, -0.060790590941905975, -0.16247901320457458, 0.2617514729499817, -0.24527382850646973, -0.06881599128246307, -0.2149231880903244, -0.11927112191915512, -0.26074889302253723, 0.10256947576999664, -0.094276562333107, -0.048228152096271515, -0.11570896953344345, 0.01036832481622696, -0.19448792934417725, 0.11650300025939941, -0.00011469960736576468, -0.22715041041374207, -0.03550172597169876, -0.10264965146780014, -0.15805059671401978, -0.2676939368247986, -0.1438376009464264, -0.19049546122550964, -0.05139829218387604, -0.14915136992931366, -0.06873104721307755, 0.03144674003124237, -0.2054985761642456, -0.09135530143976212, 0.6052523255348206, 0.10516390204429626, 0.20345300436019897, 0.021969355642795563, 0.028735164552927017, -0.07941921800374985, 0.38285091519355774, 0.2900387644767761, -0.20456793904304504, 0.037824660539627075, -0.22425153851509094, 0.1429901272058487, 0.11882317066192627, 0.1301761269569397, 0.18461668491363525, -0.2848876714706421, -0.10604285448789597, -0.00028030481189489365, 0.06811031699180603, -0.09186610579490662, -0.3293362557888031, 0.09892590343952179, 0.09315009415149689, -0.1398712694644928, -0.43649542331695557, -0.08911585062742233, -0.007832815870642662, -0.5642651319503784, -0.05317137390375137, 0.2873007357120514, 0.4201507270336151, 0.10235334932804108, 0.21518252789974213, -0.15175870060920715, -0.12684166431427002, -0.003557540476322174, -0.3515782654285431, 0.5386670231819153, -0.055190544575452805, -0.2185426652431488, 0.04737149178981781, -0.18471817672252655, -0.049714986234903336, -0.00031000934541225433, 0.005543891340494156, 0.04019809886813164, -0.19548793137073517, -0.1405966728925705, -0.16527599096298218, 0.13755066692829132, 0.08539588004350662, 0.3068796992301941, -0.21685904264450073, -0.00781286135315895, 0.2182302474975586, -0.27832910418510437, 0.21770967543125153, 0.38839027285575867, -0.04202554374933243, 0.40873983502388, 0.11531901359558105, 0.5751620531082153, -0.13032487034797668, -0.01449330523610115, 0.11612416058778763, -0.11105387657880783, -0.10619001090526581, 0.2131882905960083, 0.18174387514591217, -0.15575887262821198, -0.06579168885946274, 0.02896549552679062, -0.21164658665657043, -0.16175077855587006, -0.08467438817024231, 0.27336132526397705, -0.002991977147758007, -0.034911200404167175, -0.18944133818149567, 0.1734604686498642, -0.12215682119131088, -0.03561077639460564, -0.34414705634117126, -0.2506294250488281, -0.1209164410829544, 0.11768269538879395, -0.11191648244857788, -0.0767354965209961, 0.2004188746213913, 0.27925270795822144, 0.08820390701293945, -0.08015882968902588, -0.19160328805446625, -0.2034018635749817, 0.32338160276412964, 0.32442834973335266, -0.10915829241275787, 0.23032622039318085, 0.052802182734012604, -0.13152778148651123, -0.203224778175354, -0.0045846253633499146, -0.34421390295028687, -0.2376621514558792, 0.2465895116329193, 0.22265106439590454, -0.10981909185647964, 0.011334888637065887, -0.24818488955497742, 0.06557536870241165, 0.19733652472496033, 0.11961925029754639, -0.040206871926784515, -0.19641205668449402, -0.14581814408302307, -0.0678303986787796, 0.058150045573711395, 0.10161849856376648, -0.34681034088134766, 0.0294729545712471, 0.08783799409866333, 0.07425577193498611, 0.2593499422073364, 0.3996521532535553, 0.11648104339838028, -0.0869966372847557, -0.09119603782892227, 0.26269257068634033, 0.167996346950531, 0.025016043335199356, -0.36813339591026306, 0.03705378994345665, -0.12568439543247223, 0.13487417995929718, 0.07368729263544083, -0.3070161044597626, 0.5712352991104126, -0.3140732944011688, -0.32988157868385315, 0.40474599599838257, 0.1256578266620636, 0.09064798802137375, -0.2765946686267853, -0.06412840634584427, 0.42912757396698, -0.10345906019210815, -0.00600084662437439, -0.22863814234733582, -0.13226976990699768, 0.2547641098499298, 0.42950722575187683, 0.06755973398685455, -0.14225433766841888, 0.11975374817848206, 0.38666239380836487, 0.07392304390668869, 0.40457215905189514, -0.34546682238578796, -0.06983547657728195, -0.046231258660554886, -0.06516612321138382, -0.2973005175590515, -0.03919041156768799, -0.23147043585777283, -0.3300240933895111, -0.07365665584802628, -0.22675113379955292, -0.106631800532341, 0.1724325567483902, -0.0043984949588775635, -0.14782078564167023, 0.1595468670129776, -0.08140738308429718, 0.27914032340049744, -0.23190107941627502, 0.21535441279411316, -0.35342201590538025, 0.5349839925765991, -0.23056526482105255, -0.16799965500831604, -0.029578326269984245, 0.4215858578681946, 0.12337411940097809, -0.25538399815559387, -0.04353192448616028, 0.4768248200416565, 0.4797753393650055, -0.17111997306346893, -0.22316300868988037, -0.15086399018764496, 0.2299681305885315, -0.09934322535991669, -0.14626052975654602, 0.3558168113231659, -0.27978092432022095, 0.1220209077000618, -0.26402547955513, 0.44246751070022583, -0.3141472041606903, 0.38659119606018066, 0.2641942501068115, 0.0618283748626709, -0.1398765593767166, -0.001025661826133728, -0.21308164298534393, -0.47726237773895264, 0.10772374272346497, -0.1208638846874237, -0.19297084212303162, -0.001744300127029419, -0.13356393575668335, 0.33558452129364014, 0.8212563395500183, 0.01919638365507126, 0.03014441207051277, -0.19471874833106995, 0.06478362530469894, -0.036657802760601044, -0.010670440271496773, 0.25962120294570923, 0.3057297468185425, 0.14424574375152588, 0.0023673251271247864, -0.07325809448957443, 0.0801214650273323, -0.20123378932476044, 0.23442348837852478, -0.001306295394897461, 0.05521416291594505, 0.38538581132888794, 0.18254275619983673, -0.00030722562223672867, -0.34337958693504333, 0.4038908779621124, -0.05537202209234238, -0.0008607078343629837, -0.37491244077682495, 0.15044280886650085, -0.5492832660675049, 0.02470547705888748, -0.3855113089084625, -0.27572667598724365, -0.45161059498786926, -0.28728970885276794, 0.17045435309410095, -0.15947090089321136, -0.14540036022663116, 0.40193554759025574, 0.19937270879745483, 0.06911435723304749, -0.19306714832782745, 0.2367827594280243, -0.06328067183494568, -0.16508984565734863, 0.08030685782432556, 0.10613320767879486, -0.23951992392539978, 0.5441974997520447, 0.15343345701694489, -0.1150955781340599, -0.3788312077522278, -0.054568156599998474, -0.4480535686016083, -0.017762474715709686, -0.013724878430366516, 0.21151162683963776, 0.18666580319404602, -0.18548531830310822, -0.08133992552757263, -0.2929454445838928, 0.101263128221035, -0.14675727486610413, -0.43440818786621094, 0.11760087311267853, 0.016475588083267212, 0.06920107454061508, -0.08272895216941833, -0.5346204042434692, -0.17342421412467957, -0.28707191348075867, 0.1216350793838501, 0.08960093557834625, 0.05275363475084305, -0.084366075694561, -0.33271101117134094, -0.46731096506118774, -0.22963453829288483, 0.029612191021442413, -0.3282264769077301, 0.23868566751480103, 0.20468755066394806, -0.31450438499450684, -0.22639329731464386, -0.11128315329551697, -0.05939503386616707, -0.452197402715683, 0.05020865425467491, -0.043575115501880646, -0.03468788415193558, -0.17772772908210754, 0.0077051520347595215, 0.09526452422142029, 0.1354580968618393, 0.5069114565849304, -0.156715527176857, 0.03196493536233902, -0.05617743358016014, -0.04885774850845337, 0.29655715823173523, 0.3940095603466034, 0.1948297917842865, -0.3336033523082733, 0.43755587935447693, 0.13541559875011444, 0.7831200957298279, 0.2648349106311798, 0.11475490033626556, -0.12588050961494446, -0.013524843379855156, 0.10825631022453308, -0.31435006856918335, -0.22242236137390137, 0.15577556192874908, 0.04856947064399719, 0.22044849395751953, 0.26985904574394226, 0.014229273423552513, -0.0006079655140638351, 0.36989572644233704, -0.02411331608891487, -0.048579517751932144, -0.2383878380060196, -0.13424134254455566, -0.04717026650905609, 0.2883823812007904, 0.20192912220954895, 0.05271029472351074, 0.17653007805347443, 0.012237206101417542, 0.1997988224029541, 0.14760524034500122, 0.11943988502025604, 0.04506726935505867, -0.12979692220687866, 0.038975078612565994, -0.10549787431955338, -0.14969588816165924, 0.032756462693214417, -0.0015366626903414726, 0.12961098551750183, -0.3441474139690399, 0.019692696630954742, -0.09743425995111465, 0.49484390020370483, 0.11279284954071045, 0.020391421392560005, 0.040494855493307114, -0.06325971335172653, -0.18251104652881622, -0.21854336559772491, -0.2607515752315521, -0.04633234813809395, 0.266958087682724, 0.6680560111999512, -0.4647989869117737, -0.11760463565587997, 0.48353254795074463, 0.17838610708713531, -0.22848840057849884, -0.016531851142644882, -0.4416120648384094, 0.11162359267473221, 0.132815420627594, 0.33758658170700073, 0.16635650396347046, 0.05284581705927849, -0.410434752702713, -0.02369825914502144, -0.09484304487705231, -0.39352160692214966, -0.20771218836307526, -0.03604399412870407, 0.6807255148887634, -0.16358068585395813, 0.032518740743398666, 0.22573553025722504, 0.4486938714981079, -0.12436355650424957, 0.30800020694732666, -0.1746075302362442, -0.4035540521144867, 0.03781358152627945, -0.1560787856578827, 0.3240780532360077, 0.35541290044784546, -0.227980837225914, 0.09642121195793152, -0.26753726601600647, 0.16407594084739685, 0.09441714733839035, -0.25880366563796997, 0.5009999871253967, -0.3687664568424225, 0.18376731872558594, -0.13129408657550812, 0.10269375890493393, -0.05889824032783508, -0.07036063075065613, -0.17325282096862793, 0.4471166133880615, -0.19594572484493256, 0.39826691150665283, 0.3590933680534363, 0.9550320506095886, 0.223164901137352, 0.16210441291332245, 0.2828291058540344, -0.31663286685943604, 0.32467469573020935, -0.06589539349079132, 0.2419506460428238, -0.5295190811157227, -0.5630078315734863, 0.1268850564956665, -0.11888845264911652, -0.04731956869363785, -0.07982951402664185, -0.31174319982528687, 0.29987451434135437, -0.2737181782722473, 0.32523033022880554, -0.25900575518608093, -0.0864778459072113, 0.09446944296360016, 0.0058151725679636, -0.3637436628341675, 0.02616960182785988, 0.21111348271369934, -0.16753290593624115, -0.14575102925300598, 0.08206620067358017, 0.08341766893863678, -0.07574133574962616, -0.07818806916475296, 0.2195933759212494, -0.32597729563713074, 0.1630209982395172, 0.10136860609054565, -0.3467419147491455, 0.06922897696495056, 0.22930565476417542, 0.2705111503601074, 0.17228126525878906, 0.28036293387413025, 0.12567925453186035, 0.18001067638397217, 0.0834471806883812, 0.19740086793899536, 0.053903862833976746, 0.23402996361255646, -0.19814488291740417, -0.08809063583612442, -0.4284776449203491, 0.10811115801334381, -0.09179699420928955, -0.3915679454803467, 0.14349649846553802, -0.19441311061382294, -0.3220757842063904, 0.02440616488456726, 0.4735679030418396, 0.33475062251091003, -0.40140119194984436, 0.17486746609210968, -0.14356321096420288, -0.2042510062456131, 0.35096457600593567, -0.39994901418685913, -0.0922393947839737, -0.15384207665920258, 0.33835121989250183, 0.09896120429039001, 0.4293191730976105, 0.3316916525363922, 0.005737345665693283, -0.35200971364974976, -0.3328058421611786, 0.06406319886445999, 0.10371262580156326, -0.5751314759254456, 0.4346567988395691, -0.328029602766037, -0.20570066571235657, 0.09261157363653183, 0.13415095210075378, 0.04781308397650719, -0.0876925066113472, -0.44718047976493835, -0.0901513397693634, 0.25509580969810486, 0.11981454491615295, 0.1253470778465271, -0.09536807239055634, -0.13747695088386536, 0.07304979860782623, -0.3257489502429962, 0.26955074071884155, -0.32316917181015015, 0.20172731578350067, 0.1390671581029892, 0.11930370330810547, -0.3496740758419037, -0.33825168013572693, -0.030133860185742378, -0.005860492587089539, 0.15217210352420807, 0.11332301050424576, 0.022756122052669525, -0.2555580139160156, -0.28114601969718933, 0.09417887032032013, -0.1366298794746399, 0.36268359422683716, -0.05395190045237541, 0.018668878823518753, -0.1827201545238495, -0.0827801525592804, 0.2603911757469177, -0.06519794464111328, 0.3214719891548157, 0.25864866375923157, 0.5407554507255554, 0.26965832710266113, -0.0016173534095287323, 0.08472777903079987, -0.09264333546161652, -0.11669944226741791, 0.04504498094320297, 0.24846795201301575, -0.17613528668880463, -0.06636251509189606, -0.2683700919151306, -0.017554089426994324, 0.1422116607427597, 0.1809883415699005, 0.439969003200531, -0.2914673089981079, -0.30566418170928955, -0.054973624646663666, 0.6608113050460815, 0.41822296380996704, 0.2574262022972107, -0.3567841351032257, -0.007616085931658745, 0.29557812213897705, -0.3845832943916321, -0.11492300033569336, 0.2638154923915863, 0.2649042308330536, -0.00846000388264656, 0.1473129391670227, 0.18940620124340057, 0.20123982429504395, 0.13086599111557007, 0.3486914038658142, 0.2539949417114258, 0.03672310709953308, 0.4757240414619446, 0.39177432656288147, 0.01789208874106407, 0.27750104665756226, 0.12255488336086273, -0.2127600908279419, 0.21950602531433105, 0.03427218273282051, 0.3208644390106201, 0.2867853343486786, 0.12898102402687073, 0.09387379884719849, 0.34963321685791016, 0.05068672075867653, -0.2962939739227295, 0.06268606334924698, 0.10040570050477982, 0.13312840461730957, 0.31617456674575806, 0.38994383811950684, -0.14730045199394226, -0.4714747369289398, -0.4354185163974762, 0.21821185946464539, -0.18827956914901733, -0.19078591465950012, -0.030977699905633926, -0.020262956619262695, -0.26349949836730957, -0.0788644403219223, -0.036931637674570084, 0.10603231191635132, 0.16029080748558044, 0.028975959867239, 0.19642339646816254, -0.4673256278038025, -0.013935640454292297, -0.14543169736862183, 0.7303429841995239, -0.0918407291173935, 0.2659592628479004, 0.11090585589408875, -0.039730362594127655, -0.23494309186935425, 0.20865242183208466, 0.0462372712790966, -0.09417320787906647, -0.13280053436756134, 0.04539065808057785, 0.03844860568642616, -0.161235511302948, 0.2752806842327118, 0.21113888919353485, -0.06915509700775146, 0.10909131169319153, 0.31606629490852356, 0.12083758413791656, -0.19265121221542358, 0.1926269233226776, 0.34988638758659363, 0.20863306522369385, -0.04595069959759712, 0.4186539053916931, -0.05992599576711655, -0.12948012351989746, 0.005806494504213333, -0.23029369115829468, -0.10269704461097717, 0.13531219959259033, -0.08830839395523071, -0.045593928545713425, -0.007916751317679882, -0.19755081832408905, 0.09286955744028091, 0.11722950637340546, 0.17532218992710114, 0.27671492099761963, -0.023296348750591278, -0.21590504050254822, -0.23322226107120514, -0.2430059313774109, 0.16011063754558563, -0.03598649427294731, -0.06395719200372696, 0.1329919993877411, 0.38273635506629944, -0.07079683989286423, 0.027345377951860428, -0.0036689937114715576, -0.0219643022865057, -0.0527757927775383, 0.22071243822574615, -0.5955453515052795, 0.0689050704240799, -0.042475126683712006, -0.13346634805202484, -0.1328042596578598, -0.15362372994422913, -0.29293638467788696, 0.2626825273036957, -0.02791157364845276, 0.1489819437265396, -0.02138112485408783, 0.12211911380290985, 0.2250669002532959, -0.30461981892585754, 0.23904907703399658, -0.16557401418685913, 0.13731813430786133, 0.10610613971948624, -0.07269063591957092, -0.2922668755054474, -0.39400550723075867, 0.27326005697250366, -0.011206787079572678, 0.4409245252609253, 0.07168861478567123, -0.3118492662906647, -0.14080533385276794, 0.2390519380569458, 0.200651153922081, -0.1295071542263031, -0.43646031618118286, 0.10774240642786026, 0.23978763818740845, -0.046532101929187775, 0.15650637447834015, 0.55060213804245, -0.2066309154033661, 0.033467307686805725, 0.07372318208217621, -0.38689082860946655, 0.23507389426231384, 0.06582166999578476, -0.06679613143205643, -0.20008791983127594, 0.46911001205444336, 0.565788745880127, -0.14234453439712524, -0.19215908646583557, -0.1257440447807312, 0.23029088973999023, -0.0936456173658371, 0.13393262028694153, 0.454637736082077, 0.24743051826953888, 0.038762208074331284, -0.12026692926883698, 0.18317803740501404, 0.3472711145877838, -0.35138267278671265, 0.1152176707983017, -0.064156174659729 ]
https://github.com/huggingface/datasets/issues/6506
Incorrect test set labels for RTE and CoLA datasets via load_dataset
As this is a specific issue of the "glue" dataset, I have transferred it to the dataset Discussion page: https://huggingface.co/datasets/glue/discussions/15 Let's continue the discussion there!
### Describe the bug The test set labels for the RTE and CoLA datasets when loading via datasets load_dataset are all -1. Edit: It appears this is also the case for every other dataset except for MRPC (stsb, sst2, qqp, mnli (both matched and mismatched), qnli, wnli, ax). Is this intended behavior to safeguard the test set for evaluation purposes? ### Steps to reproduce the bug !pip install datasets from datasets import load_dataset rte_data = load_dataset('glue', 'rte') cola_data = load_dataset('glue', 'cola') print(rte_data['test'][0:30]['label']) print(cola_data['test'][0:30]['label']) Output: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] The non-label test data seems to be fine: e.g. rte_data['test'][1] is: {'sentence1': "Authorities in Brazil say that more than 200 people are being held hostage in a prison in the country's remote, Amazonian-jungle state of Rondonia.", 'sentence2': 'Authorities in Brazil hold 200 people as hostage.', 'label': -1, 'idx': 1} Training and validation data are also fine: e.g. rte_data['train][0] is: {'sentence1': 'No Weapons of Mass Destruction Found in Iraq Yet.', 'sentence2': 'Weapons of Mass Destruction Found in Iraq.', 'label': 1, 'idx': 0} ### Expected behavior Expected the labels to be binary 0/1 values; Got all -1s instead ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-6.1.58+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 10.0.1 - Pandas version: 1.5.3 - `fsspec` version: 2023.6.0
25
Incorrect test set labels for RTE and CoLA datasets via load_dataset ### Describe the bug The test set labels for the RTE and CoLA datasets when loading via datasets load_dataset are all -1. Edit: It appears this is also the case for every other dataset except for MRPC (stsb, sst2, qqp, mnli (both matched and mismatched), qnli, wnli, ax). Is this intended behavior to safeguard the test set for evaluation purposes? ### Steps to reproduce the bug !pip install datasets from datasets import load_dataset rte_data = load_dataset('glue', 'rte') cola_data = load_dataset('glue', 'cola') print(rte_data['test'][0:30]['label']) print(cola_data['test'][0:30]['label']) Output: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] The non-label test data seems to be fine: e.g. rte_data['test'][1] is: {'sentence1': "Authorities in Brazil say that more than 200 people are being held hostage in a prison in the country's remote, Amazonian-jungle state of Rondonia.", 'sentence2': 'Authorities in Brazil hold 200 people as hostage.', 'label': -1, 'idx': 1} Training and validation data are also fine: e.g. rte_data['train][0] is: {'sentence1': 'No Weapons of Mass Destruction Found in Iraq Yet.', 'sentence2': 'Weapons of Mass Destruction Found in Iraq.', 'label': 1, 'idx': 0} ### Expected behavior Expected the labels to be binary 0/1 values; Got all -1s instead ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-6.1.58+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 10.0.1 - Pandas version: 1.5.3 - `fsspec` version: 2023.6.0 As this is a specific issue of the "glue" dataset, I have transferred it to the dataset Discussion page: https://huggingface.co/datasets/glue/discussions/15 Let's continue the discussion there!
[ -0.11327113211154938, -0.1245073676109314, -0.012102027423679829, 0.3323032259941101, 0.026470990851521492, 0.14775624871253967, 0.4843369722366333, 0.1177990585565567, 0.2665039002895355, 0.07214003056287766, -0.22635610401630402, 0.39532560110092163, -0.024147801101207733, 0.45505988597869873, 0.05062972009181976, 0.0747755616903305, 0.1112116351723671, 0.036098212003707886, -0.1317395716905594, -0.16477766633033752, -0.34861254692077637, 0.23913051187992096, -0.3872218728065491, -0.051289960741996765, -0.04737963154911995, 0.07408028095960617, -0.15958364307880402, -0.1733279526233673, 0.0747472271323204, -0.5440545082092285, 0.4895278811454773, 0.21044033765792847, -0.202658548951149, 0.42062729597091675, -0.00012112745025660843, -0.046564243733882904, 0.23420269787311554, -0.04615466669201851, -0.4276477098464966, -0.21655385196208954, -0.2562931180000305, -0.18107569217681885, 0.2895573377609253, -0.06686316430568695, -0.10881732404232025, 0.026390161365270615, -0.1569598764181137, -0.2787608504295349, 0.043950989842414856, 0.48161232471466064, 0.1581999808549881, 0.13909967243671417, -0.1351030468940735, 0.07827948778867722, 0.5109837651252747, 0.09934349358081818, -0.17291410267353058, 0.2709466516971588, 0.34924036264419556, -0.224080890417099, 0.2849138379096985, 0.43823954463005066, -0.10171464085578918, 0.13540558516979218, -0.13100549578666687, 0.060422781854867935, -0.04085073620080948, -0.5250658988952637, -0.0039012059569358826, 0.323586642742157, 0.6307023167610168, -0.32879218459129333, -0.5339771509170532, -0.25871896743774414, 0.08791589736938477, -0.061278730630874634, 0.2533293664455414, 0.08551894128322601, 0.04578990861773491, 0.055502016097307205, -0.3342049717903137, 0.18066371977329254, 0.025481581687927246, 0.1434691846370697, -0.15357284247875214, 0.19208645820617676, 0.13459540903568268, 0.1559942066669464, 0.029280325397849083, 0.04631601274013519, 0.4553462266921997, -0.06285770982503891, -0.21166768670082092, 0.25242021679878235, -0.5039454102516174, 0.0019191429018974304, -0.2012307047843933, 0.15321031212806702, 0.0325450524687767, -0.025116000324487686, 0.10752574354410172, -0.07738407701253891, -0.04130449891090393, 0.1076001450419426, 0.040604978799819946, 0.39306187629699707, 0.29309818148612976, 0.25054118037223816, 0.09566555917263031, -0.0730404183268547, -0.01598900556564331, 0.20457759499549866, -0.04118955880403519, -0.118711456656456, 0.06736844778060913, 0.13084527850151062, 0.024479638785123825, -0.35790109634399414, -0.49461740255355835, 0.12697644531726837, -0.3037620782852173, 0.09218450635671616, 0.10593847185373306, 0.10943189263343811, 0.09906286746263504, 0.2523966133594513, -0.013695977628231049, 0.27870622277259827, -0.3813181519508362, -0.27245500683784485, -0.057836923748254776, -0.014703340828418732, -0.11718708276748657, 0.11402170360088348, 0.4636470377445221, 0.02312975749373436, 0.12232547253370285, 0.19479483366012573, -0.11226402223110199, -0.21715471148490906, 0.2282237708568573, -0.22184807062149048, 0.24654090404510498, 0.2957545220851898, -0.06306374818086624, 0.3042812943458557, 0.18806473910808563, -0.341009259223938, 0.10642672330141068, 0.27511683106422424, -0.36372748017311096, -0.0608731247484684, 0.15702185034751892, 0.1230694130063057, -0.5125623345375061, -0.16195456683635712, -0.4501161277294159, 0.11573152244091034, 0.1783216893672943, -0.0008749328553676605, -0.04178833216428757, -0.6291662454605103, -0.12643218040466309, -0.01862248405814171, 0.02701554261147976, 0.30196332931518555, -0.45344507694244385, 0.0008170530200004578, 0.07220344990491867, 0.008958319202065468, 0.051667556166648865, 0.07340136170387268, -0.02118285745382309, 0.1205499917268753, -0.13422028720378876, -0.44349992275238037, 0.288813054561615, -0.6994170546531677, -0.28755638003349304, -0.06260358542203903, -0.0009269267320632935, -0.009907538071274757, -0.14793312549591064, -0.043902456760406494, 0.08764848113059998, 0.14210063219070435, 0.05993089824914932, 0.005564013496041298, 0.14134018123149872, 0.23026826977729797, -0.5062204599380493, 0.1209777295589447, 0.2669162452220917, 0.2112860381603241, 0.14546607434749603, 0.13352517783641815, -0.039799340069293976, -0.3160526752471924, 0.36768558621406555, 0.19707296788692474, -0.029047904536128044, 0.14005374908447266, 0.14391568303108215, -0.06402719020843506, 0.267680823802948, 0.21824446320533752, -0.4697777032852173, 0.23442673683166504, 0.09192321449518204, 0.3843969404697418, 0.16206997632980347, 0.036943234503269196, -0.4676203429698944, 0.05805548280477524, -0.2783975303173065, -0.1597794145345688, 0.005089849233627319, 0.30889344215393066, -0.10249124467372894, 0.10729621350765228, 0.0910816639661789, 0.31705763936042786, 0.031814783811569214, 0.2224409580230713, -0.10217852890491486, 0.013215476647019386, 0.1567162573337555, -0.10282175242900848, -0.0676986575126648, 0.08458486944437027, 0.2851564586162567, -0.028098229318857193, -0.20031127333641052, 0.26697811484336853, 0.446582555770874, -0.16377897560596466, 0.004184909164905548, -0.08212791383266449, 0.18532094359397888, -0.4170883297920227, -0.19332283735275269, 0.08674868941307068, 0.0394752062857151, 0.01341235637664795, -0.25849828124046326, 0.4765580892562866, -0.3760741949081421, 0.09199801087379456, -0.2703592777252197, 0.22456824779510498, 0.07595768570899963, -0.020714707672595978, -0.12239304929971695, -0.2558427155017853, 0.39659392833709717, -0.06491227447986603, 0.4517386555671692, 0.14381647109985352, -0.025330960750579834, 0.21103009581565857, -0.006437163800001144, -0.0008307229727506638, -0.221890389919281, -0.17603778839111328, -0.021849103271961212, -0.07578463852405548, 0.3025530278682709, 0.6436909437179565, 0.3769422173500061, 0.1293167620897293, 0.018087763339281082, 0.05835644155740738, -0.11508482694625854, -0.07945190370082855, 0.13590022921562195, 0.10477221757173538, -0.03800259158015251, 0.06281746923923492, 0.4743844270706177, -0.22981609404087067, -0.037018850445747375, 0.022780485451221466, 0.14278815686702728, 0.22236834466457367, -0.7048840522766113, 0.11198844760656357, -0.15548837184906006, -0.1396607756614685, -0.5244505405426025, -0.4336388409137726, -0.18811708688735962, -0.6215136051177979, 0.07631479203701019, 0.027480460703372955, 0.057634856551885605, 0.12259139120578766, -0.19885878264904022, 0.022393271327018738, -0.4566487669944763, -0.2206200510263443, -0.13781070709228516, -0.17380845546722412, -0.16676104068756104, -0.02818186953663826, -0.06920310854911804, 0.16339221596717834, 0.11949825286865234, -0.47082963585853577, -0.35346704721450806, 0.25569772720336914, -0.3029375374317169, 0.18323996663093567, -0.29547178745269775, 0.4163277745246887, -0.02456159144639969, -0.20880301296710968, -0.22163277864456177, 0.07661782205104828, 0.10406386107206345, -0.02490047924220562, -0.008287153206765652, -0.06349368393421173, 0.05748412013053894, 0.019778015092015266, -0.2443714737892151, -0.5808746218681335, -0.3703857362270355, 0.08288298547267914, -0.015352174639701843, -0.10010413825511932, 0.052977077662944794, 0.36525431275367737, -0.2983933091163635, -0.1829657107591629, 0.15388928353786469, 0.08788461983203888, -0.18000845611095428, -0.36364981532096863, 0.11565608531236649, -0.19818353652954102, -0.16896046698093414, -0.139145165681839, 0.0020307786762714386, 0.06371644139289856, 0.11641760170459747, -0.3384833335876465, -0.16740626096725464, -0.035299964249134064, 0.05810688063502312, -0.06904497742652893, -0.32891538739204407, -0.1215609461069107, 0.2673763334751129, 0.1681414544582367, -0.4417843818664551, -0.20518523454666138, 0.19679972529411316, -0.08063512295484543, 0.11665266007184982, -0.1680479645729065, -0.03415718674659729, -0.2891390919685364, 0.2947372794151306, 0.15255019068717957, 0.07758098840713501, 0.23912087082862854, -0.22738468647003174, 0.26200151443481445, -0.09091383963823318, -0.25373077392578125, 0.14871568977832794, 0.20012567937374115, 0.047413356602191925, 0.135401651263237, -0.01343463733792305, 0.0502331480383873, -0.26549452543258667, 0.4622754454612732, -0.2673313617706299, -0.14597606658935547, -0.14677678048610687, -0.1566614955663681, -0.05310652405023575, 0.16125698387622833, 0.33546486496925354, -0.10201472043991089, -0.35170161724090576, -0.15883085131645203, -0.07310338318347931, -0.1804330050945282, 0.14237748086452484, -0.28182390332221985, -0.007187146693468094, -0.13205137848854065, 0.023709192872047424, 0.1576855331659317, 0.4213409721851349, -0.11950774490833282, -0.051174089312553406, 0.16742166876792908, 0.26006489992141724, 0.5143486261367798, -0.19035892188549042, 0.2545710504055023, 0.4209071099758148, 0.10650846362113953, -0.3434821367263794, -0.3669765591621399, -0.29013246297836304, -0.16964268684387207, 0.3160081207752228, 0.18798786401748657, 0.13557416200637817, -0.18244047462940216, 0.08736507594585419, 0.23731066286563873, -0.21671079099178314, -0.13056457042694092, -0.19861792027950287, -0.18366143107414246, 0.17326056957244873, -0.008283726871013641, 0.10494273155927658, 0.1773437112569809, -0.5305012464523315, 0.02721657231450081, -0.010387863963842392, 0.19498887658119202, 0.10270138829946518, 0.3462657034397125, 0.24777626991271973, 0.0942416787147522, 0.43721804022789, 0.3285497725009918, 0.016675353050231934, 0.3627525866031647, 0.8132731914520264, -0.3349488079547882, -0.23187026381492615, -0.06303463876247406, -0.3587256073951721, 0.2230415940284729, 0.050001055002212524, 0.019561685621738434, -0.3103087544441223, -0.6303339004516602, -0.08413076400756836, -0.06468971073627472, 0.4199187159538269, 0.07224393635988235, 0.05637752264738083, -0.3885871469974518, -0.40870073437690735, 0.3025108277797699, 0.13341879844665527, -0.3264395594596863, 0.31117695569992065, -0.029071159660816193, -0.5089821219444275, 0.6574891805648804, 0.014283314347267151, 0.6144196391105652, -0.14229005575180054, 0.10994260013103485, 0.05543161556124687, -0.14000147581100464, 0.3946479558944702, 0.10738301277160645, -0.024307742714881897, -0.49476829171180725, -0.4286918044090271, 0.0006726551800966263, -0.08418622612953186, -0.4618340730667114, 0.24746231734752655, -0.18389558792114258, 0.4623100161552429, -0.0030602961778640747, -0.03330400958657265, -0.05636529624462128, -0.18178097903728485, 0.3222450911998749, -0.024516798555850983, -0.1519145518541336, 0.08889829367399216, -0.13256560266017914, 0.26692092418670654, -0.10002163052558899, 0.19295328855514526, -0.19957435131072998, -0.05938372761011124, -0.36814892292022705, 0.1418578028678894, -0.46022048592567444, -0.16442382335662842, 0.09906727820634842, -0.28449419140815735, -0.12342870235443115, 0.5371987223625183, 0.32911181449890137, 0.1766669750213623, -0.11105915904045105, 0.06373585760593414, 0.3366948068141937, 0.4498222768306732, 0.35308218002319336, 0.053678326308727264, 0.3755914866924286, 0.1711459457874298, -0.20583663880825043, -0.2616540789604187, -0.004765028599649668, 0.3148033618927002, 0.02367037534713745, -0.011059381067752838, -0.053884416818618774, -0.24460537731647491, 0.29763683676719666, -0.17004206776618958, 0.4100533723831177, -0.28406229615211487, 0.10726000368595123, -0.04617927223443985, 0.09679678827524185, 0.2863238751888275, -0.09053240716457367, -0.607993483543396, -0.033430736511945724, 0.2475353181362152, -0.11829572170972824, 0.06559472531080246, 0.27341708540916443, 0.03176074102520943, -0.11347594112157822, -0.16005344688892365, 0.33834385871887207, -0.0020852035377174616, -0.5771822333335876, 0.09796207398176193, -0.11165725439786911, -0.089543417096138, 0.0402655266225338, 0.444599449634552, 0.2010403275489807, -0.13167959451675415, 0.2044018656015396, -0.4124043583869934, -0.22827735543251038, -0.04351125657558441, 0.03201444819569588, 0.2083461582660675, 0.18251189589500427, -0.1666392832994461, 0.15051570534706116, -0.052628062665462494, -0.21770906448364258, -0.07984068989753723, -0.11227014660835266, 0.09565585851669312, -0.0252084843814373, 0.28174635767936707, 0.16481691598892212, -0.06223403662443161, 0.08010663092136383, -0.18828144669532776, 0.11863145977258682, -0.10802697390317917, -0.09827315807342529, 0.1652497798204422, 0.07031528651714325, -0.12527331709861755, -0.3329355716705322, -0.14641112089157104, 0.16117756068706512, -0.23835283517837524, 0.12396304309368134, 0.36877554655075073, 0.07980985939502716, 0.42900943756103516, -0.142086461186409, 0.25352272391319275, 0.09346650540828705, 0.28345686197280884, 0.09389035403728485, -0.18099723756313324, 0.15958359837532043, 0.21497583389282227, 0.09950624406337738, 0.06420570611953735, -0.023691989481449127, -0.053906507790088654, -0.24039854109287262, 0.07128262519836426, -0.08494003862142563, -0.4367469549179077, 0.28351685404777527, 0.07159082591533661, 0.24081698060035706, 0.3432142734527588, -0.23837199807167053, -0.06199450045824051, 0.09671265631914139, 0.15749691426753998, 0.004575926810503006, -0.17112722992897034, 0.3348810374736786, 0.5651289224624634, -0.1453622430562973, 0.30121999979019165, 0.17065811157226562, -0.2562822103500366, -0.1862221211194992, 0.09044315665960312, 0.4232623875141144, -0.006560191512107849, 0.2177603542804718, 0.1858098804950714, -0.3039628565311432, 0.20763395726680756, 0.19404923915863037, -0.16660264134407043, -0.0573313906788826, 0.15671265125274658, 0.10457846522331238, 0.46293461322784424, 0.08137716352939606, -0.1283005177974701, -0.07626814395189285, 0.07872197031974792, 0.11535230278968811, 0.10452352464199066, -0.2788313925266266, 0.26459357142448425, 0.18946310877799988, 0.37579548358917236, -0.11232953518629074, -0.3465135991573334, -0.3191888630390167, 0.03754003345966339, -0.10978775471448898, -0.2793157696723938, -0.1286247968673706, -0.004881210625171661, -0.2841379642486572, 0.29775065183639526, -0.1595473438501358, -0.10817374289035797, 0.5430537462234497, 0.08101684600114822, -0.15084543824195862, -0.3852044939994812, -0.5095494389533997, 0.3647613525390625, 0.22091275453567505, -0.21417579054832458, 0.24476966261863708, 0.0523548498749733, -0.03908265382051468, 0.2560770511627197, 0.09269315004348755, 0.37660351395606995, 0.16214051842689514, 0.061813611537218094, -0.4233095347881317, -0.0757007896900177, 0.08970360457897186, -0.021541526541113853, 0.2982734441757202, -0.14733010530471802, -0.0323784314095974, 0.5216139554977417, 0.07598274946212769, 0.0019485093653202057, 0.1553015261888504, 0.11313679814338684, 0.11548535525798798, -0.1356438547372818, 0.14807862043380737, 0.010959608480334282, -0.12187650799751282, -0.1607462614774704, -0.01752905547618866, 0.02552102506160736, 0.2848721146583557, 0.29448485374450684, 0.1423524171113968, 0.1934206485748291, 0.0958041101694107, 0.06340069323778152, 0.1737373173236847, 0.45011070370674133, 0.1937418133020401, 0.18093478679656982, -0.2711951434612274, 0.013226330280303955, -0.4440487325191498, 0.199266716837883, -0.06853260099887848, -0.06777509301900864, 0.12593775987625122, -0.4445958733558655, 0.14568555355072021, 0.03283547982573509, 0.06665214896202087, 0.16323503851890564, 0.23476339876651764, 0.3187384307384491, -0.478121280670166, -0.22095613181591034, -0.0038608089089393616, -0.2293723076581955, -0.02395123802125454, -0.20583531260490417, 0.00007978826761245728, -0.14922264218330383, -0.09276111423969269, -0.009923290461301804, -0.08805130422115326, 0.15273556113243103, -0.01584671437740326, 0.31020161509513855, 0.07943282276391983, 0.8688840866088867, 0.07290653139352798, 0.23349297046661377, -0.11628952622413635, -0.5003042817115784, -0.3176860809326172, 0.17473918199539185, -0.17640408873558044, -0.018347468227148056, 0.09694522619247437, 0.13840928673744202, 0.025324378162622452, -0.051580760627985, 0.10703510046005249, 0.33853498101234436, -0.3608454465866089, 0.025726070627570152, 0.004450976848602295, -0.05200476944446564, 0.12555107474327087, 0.11804921180009842, 0.10530954599380493, 0.37784543633461, -0.06115254387259483, -0.4110531508922577, 0.4370858669281006, -0.27926987409591675, 0.06421482563018799, -0.026543766260147095, 0.20761683583259583, 0.21205821633338928, -0.12703610956668854, -0.7507253289222717, 0.06508088856935501, 0.4402368366718292, -0.1490052342414856, -0.45486700534820557, 0.15570993721485138, -0.030083607882261276, 0.24207960069179535, -0.09013248980045319, 0.3377505838871002, 0.2655530869960785, -0.08964899927377701, -0.04079296439886093, 0.08848640322685242 ]
https://github.com/huggingface/datasets/issues/6505
Got stuck when I trying to load a dataset
I ran into the same problem when I used a server cluster (Slurm system managed) that couldn't load any of the huggingface datasets or models, but it worked on my laptop. I suspected some system configuration-related problem, but I had no idea. My problems are consistent with [issue #2618](https://github.com/huggingface/datasets/issues/2618). All the huggingface-related libraries I use are the latest versions.
### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0
59
Got stuck when I trying to load a dataset ### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0 I ran into the same problem when I used a server cluster (Slurm system managed) that couldn't load any of the huggingface datasets or models, but it worked on my laptop. I suspected some system configuration-related problem, but I had no idea. My problems are consistent with [issue #2618](https://github.com/huggingface/datasets/issues/2618). All the huggingface-related libraries I use are the latest versions.
[ -0.14756199717521667, -0.2995699346065521, -0.0653565526008606, 0.31419837474823, 0.33236753940582275, 0.08560382574796677, 0.4291490912437439, 0.07434698939323425, 0.1930258572101593, 0.11410294473171234, -0.14673036336898804, 0.46443212032318115, 0.2579030990600586, -0.08644133061170578, -0.21409069001674652, 0.07133369147777557, -0.15374550223350525, 0.10617315024137497, 0.03897786885499954, -0.045559726655483246, 0.0758349671959877, 0.15758033096790314, -0.283481627702713, 0.020882271230220795, 0.03708616644144058, -0.001890605315566063, 0.13906019926071167, -0.026892490684986115, -0.043990589678287506, -0.3760533332824707, 0.4784262180328369, 0.03980880603194237, 0.10186578333377838, 0.8280534744262695, -0.00012375821825116873, 0.08041734993457794, 0.5884152054786682, 0.04863269627094269, -0.47880837321281433, -0.27008670568466187, -0.15578703582286835, -0.42948222160339355, 0.21695563197135925, -0.08768706768751144, 0.023126736283302307, 0.03955814242362976, 0.007984669879078865, -0.4350268840789795, 0.35528743267059326, 0.29016414284706116, 0.09129959344863892, 0.03166916221380234, 0.07319514453411102, 0.08587704598903656, -0.01350221037864685, 0.21722231805324554, 0.01225481741130352, 0.3670719563961029, 0.4771384596824646, 0.1834782063961029, 0.3030875027179718, -0.20346447825431824, -0.2555580735206604, 0.09509250521659851, 0.03530731052160263, -0.08309346437454224, 0.1704246997833252, -0.2451888918876648, 0.40027326345443726, 0.27393287420272827, 0.7686863541603088, 0.007529702037572861, -0.15956151485443115, -0.19751521944999695, 0.13276837766170502, -0.12937790155410767, 0.16558529436588287, 0.14028246700763702, -0.2675146162509918, 0.19136492908000946, -0.08058757334947586, -0.001065738731995225, -0.27770256996154785, 0.06846296787261963, -0.21840065717697144, -0.280803382396698, -0.0537019819021225, 0.1772727370262146, -0.024858716875314713, -0.02612694352865219, 0.08065015822649002, -0.32605305314064026, 0.08579538762569427, 0.4067389667034149, -0.7832556962966919, 0.13611379265785217, 0.030283112078905106, 0.0000859573483467102, 0.2610495686531067, 0.15768161416053772, 0.15574167668819427, 0.03331049904227257, 0.06385856866836548, -0.005135808140039444, 0.3388919234275818, 0.17822860181331635, 0.007959946990013123, -0.11140874773263931, 0.4228983521461487, 0.029214000329375267, -0.10680238902568817, -0.04791522026062012, -0.18001703917980194, -0.1859087198972702, 0.4948347210884094, -0.14530077576637268, 0.23777665197849274, -0.31503981351852417, -0.21850495040416718, 0.07930101454257965, -0.1574152261018753, -0.01511208526790142, 0.05584695562720299, 0.5164162516593933, -0.345670223236084, 0.3366512060165405, 0.1619708389043808, -0.13369007408618927, -0.2913295030593872, -0.08446334302425385, 0.02393290214240551, -0.3231823742389679, -0.08020554482936859, -0.15184247493743896, 0.30344924330711365, -0.40496891736984253, -0.07215926796197891, 0.007687182165682316, 0.05000879615545273, -0.06870526075363159, 0.12046264111995697, -0.296517014503479, -0.13809683918952942, 0.2439594268798828, -0.04193419963121414, 0.26041102409362793, -0.021446581929922104, -0.24441561102867126, -0.018968723714351654, 0.42398756742477417, -0.3262426555156708, -0.05408423766493797, -0.08144380152225494, 0.10603557527065277, -0.015182830393314362, 0.12755605578422546, -0.411417156457901, -0.0372360460460186, -0.0014210715889930725, -0.12949082255363464, -0.05371396988630295, -0.07776572555303574, 0.14094987511634827, -0.10010458528995514, 0.34810468554496765, 0.3137204051017761, -0.5250808000564575, 0.13998408615589142, -0.43749821186065674, -0.0792233943939209, 0.22952362895011902, 0.18684424459934235, -0.17968042194843292, 0.3122308552265167, -0.3676093518733978, -0.06658966839313507, 0.2792798578739166, -0.16989703476428986, -0.6536527276039124, 0.47545549273490906, -0.32030189037323, 0.04723047465085983, -0.037807680666446686, 0.20811080932617188, 0.051852259784936905, -0.004260146524757147, 0.32945650815963745, 0.2083030641078949, 0.06910814344882965, -0.12840238213539124, -0.2383829802274704, -0.25940951704978943, 0.04954252764582634, 0.4234248101711273, -0.09152686595916748, 0.04527811333537102, 0.16986384987831116, 0.06094218045473099, 0.3191356360912323, 0.18148069083690643, -0.13296645879745483, 0.4863663911819458, 0.19693128764629364, 0.17065447568893433, 0.027730334550142288, 0.03488733619451523, -0.4840688705444336, 0.2070598602294922, -0.026043666526675224, -0.07545831799507141, -0.00713752955198288, -0.06580285727977753, -0.3515719473361969, 0.16082236170768738, -0.18293313682079315, 0.13161014020442963, -0.058573298156261444, 0.03322797641158104, 0.07216514647006989, 0.33924901485443115, -0.015438348054885864, 0.5650488138198853, -0.25436049699783325, 0.020959267392754555, -0.3576246201992035, 0.1781046837568283, 0.01383025012910366, 0.015149884857237339, -0.018109893426299095, -0.2818581759929657, 0.056803248822689056, -0.18974770605564117, -0.268172949552536, 0.07827740907669067, 0.02645184099674225, -0.041282474994659424, -0.36079248785972595, -0.28894805908203125, 0.02705584652721882, -0.039068855345249176, -0.007290991023182869, 0.35410022735595703, 0.4311226010322571, -0.2158794403076172, 0.08679250627756119, 0.026700980961322784, -0.3624246120452881, 0.4272853434085846, 0.07481610774993896, -0.3314993381500244, 0.26272234320640564, -0.11857450008392334, -0.07976316660642624, 0.24132591485977173, 0.6704699397087097, 0.0676475465297699, 0.3770867884159088, 0.14791221916675568, -0.14288648962974548, -0.1943265199661255, 0.5178008079528809, -0.18419933319091797, -0.08062107115983963, 0.3954070210456848, 0.047313474118709564, 0.11418423801660538, 0.028463095426559448, 0.016698244959115982, 0.46451812982559204, 0.18100999295711517, -0.21948358416557312, -0.02411067672073841, 0.281673789024353, -0.2495666891336441, 0.022940441966056824, 0.05419185012578964, -0.040566571056842804, 0.46552348136901855, 0.2352648228406906, -0.0312562994658947, 0.0006105490028858185, -0.3826003968715668, 0.14282731711864471, 0.29854652285575867, -0.06341217458248138, 0.20036181807518005, -0.40181905031204224, -0.04347209632396698, 0.23071901500225067, 0.1291397362947464, -0.13810202479362488, -0.14454340934753418, -0.33830076456069946, 0.20466087758541107, 0.42485812306404114, 0.26294317841529846, -0.08904463052749634, 0.09143474698066711, 0.09263424575328827, -0.3372781276702881, -0.246011421084404, -0.048465296626091, -0.4709993600845337, -0.13478843867778778, 0.37840303778648376, -0.0016846884973347187, 0.29870399832725525, -0.11603720486164093, -0.234195739030838, 0.08828860521316528, -0.11083395034074783, 0.029360055923461914, 0.15322017669677734, 0.344746857881546, 0.07942575216293335, 0.5676672458648682, -0.04440559819340706, 0.27355051040649414, 0.24267175793647766, -0.16614793241024017, -0.13948945701122284, 0.23836016654968262, -0.032650526612997055, 0.13928423821926117, 0.01740255579352379, -0.3209625780582428, -0.2567274868488312, -0.37672948837280273, 0.2944645583629608, -0.2688992917537689, 0.02011346071958542, 0.29028573632240295, 0.09893740713596344, 0.36163946986198425, 0.21879208087921143, 0.10703718662261963, -0.1275881975889206, -0.4673331081867218, 0.32085660099983215, 0.06556271761655807, -0.3119952082633972, -0.009376555681228638, 0.294352650642395, 0.10033953189849854, -0.04088583216071129, -0.5374166965484619, 0.08342333883047104, -0.49256646633148193, 0.10881419479846954, -0.3642776906490326, -0.07865653187036514, 0.23322229087352753, -0.3113851845264435, 0.05039535462856293, 0.0913776084780693, -0.24596789479255676, -0.018697917461395264, 0.040366314351558685, 0.1022227481007576, 0.28081437945365906, 0.5861592292785645, -0.11759054660797119, 0.34345394372940063, 0.28904950618743896, -0.1113666296005249, 0.23438672721385956, 0.08819349855184555, 0.2808306813240051, -0.4250522553920746, -0.4068979024887085, -0.2516186535358429, 0.19838754832744598, -0.1327836662530899, 0.0013649016618728638, -0.039240043610334396, -0.06804406642913818, -0.1968057006597519, -0.30485010147094727, -0.018140770494937897, -0.13691067695617676, 0.04634683579206467, -0.26728329062461853, -0.17720651626586914, 0.011736534535884857, -0.05058322101831436, -0.12934593856334686, -0.19541439414024353, -0.2013590931892395, 0.3096255660057068, 0.18669505417346954, -0.14182531833648682, -0.22736749053001404, -0.09904160350561142, -0.39430612325668335, 0.33654481172561646, -0.18966332077980042, 0.43215063214302063, -0.20643949508666992, 0.20712727308273315, 0.3475887179374695, -0.2820998728275299, 0.6598769426345825, -0.0805605873465538, 0.3348085880279541, 0.20435523986816406, 0.015070855617523193, -0.48171448707580566, 0.026628155261278152, 0.14627082645893097, 0.2199012041091919, 0.1353241354227066, 0.26050111651420593, -0.49152258038520813, -0.14013223350048065, -0.045114435255527496, 0.35974612832069397, -0.06620731949806213, -0.4381331503391266, -0.32462772727012634, -0.36435434222221375, -0.38030877709388733, -0.0707901194691658, -0.07795590907335281, 0.09101416170597076, 0.035235390067100525, -0.3288101851940155, -0.19814306497573853, 0.012730386108160019, -0.050938114523887634, -0.07166477292776108, -0.17157301306724548, -0.2440704107284546, 0.5125733017921448, -0.1256209909915924, 0.18814513087272644, 0.29707732796669006, 0.47556760907173157, -0.0244440995156765, -0.3974202275276184, 0.08360201865434647, -0.07162990421056747, 0.0606268085539341, 0.19636262953281403, -0.07904848456382751, 0.293417364358902, 0.039977435022592545, 0.3786969780921936, -0.03214054927229881, 0.00013478798791766167, 0.11415176093578339, 0.11657103151082993, -0.558554470539093, -0.43204396963119507, 0.14773830771446228, -0.0454491451382637, -0.010962508618831635, 0.5393624305725098, -0.17628790438175201, -0.015161082148551941, 0.23311688005924225, -0.3448255658149719, 0.9554377794265747, -0.22189591825008392, 0.05559755116701126, -0.10647290199995041, 0.02941734343767166, 0.2389659285545349, -0.18901662528514862, 0.045965902507305145, -0.21380481123924255, -0.16405165195465088, 0.053572915494441986, -0.20898392796516418, 0.18096964061260223, 0.2723594903945923, 0.08723922073841095, 0.22162479162216187, -0.3284206688404083, 0.23071952164173126, 0.025341695174574852, 0.4471805691719055, -0.1698957085609436, -0.03585042804479599, -0.5194597244262695, 0.02654704451560974, -0.11913806200027466, 0.06875979155302048, -0.000707017257809639, 0.1327541470527649, -0.22025610506534576, 0.012326981872320175, -0.17371337115764618, 0.08791802078485489, -0.22347497940063477, 0.05343705788254738, -0.35568249225616455, -0.633313775062561, 0.3397536873817444, 0.349176287651062, -0.16806422173976898, 0.3479357659816742, -0.017139555886387825, 0.322363018989563, -0.25171101093292236, -0.07651263475418091, -0.02184145525097847, -0.12786494195461273, -0.019676202908158302, -0.10734742879867554, -0.43838122487068176, 0.049491140991449356, -0.17352928221225739, -0.25038450956344604, 0.13329270482063293, 0.18047857284545898, 0.31606584787368774, 0.012458069249987602, -0.21124114096164703, -0.28569895029067993, 0.10759682953357697, -0.010817136615514755, 0.0418323390185833, 0.29788750410079956, 0.03975846990942955, 0.2669132351875305, 0.1109829694032669, -0.22194670140743256, -0.017123714089393616, 0.5728828310966492, -0.07916150242090225, -0.027912698686122894, 0.6649041175842285, 0.26792287826538086, -0.1384141445159912, -0.2283843755722046, 0.23382270336151123, -0.07310082018375397, -0.5962603688240051, 0.19566604495048523, -0.0224203709512949, 0.46563923358917236, 0.10623937100172043, -0.027257461100816727, -0.09597253799438477, -0.43287914991378784, -0.08363057672977448, -0.6366723775863647, -0.34940841794013977, -0.05741351842880249, 0.025471050292253494, 0.12531410157680511, 0.17513889074325562, -0.23246736824512482, -0.11015419661998749, -0.09707743674516678, -0.1376781016588211, 0.150198295712471, -0.2709207236766815, -0.09309391677379608, 0.15591932833194733, -0.05704586207866669, 0.19726970791816711, -0.28615719079971313, 0.048667751252651215, 0.16435900330543518, 0.16197587549686432, -0.15901458263397217, 0.04230492189526558, 0.22811582684516907, -0.0007025133818387985, 0.01833907514810562, 0.011892885901033878, -0.7463324069976807, -0.265785276889801, -0.07899288088083267, 0.18060339987277985, 0.1329132318496704, 0.06434297561645508, -0.19072085618972778, -0.14010347425937653, 0.10891135036945343, -0.3651726245880127, 0.4115532636642456, -0.15696361660957336, 0.10463712364435196, 0.2865174114704132, 0.09398601949214935, 0.30518585443496704, 0.1926060914993286, -0.5772462487220764, 0.0446522980928421, 0.25498896837234497, -0.06436599045991898, 0.39617544412612915, -0.521146833896637, 0.17091479897499084, -0.020631060004234314, 0.16048093140125275, 0.3715542256832123, -0.21397225558757782, -0.012139791622757912, 0.3651035726070404, 0.039951130747795105, -0.1631409227848053, -0.11998256295919418, 0.2417137622833252, -0.05226154625415802, -0.09099028259515762, 0.008701488375663757, -0.34139493107795715, -0.023440662771463394, -0.10255773365497589, 0.11860350519418716, 0.5501222610473633, 0.0375334694981575, -0.0773211419582367, 0.514103353023529, 0.2463444322347641, 0.08411307632923126, 0.1213693767786026, 0.22227300703525543, 0.11915237456560135, 0.49250155687332153, -0.054757095873355865, 0.1569666713476181, -0.26011836528778076, 0.6130087971687317, -0.293676495552063, -0.6449798941612244, -0.006450075656175613, 0.4330599308013916, -0.3199162185192108, 0.019298594444990158, 0.13427764177322388, 0.19593317806720734, -0.018950358033180237, -0.05096309632062912, -0.19327275454998016, 0.07943595945835114, -0.038266152143478394, 0.08367450535297394, -0.0796862468123436, -0.015339978039264679, 0.11334706842899323, -0.060385964810848236, -0.024330582469701767, 0.2194375842809677, -0.1739778220653534, 0.2462838739156723, 0.01856643706560135, -0.4862477779388428, 0.04395106062293053, 0.27250242233276367, 0.08061250299215317, -0.0020288564264774323, 0.020942777395248413, 0.025240153074264526, 0.07943247258663177, 0.09207916259765625, -0.00848529301583767, 0.17573711276054382, 0.2830060124397278, 0.0104023152962327, 0.1338217407464981, 0.0929168313741684, -0.11335054785013199, -0.022985417395830154, 0.549501895904541, 0.12064985930919647, 0.12073557078838348, 0.1538299173116684, 0.007887693122029305, -0.09923069179058075, -0.09548267722129822, 0.2025635987520218, -0.0021281056106090546, -0.43780335783958435, 0.20901748538017273, -0.0668276771903038, -0.23699739575386047, -0.4171280860900879, 0.03724119812250137, -0.19707870483398438, -0.014887806959450245, 0.39639368653297424, 0.06117821857333183, 0.0039176661521196365, -0.23815946280956268, 0.019820354878902435, -0.5056633353233337, 0.2021569162607193, 0.255349725484848, 0.41554558277130127, -0.09738849103450775, -0.0015716329216957092, -0.7462612986564636, 0.01747530698776245, -0.06759652495384216, 0.03142719715833664, 0.19182004034519196, -0.06976527720689774, 0.03682664781808853, 0.011216778308153152, 0.4993739724159241, -0.027098100632429123, 0.09059867262840271, 0.4497200548648834, -0.20391367375850677, -0.39025649428367615, -0.136851966381073, 0.082676462829113, -0.215025395154953, -0.4896925985813141, 0.04883141815662384, -0.010604845359921455, -0.07951744645833969, -0.2879243493080139, 0.09391817450523376, 0.17607006430625916, 0.08227121829986572, 0.39898356795310974, 0.06623358279466629, 0.5405977964401245, 0.2156977653503418, -0.12622126936912537, 0.11104851961135864, 0.15623104572296143, 0.129463329911232, 0.22703734040260315, 0.21757766604423523, -0.055619560182094574, -0.2633456289768219, -0.11211684346199036, -0.18947428464889526, 0.015730757266283035, -0.31365966796875, 0.029490044340491295, -0.23108893632888794, -0.11218072474002838, 0.04490720480680466, 0.2746727466583252, -0.07003086805343628, 0.11878283321857452, 0.02889440581202507, 0.09179265797138214, -0.3649129271507263, 0.08666079491376877, 0.27735456824302673, -0.16228407621383667, -0.3062392473220825, 0.23320603370666504, 0.23558026552200317, -0.37375855445861816, 0.06525007635354996, -0.05757562816143036, 0.09475786238908768, 0.47659212350845337, -0.12492737919092178, -0.24352942407131195, 0.3183234930038452, -0.09417065978050232, 0.19253087043762207, -0.09821067750453949, 0.43771255016326904, 0.010331802070140839, 0.08201025426387787, 0.08377249538898468, -0.013787619769573212 ]
https://github.com/huggingface/datasets/issues/6505
Got stuck when I trying to load a dataset
> I ran into the same problem when I used a server cluster (Slurm system managed) that couldn't load any of the huggingface datasets or models, but it worked on my laptop. I suspected some system configuration-related problem, but I had no idea. My problems are consistent with [issue #2618](https://github.com/huggingface/datasets/issues/2618). All the huggingface-related libraries I use are the latest versions. have you solved this issue yet? i met the same problem on server but everything works on laptop. I think maybe the filelock repo is contradictory with file system.
### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0
89
Got stuck when I trying to load a dataset ### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0 > I ran into the same problem when I used a server cluster (Slurm system managed) that couldn't load any of the huggingface datasets or models, but it worked on my laptop. I suspected some system configuration-related problem, but I had no idea. My problems are consistent with [issue #2618](https://github.com/huggingface/datasets/issues/2618). All the huggingface-related libraries I use are the latest versions. have you solved this issue yet? i met the same problem on server but everything works on laptop. I think maybe the filelock repo is contradictory with file system.
[ -0.14756199717521667, -0.2995699346065521, -0.0653565526008606, 0.31419837474823, 0.33236753940582275, 0.08560382574796677, 0.4291490912437439, 0.07434698939323425, 0.1930258572101593, 0.11410294473171234, -0.14673036336898804, 0.46443212032318115, 0.2579030990600586, -0.08644133061170578, -0.21409069001674652, 0.07133369147777557, -0.15374550223350525, 0.10617315024137497, 0.03897786885499954, -0.045559726655483246, 0.0758349671959877, 0.15758033096790314, -0.283481627702713, 0.020882271230220795, 0.03708616644144058, -0.001890605315566063, 0.13906019926071167, -0.026892490684986115, -0.043990589678287506, -0.3760533332824707, 0.4784262180328369, 0.03980880603194237, 0.10186578333377838, 0.8280534744262695, -0.00012375821825116873, 0.08041734993457794, 0.5884152054786682, 0.04863269627094269, -0.47880837321281433, -0.27008670568466187, -0.15578703582286835, -0.42948222160339355, 0.21695563197135925, -0.08768706768751144, 0.023126736283302307, 0.03955814242362976, 0.007984669879078865, -0.4350268840789795, 0.35528743267059326, 0.29016414284706116, 0.09129959344863892, 0.03166916221380234, 0.07319514453411102, 0.08587704598903656, -0.01350221037864685, 0.21722231805324554, 0.01225481741130352, 0.3670719563961029, 0.4771384596824646, 0.1834782063961029, 0.3030875027179718, -0.20346447825431824, -0.2555580735206604, 0.09509250521659851, 0.03530731052160263, -0.08309346437454224, 0.1704246997833252, -0.2451888918876648, 0.40027326345443726, 0.27393287420272827, 0.7686863541603088, 0.007529702037572861, -0.15956151485443115, -0.19751521944999695, 0.13276837766170502, -0.12937790155410767, 0.16558529436588287, 0.14028246700763702, -0.2675146162509918, 0.19136492908000946, -0.08058757334947586, -0.001065738731995225, -0.27770256996154785, 0.06846296787261963, -0.21840065717697144, -0.280803382396698, -0.0537019819021225, 0.1772727370262146, -0.024858716875314713, -0.02612694352865219, 0.08065015822649002, -0.32605305314064026, 0.08579538762569427, 0.4067389667034149, -0.7832556962966919, 0.13611379265785217, 0.030283112078905106, 0.0000859573483467102, 0.2610495686531067, 0.15768161416053772, 0.15574167668819427, 0.03331049904227257, 0.06385856866836548, -0.005135808140039444, 0.3388919234275818, 0.17822860181331635, 0.007959946990013123, -0.11140874773263931, 0.4228983521461487, 0.029214000329375267, -0.10680238902568817, -0.04791522026062012, -0.18001703917980194, -0.1859087198972702, 0.4948347210884094, -0.14530077576637268, 0.23777665197849274, -0.31503981351852417, -0.21850495040416718, 0.07930101454257965, -0.1574152261018753, -0.01511208526790142, 0.05584695562720299, 0.5164162516593933, -0.345670223236084, 0.3366512060165405, 0.1619708389043808, -0.13369007408618927, -0.2913295030593872, -0.08446334302425385, 0.02393290214240551, -0.3231823742389679, -0.08020554482936859, -0.15184247493743896, 0.30344924330711365, -0.40496891736984253, -0.07215926796197891, 0.007687182165682316, 0.05000879615545273, -0.06870526075363159, 0.12046264111995697, -0.296517014503479, -0.13809683918952942, 0.2439594268798828, -0.04193419963121414, 0.26041102409362793, -0.021446581929922104, -0.24441561102867126, -0.018968723714351654, 0.42398756742477417, -0.3262426555156708, -0.05408423766493797, -0.08144380152225494, 0.10603557527065277, -0.015182830393314362, 0.12755605578422546, -0.411417156457901, -0.0372360460460186, -0.0014210715889930725, -0.12949082255363464, -0.05371396988630295, -0.07776572555303574, 0.14094987511634827, -0.10010458528995514, 0.34810468554496765, 0.3137204051017761, -0.5250808000564575, 0.13998408615589142, -0.43749821186065674, -0.0792233943939209, 0.22952362895011902, 0.18684424459934235, -0.17968042194843292, 0.3122308552265167, -0.3676093518733978, -0.06658966839313507, 0.2792798578739166, -0.16989703476428986, -0.6536527276039124, 0.47545549273490906, -0.32030189037323, 0.04723047465085983, -0.037807680666446686, 0.20811080932617188, 0.051852259784936905, -0.004260146524757147, 0.32945650815963745, 0.2083030641078949, 0.06910814344882965, -0.12840238213539124, -0.2383829802274704, -0.25940951704978943, 0.04954252764582634, 0.4234248101711273, -0.09152686595916748, 0.04527811333537102, 0.16986384987831116, 0.06094218045473099, 0.3191356360912323, 0.18148069083690643, -0.13296645879745483, 0.4863663911819458, 0.19693128764629364, 0.17065447568893433, 0.027730334550142288, 0.03488733619451523, -0.4840688705444336, 0.2070598602294922, -0.026043666526675224, -0.07545831799507141, -0.00713752955198288, -0.06580285727977753, -0.3515719473361969, 0.16082236170768738, -0.18293313682079315, 0.13161014020442963, -0.058573298156261444, 0.03322797641158104, 0.07216514647006989, 0.33924901485443115, -0.015438348054885864, 0.5650488138198853, -0.25436049699783325, 0.020959267392754555, -0.3576246201992035, 0.1781046837568283, 0.01383025012910366, 0.015149884857237339, -0.018109893426299095, -0.2818581759929657, 0.056803248822689056, -0.18974770605564117, -0.268172949552536, 0.07827740907669067, 0.02645184099674225, -0.041282474994659424, -0.36079248785972595, -0.28894805908203125, 0.02705584652721882, -0.039068855345249176, -0.007290991023182869, 0.35410022735595703, 0.4311226010322571, -0.2158794403076172, 0.08679250627756119, 0.026700980961322784, -0.3624246120452881, 0.4272853434085846, 0.07481610774993896, -0.3314993381500244, 0.26272234320640564, -0.11857450008392334, -0.07976316660642624, 0.24132591485977173, 0.6704699397087097, 0.0676475465297699, 0.3770867884159088, 0.14791221916675568, -0.14288648962974548, -0.1943265199661255, 0.5178008079528809, -0.18419933319091797, -0.08062107115983963, 0.3954070210456848, 0.047313474118709564, 0.11418423801660538, 0.028463095426559448, 0.016698244959115982, 0.46451812982559204, 0.18100999295711517, -0.21948358416557312, -0.02411067672073841, 0.281673789024353, -0.2495666891336441, 0.022940441966056824, 0.05419185012578964, -0.040566571056842804, 0.46552348136901855, 0.2352648228406906, -0.0312562994658947, 0.0006105490028858185, -0.3826003968715668, 0.14282731711864471, 0.29854652285575867, -0.06341217458248138, 0.20036181807518005, -0.40181905031204224, -0.04347209632396698, 0.23071901500225067, 0.1291397362947464, -0.13810202479362488, -0.14454340934753418, -0.33830076456069946, 0.20466087758541107, 0.42485812306404114, 0.26294317841529846, -0.08904463052749634, 0.09143474698066711, 0.09263424575328827, -0.3372781276702881, -0.246011421084404, -0.048465296626091, -0.4709993600845337, -0.13478843867778778, 0.37840303778648376, -0.0016846884973347187, 0.29870399832725525, -0.11603720486164093, -0.234195739030838, 0.08828860521316528, -0.11083395034074783, 0.029360055923461914, 0.15322017669677734, 0.344746857881546, 0.07942575216293335, 0.5676672458648682, -0.04440559819340706, 0.27355051040649414, 0.24267175793647766, -0.16614793241024017, -0.13948945701122284, 0.23836016654968262, -0.032650526612997055, 0.13928423821926117, 0.01740255579352379, -0.3209625780582428, -0.2567274868488312, -0.37672948837280273, 0.2944645583629608, -0.2688992917537689, 0.02011346071958542, 0.29028573632240295, 0.09893740713596344, 0.36163946986198425, 0.21879208087921143, 0.10703718662261963, -0.1275881975889206, -0.4673331081867218, 0.32085660099983215, 0.06556271761655807, -0.3119952082633972, -0.009376555681228638, 0.294352650642395, 0.10033953189849854, -0.04088583216071129, -0.5374166965484619, 0.08342333883047104, -0.49256646633148193, 0.10881419479846954, -0.3642776906490326, -0.07865653187036514, 0.23322229087352753, -0.3113851845264435, 0.05039535462856293, 0.0913776084780693, -0.24596789479255676, -0.018697917461395264, 0.040366314351558685, 0.1022227481007576, 0.28081437945365906, 0.5861592292785645, -0.11759054660797119, 0.34345394372940063, 0.28904950618743896, -0.1113666296005249, 0.23438672721385956, 0.08819349855184555, 0.2808306813240051, -0.4250522553920746, -0.4068979024887085, -0.2516186535358429, 0.19838754832744598, -0.1327836662530899, 0.0013649016618728638, -0.039240043610334396, -0.06804406642913818, -0.1968057006597519, -0.30485010147094727, -0.018140770494937897, -0.13691067695617676, 0.04634683579206467, -0.26728329062461853, -0.17720651626586914, 0.011736534535884857, -0.05058322101831436, -0.12934593856334686, -0.19541439414024353, -0.2013590931892395, 0.3096255660057068, 0.18669505417346954, -0.14182531833648682, -0.22736749053001404, -0.09904160350561142, -0.39430612325668335, 0.33654481172561646, -0.18966332077980042, 0.43215063214302063, -0.20643949508666992, 0.20712727308273315, 0.3475887179374695, -0.2820998728275299, 0.6598769426345825, -0.0805605873465538, 0.3348085880279541, 0.20435523986816406, 0.015070855617523193, -0.48171448707580566, 0.026628155261278152, 0.14627082645893097, 0.2199012041091919, 0.1353241354227066, 0.26050111651420593, -0.49152258038520813, -0.14013223350048065, -0.045114435255527496, 0.35974612832069397, -0.06620731949806213, -0.4381331503391266, -0.32462772727012634, -0.36435434222221375, -0.38030877709388733, -0.0707901194691658, -0.07795590907335281, 0.09101416170597076, 0.035235390067100525, -0.3288101851940155, -0.19814306497573853, 0.012730386108160019, -0.050938114523887634, -0.07166477292776108, -0.17157301306724548, -0.2440704107284546, 0.5125733017921448, -0.1256209909915924, 0.18814513087272644, 0.29707732796669006, 0.47556760907173157, -0.0244440995156765, -0.3974202275276184, 0.08360201865434647, -0.07162990421056747, 0.0606268085539341, 0.19636262953281403, -0.07904848456382751, 0.293417364358902, 0.039977435022592545, 0.3786969780921936, -0.03214054927229881, 0.00013478798791766167, 0.11415176093578339, 0.11657103151082993, -0.558554470539093, -0.43204396963119507, 0.14773830771446228, -0.0454491451382637, -0.010962508618831635, 0.5393624305725098, -0.17628790438175201, -0.015161082148551941, 0.23311688005924225, -0.3448255658149719, 0.9554377794265747, -0.22189591825008392, 0.05559755116701126, -0.10647290199995041, 0.02941734343767166, 0.2389659285545349, -0.18901662528514862, 0.045965902507305145, -0.21380481123924255, -0.16405165195465088, 0.053572915494441986, -0.20898392796516418, 0.18096964061260223, 0.2723594903945923, 0.08723922073841095, 0.22162479162216187, -0.3284206688404083, 0.23071952164173126, 0.025341695174574852, 0.4471805691719055, -0.1698957085609436, -0.03585042804479599, -0.5194597244262695, 0.02654704451560974, -0.11913806200027466, 0.06875979155302048, -0.000707017257809639, 0.1327541470527649, -0.22025610506534576, 0.012326981872320175, -0.17371337115764618, 0.08791802078485489, -0.22347497940063477, 0.05343705788254738, -0.35568249225616455, -0.633313775062561, 0.3397536873817444, 0.349176287651062, -0.16806422173976898, 0.3479357659816742, -0.017139555886387825, 0.322363018989563, -0.25171101093292236, -0.07651263475418091, -0.02184145525097847, -0.12786494195461273, -0.019676202908158302, -0.10734742879867554, -0.43838122487068176, 0.049491140991449356, -0.17352928221225739, -0.25038450956344604, 0.13329270482063293, 0.18047857284545898, 0.31606584787368774, 0.012458069249987602, -0.21124114096164703, -0.28569895029067993, 0.10759682953357697, -0.010817136615514755, 0.0418323390185833, 0.29788750410079956, 0.03975846990942955, 0.2669132351875305, 0.1109829694032669, -0.22194670140743256, -0.017123714089393616, 0.5728828310966492, -0.07916150242090225, -0.027912698686122894, 0.6649041175842285, 0.26792287826538086, -0.1384141445159912, -0.2283843755722046, 0.23382270336151123, -0.07310082018375397, -0.5962603688240051, 0.19566604495048523, -0.0224203709512949, 0.46563923358917236, 0.10623937100172043, -0.027257461100816727, -0.09597253799438477, -0.43287914991378784, -0.08363057672977448, -0.6366723775863647, -0.34940841794013977, -0.05741351842880249, 0.025471050292253494, 0.12531410157680511, 0.17513889074325562, -0.23246736824512482, -0.11015419661998749, -0.09707743674516678, -0.1376781016588211, 0.150198295712471, -0.2709207236766815, -0.09309391677379608, 0.15591932833194733, -0.05704586207866669, 0.19726970791816711, -0.28615719079971313, 0.048667751252651215, 0.16435900330543518, 0.16197587549686432, -0.15901458263397217, 0.04230492189526558, 0.22811582684516907, -0.0007025133818387985, 0.01833907514810562, 0.011892885901033878, -0.7463324069976807, -0.265785276889801, -0.07899288088083267, 0.18060339987277985, 0.1329132318496704, 0.06434297561645508, -0.19072085618972778, -0.14010347425937653, 0.10891135036945343, -0.3651726245880127, 0.4115532636642456, -0.15696361660957336, 0.10463712364435196, 0.2865174114704132, 0.09398601949214935, 0.30518585443496704, 0.1926060914993286, -0.5772462487220764, 0.0446522980928421, 0.25498896837234497, -0.06436599045991898, 0.39617544412612915, -0.521146833896637, 0.17091479897499084, -0.020631060004234314, 0.16048093140125275, 0.3715542256832123, -0.21397225558757782, -0.012139791622757912, 0.3651035726070404, 0.039951130747795105, -0.1631409227848053, -0.11998256295919418, 0.2417137622833252, -0.05226154625415802, -0.09099028259515762, 0.008701488375663757, -0.34139493107795715, -0.023440662771463394, -0.10255773365497589, 0.11860350519418716, 0.5501222610473633, 0.0375334694981575, -0.0773211419582367, 0.514103353023529, 0.2463444322347641, 0.08411307632923126, 0.1213693767786026, 0.22227300703525543, 0.11915237456560135, 0.49250155687332153, -0.054757095873355865, 0.1569666713476181, -0.26011836528778076, 0.6130087971687317, -0.293676495552063, -0.6449798941612244, -0.006450075656175613, 0.4330599308013916, -0.3199162185192108, 0.019298594444990158, 0.13427764177322388, 0.19593317806720734, -0.018950358033180237, -0.05096309632062912, -0.19327275454998016, 0.07943595945835114, -0.038266152143478394, 0.08367450535297394, -0.0796862468123436, -0.015339978039264679, 0.11334706842899323, -0.060385964810848236, -0.024330582469701767, 0.2194375842809677, -0.1739778220653534, 0.2462838739156723, 0.01856643706560135, -0.4862477779388428, 0.04395106062293053, 0.27250242233276367, 0.08061250299215317, -0.0020288564264774323, 0.020942777395248413, 0.025240153074264526, 0.07943247258663177, 0.09207916259765625, -0.00848529301583767, 0.17573711276054382, 0.2830060124397278, 0.0104023152962327, 0.1338217407464981, 0.0929168313741684, -0.11335054785013199, -0.022985417395830154, 0.549501895904541, 0.12064985930919647, 0.12073557078838348, 0.1538299173116684, 0.007887693122029305, -0.09923069179058075, -0.09548267722129822, 0.2025635987520218, -0.0021281056106090546, -0.43780335783958435, 0.20901748538017273, -0.0668276771903038, -0.23699739575386047, -0.4171280860900879, 0.03724119812250137, -0.19707870483398438, -0.014887806959450245, 0.39639368653297424, 0.06117821857333183, 0.0039176661521196365, -0.23815946280956268, 0.019820354878902435, -0.5056633353233337, 0.2021569162607193, 0.255349725484848, 0.41554558277130127, -0.09738849103450775, -0.0015716329216957092, -0.7462612986564636, 0.01747530698776245, -0.06759652495384216, 0.03142719715833664, 0.19182004034519196, -0.06976527720689774, 0.03682664781808853, 0.011216778308153152, 0.4993739724159241, -0.027098100632429123, 0.09059867262840271, 0.4497200548648834, -0.20391367375850677, -0.39025649428367615, -0.136851966381073, 0.082676462829113, -0.215025395154953, -0.4896925985813141, 0.04883141815662384, -0.010604845359921455, -0.07951744645833969, -0.2879243493080139, 0.09391817450523376, 0.17607006430625916, 0.08227121829986572, 0.39898356795310974, 0.06623358279466629, 0.5405977964401245, 0.2156977653503418, -0.12622126936912537, 0.11104851961135864, 0.15623104572296143, 0.129463329911232, 0.22703734040260315, 0.21757766604423523, -0.055619560182094574, -0.2633456289768219, -0.11211684346199036, -0.18947428464889526, 0.015730757266283035, -0.31365966796875, 0.029490044340491295, -0.23108893632888794, -0.11218072474002838, 0.04490720480680466, 0.2746727466583252, -0.07003086805343628, 0.11878283321857452, 0.02889440581202507, 0.09179265797138214, -0.3649129271507263, 0.08666079491376877, 0.27735456824302673, -0.16228407621383667, -0.3062392473220825, 0.23320603370666504, 0.23558026552200317, -0.37375855445861816, 0.06525007635354996, -0.05757562816143036, 0.09475786238908768, 0.47659212350845337, -0.12492737919092178, -0.24352942407131195, 0.3183234930038452, -0.09417065978050232, 0.19253087043762207, -0.09821067750453949, 0.43771255016326904, 0.010331802070140839, 0.08201025426387787, 0.08377249538898468, -0.013787619769573212 ]
https://github.com/huggingface/datasets/issues/6505
Got stuck when I trying to load a dataset
I am having the same issue on a computing cluster but this works on my laptop as well. I instead have this error: `/home/.conda/envs/py10/lib/python3.10/site-packages/filelock/_unix.py", line 43, in _acquire fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) OSError: [Errno 5] Input/output error` the load_dataset command does not work on server for local or hosted hugging-face datasets, and I have tried for several files
### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0
58
Got stuck when I trying to load a dataset ### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0 I am having the same issue on a computing cluster but this works on my laptop as well. I instead have this error: `/home/.conda/envs/py10/lib/python3.10/site-packages/filelock/_unix.py", line 43, in _acquire fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) OSError: [Errno 5] Input/output error` the load_dataset command does not work on server for local or hosted hugging-face datasets, and I have tried for several files
[ -0.14756199717521667, -0.2995699346065521, -0.0653565526008606, 0.31419837474823, 0.33236753940582275, 0.08560382574796677, 0.4291490912437439, 0.07434698939323425, 0.1930258572101593, 0.11410294473171234, -0.14673036336898804, 0.46443212032318115, 0.2579030990600586, -0.08644133061170578, -0.21409069001674652, 0.07133369147777557, -0.15374550223350525, 0.10617315024137497, 0.03897786885499954, -0.045559726655483246, 0.0758349671959877, 0.15758033096790314, -0.283481627702713, 0.020882271230220795, 0.03708616644144058, -0.001890605315566063, 0.13906019926071167, -0.026892490684986115, -0.043990589678287506, -0.3760533332824707, 0.4784262180328369, 0.03980880603194237, 0.10186578333377838, 0.8280534744262695, -0.00012375821825116873, 0.08041734993457794, 0.5884152054786682, 0.04863269627094269, -0.47880837321281433, -0.27008670568466187, -0.15578703582286835, -0.42948222160339355, 0.21695563197135925, -0.08768706768751144, 0.023126736283302307, 0.03955814242362976, 0.007984669879078865, -0.4350268840789795, 0.35528743267059326, 0.29016414284706116, 0.09129959344863892, 0.03166916221380234, 0.07319514453411102, 0.08587704598903656, -0.01350221037864685, 0.21722231805324554, 0.01225481741130352, 0.3670719563961029, 0.4771384596824646, 0.1834782063961029, 0.3030875027179718, -0.20346447825431824, -0.2555580735206604, 0.09509250521659851, 0.03530731052160263, -0.08309346437454224, 0.1704246997833252, -0.2451888918876648, 0.40027326345443726, 0.27393287420272827, 0.7686863541603088, 0.007529702037572861, -0.15956151485443115, -0.19751521944999695, 0.13276837766170502, -0.12937790155410767, 0.16558529436588287, 0.14028246700763702, -0.2675146162509918, 0.19136492908000946, -0.08058757334947586, -0.001065738731995225, -0.27770256996154785, 0.06846296787261963, -0.21840065717697144, -0.280803382396698, -0.0537019819021225, 0.1772727370262146, -0.024858716875314713, -0.02612694352865219, 0.08065015822649002, -0.32605305314064026, 0.08579538762569427, 0.4067389667034149, -0.7832556962966919, 0.13611379265785217, 0.030283112078905106, 0.0000859573483467102, 0.2610495686531067, 0.15768161416053772, 0.15574167668819427, 0.03331049904227257, 0.06385856866836548, -0.005135808140039444, 0.3388919234275818, 0.17822860181331635, 0.007959946990013123, -0.11140874773263931, 0.4228983521461487, 0.029214000329375267, -0.10680238902568817, -0.04791522026062012, -0.18001703917980194, -0.1859087198972702, 0.4948347210884094, -0.14530077576637268, 0.23777665197849274, -0.31503981351852417, -0.21850495040416718, 0.07930101454257965, -0.1574152261018753, -0.01511208526790142, 0.05584695562720299, 0.5164162516593933, -0.345670223236084, 0.3366512060165405, 0.1619708389043808, -0.13369007408618927, -0.2913295030593872, -0.08446334302425385, 0.02393290214240551, -0.3231823742389679, -0.08020554482936859, -0.15184247493743896, 0.30344924330711365, -0.40496891736984253, -0.07215926796197891, 0.007687182165682316, 0.05000879615545273, -0.06870526075363159, 0.12046264111995697, -0.296517014503479, -0.13809683918952942, 0.2439594268798828, -0.04193419963121414, 0.26041102409362793, -0.021446581929922104, -0.24441561102867126, -0.018968723714351654, 0.42398756742477417, -0.3262426555156708, -0.05408423766493797, -0.08144380152225494, 0.10603557527065277, -0.015182830393314362, 0.12755605578422546, -0.411417156457901, -0.0372360460460186, -0.0014210715889930725, -0.12949082255363464, -0.05371396988630295, -0.07776572555303574, 0.14094987511634827, -0.10010458528995514, 0.34810468554496765, 0.3137204051017761, -0.5250808000564575, 0.13998408615589142, -0.43749821186065674, -0.0792233943939209, 0.22952362895011902, 0.18684424459934235, -0.17968042194843292, 0.3122308552265167, -0.3676093518733978, -0.06658966839313507, 0.2792798578739166, -0.16989703476428986, -0.6536527276039124, 0.47545549273490906, -0.32030189037323, 0.04723047465085983, -0.037807680666446686, 0.20811080932617188, 0.051852259784936905, -0.004260146524757147, 0.32945650815963745, 0.2083030641078949, 0.06910814344882965, -0.12840238213539124, -0.2383829802274704, -0.25940951704978943, 0.04954252764582634, 0.4234248101711273, -0.09152686595916748, 0.04527811333537102, 0.16986384987831116, 0.06094218045473099, 0.3191356360912323, 0.18148069083690643, -0.13296645879745483, 0.4863663911819458, 0.19693128764629364, 0.17065447568893433, 0.027730334550142288, 0.03488733619451523, -0.4840688705444336, 0.2070598602294922, -0.026043666526675224, -0.07545831799507141, -0.00713752955198288, -0.06580285727977753, -0.3515719473361969, 0.16082236170768738, -0.18293313682079315, 0.13161014020442963, -0.058573298156261444, 0.03322797641158104, 0.07216514647006989, 0.33924901485443115, -0.015438348054885864, 0.5650488138198853, -0.25436049699783325, 0.020959267392754555, -0.3576246201992035, 0.1781046837568283, 0.01383025012910366, 0.015149884857237339, -0.018109893426299095, -0.2818581759929657, 0.056803248822689056, -0.18974770605564117, -0.268172949552536, 0.07827740907669067, 0.02645184099674225, -0.041282474994659424, -0.36079248785972595, -0.28894805908203125, 0.02705584652721882, -0.039068855345249176, -0.007290991023182869, 0.35410022735595703, 0.4311226010322571, -0.2158794403076172, 0.08679250627756119, 0.026700980961322784, -0.3624246120452881, 0.4272853434085846, 0.07481610774993896, -0.3314993381500244, 0.26272234320640564, -0.11857450008392334, -0.07976316660642624, 0.24132591485977173, 0.6704699397087097, 0.0676475465297699, 0.3770867884159088, 0.14791221916675568, -0.14288648962974548, -0.1943265199661255, 0.5178008079528809, -0.18419933319091797, -0.08062107115983963, 0.3954070210456848, 0.047313474118709564, 0.11418423801660538, 0.028463095426559448, 0.016698244959115982, 0.46451812982559204, 0.18100999295711517, -0.21948358416557312, -0.02411067672073841, 0.281673789024353, -0.2495666891336441, 0.022940441966056824, 0.05419185012578964, -0.040566571056842804, 0.46552348136901855, 0.2352648228406906, -0.0312562994658947, 0.0006105490028858185, -0.3826003968715668, 0.14282731711864471, 0.29854652285575867, -0.06341217458248138, 0.20036181807518005, -0.40181905031204224, -0.04347209632396698, 0.23071901500225067, 0.1291397362947464, -0.13810202479362488, -0.14454340934753418, -0.33830076456069946, 0.20466087758541107, 0.42485812306404114, 0.26294317841529846, -0.08904463052749634, 0.09143474698066711, 0.09263424575328827, -0.3372781276702881, -0.246011421084404, -0.048465296626091, -0.4709993600845337, -0.13478843867778778, 0.37840303778648376, -0.0016846884973347187, 0.29870399832725525, -0.11603720486164093, -0.234195739030838, 0.08828860521316528, -0.11083395034074783, 0.029360055923461914, 0.15322017669677734, 0.344746857881546, 0.07942575216293335, 0.5676672458648682, -0.04440559819340706, 0.27355051040649414, 0.24267175793647766, -0.16614793241024017, -0.13948945701122284, 0.23836016654968262, -0.032650526612997055, 0.13928423821926117, 0.01740255579352379, -0.3209625780582428, -0.2567274868488312, -0.37672948837280273, 0.2944645583629608, -0.2688992917537689, 0.02011346071958542, 0.29028573632240295, 0.09893740713596344, 0.36163946986198425, 0.21879208087921143, 0.10703718662261963, -0.1275881975889206, -0.4673331081867218, 0.32085660099983215, 0.06556271761655807, -0.3119952082633972, -0.009376555681228638, 0.294352650642395, 0.10033953189849854, -0.04088583216071129, -0.5374166965484619, 0.08342333883047104, -0.49256646633148193, 0.10881419479846954, -0.3642776906490326, -0.07865653187036514, 0.23322229087352753, -0.3113851845264435, 0.05039535462856293, 0.0913776084780693, -0.24596789479255676, -0.018697917461395264, 0.040366314351558685, 0.1022227481007576, 0.28081437945365906, 0.5861592292785645, -0.11759054660797119, 0.34345394372940063, 0.28904950618743896, -0.1113666296005249, 0.23438672721385956, 0.08819349855184555, 0.2808306813240051, -0.4250522553920746, -0.4068979024887085, -0.2516186535358429, 0.19838754832744598, -0.1327836662530899, 0.0013649016618728638, -0.039240043610334396, -0.06804406642913818, -0.1968057006597519, -0.30485010147094727, -0.018140770494937897, -0.13691067695617676, 0.04634683579206467, -0.26728329062461853, -0.17720651626586914, 0.011736534535884857, -0.05058322101831436, -0.12934593856334686, -0.19541439414024353, -0.2013590931892395, 0.3096255660057068, 0.18669505417346954, -0.14182531833648682, -0.22736749053001404, -0.09904160350561142, -0.39430612325668335, 0.33654481172561646, -0.18966332077980042, 0.43215063214302063, -0.20643949508666992, 0.20712727308273315, 0.3475887179374695, -0.2820998728275299, 0.6598769426345825, -0.0805605873465538, 0.3348085880279541, 0.20435523986816406, 0.015070855617523193, -0.48171448707580566, 0.026628155261278152, 0.14627082645893097, 0.2199012041091919, 0.1353241354227066, 0.26050111651420593, -0.49152258038520813, -0.14013223350048065, -0.045114435255527496, 0.35974612832069397, -0.06620731949806213, -0.4381331503391266, -0.32462772727012634, -0.36435434222221375, -0.38030877709388733, -0.0707901194691658, -0.07795590907335281, 0.09101416170597076, 0.035235390067100525, -0.3288101851940155, -0.19814306497573853, 0.012730386108160019, -0.050938114523887634, -0.07166477292776108, -0.17157301306724548, -0.2440704107284546, 0.5125733017921448, -0.1256209909915924, 0.18814513087272644, 0.29707732796669006, 0.47556760907173157, -0.0244440995156765, -0.3974202275276184, 0.08360201865434647, -0.07162990421056747, 0.0606268085539341, 0.19636262953281403, -0.07904848456382751, 0.293417364358902, 0.039977435022592545, 0.3786969780921936, -0.03214054927229881, 0.00013478798791766167, 0.11415176093578339, 0.11657103151082993, -0.558554470539093, -0.43204396963119507, 0.14773830771446228, -0.0454491451382637, -0.010962508618831635, 0.5393624305725098, -0.17628790438175201, -0.015161082148551941, 0.23311688005924225, -0.3448255658149719, 0.9554377794265747, -0.22189591825008392, 0.05559755116701126, -0.10647290199995041, 0.02941734343767166, 0.2389659285545349, -0.18901662528514862, 0.045965902507305145, -0.21380481123924255, -0.16405165195465088, 0.053572915494441986, -0.20898392796516418, 0.18096964061260223, 0.2723594903945923, 0.08723922073841095, 0.22162479162216187, -0.3284206688404083, 0.23071952164173126, 0.025341695174574852, 0.4471805691719055, -0.1698957085609436, -0.03585042804479599, -0.5194597244262695, 0.02654704451560974, -0.11913806200027466, 0.06875979155302048, -0.000707017257809639, 0.1327541470527649, -0.22025610506534576, 0.012326981872320175, -0.17371337115764618, 0.08791802078485489, -0.22347497940063477, 0.05343705788254738, -0.35568249225616455, -0.633313775062561, 0.3397536873817444, 0.349176287651062, -0.16806422173976898, 0.3479357659816742, -0.017139555886387825, 0.322363018989563, -0.25171101093292236, -0.07651263475418091, -0.02184145525097847, -0.12786494195461273, -0.019676202908158302, -0.10734742879867554, -0.43838122487068176, 0.049491140991449356, -0.17352928221225739, -0.25038450956344604, 0.13329270482063293, 0.18047857284545898, 0.31606584787368774, 0.012458069249987602, -0.21124114096164703, -0.28569895029067993, 0.10759682953357697, -0.010817136615514755, 0.0418323390185833, 0.29788750410079956, 0.03975846990942955, 0.2669132351875305, 0.1109829694032669, -0.22194670140743256, -0.017123714089393616, 0.5728828310966492, -0.07916150242090225, -0.027912698686122894, 0.6649041175842285, 0.26792287826538086, -0.1384141445159912, -0.2283843755722046, 0.23382270336151123, -0.07310082018375397, -0.5962603688240051, 0.19566604495048523, -0.0224203709512949, 0.46563923358917236, 0.10623937100172043, -0.027257461100816727, -0.09597253799438477, -0.43287914991378784, -0.08363057672977448, -0.6366723775863647, -0.34940841794013977, -0.05741351842880249, 0.025471050292253494, 0.12531410157680511, 0.17513889074325562, -0.23246736824512482, -0.11015419661998749, -0.09707743674516678, -0.1376781016588211, 0.150198295712471, -0.2709207236766815, -0.09309391677379608, 0.15591932833194733, -0.05704586207866669, 0.19726970791816711, -0.28615719079971313, 0.048667751252651215, 0.16435900330543518, 0.16197587549686432, -0.15901458263397217, 0.04230492189526558, 0.22811582684516907, -0.0007025133818387985, 0.01833907514810562, 0.011892885901033878, -0.7463324069976807, -0.265785276889801, -0.07899288088083267, 0.18060339987277985, 0.1329132318496704, 0.06434297561645508, -0.19072085618972778, -0.14010347425937653, 0.10891135036945343, -0.3651726245880127, 0.4115532636642456, -0.15696361660957336, 0.10463712364435196, 0.2865174114704132, 0.09398601949214935, 0.30518585443496704, 0.1926060914993286, -0.5772462487220764, 0.0446522980928421, 0.25498896837234497, -0.06436599045991898, 0.39617544412612915, -0.521146833896637, 0.17091479897499084, -0.020631060004234314, 0.16048093140125275, 0.3715542256832123, -0.21397225558757782, -0.012139791622757912, 0.3651035726070404, 0.039951130747795105, -0.1631409227848053, -0.11998256295919418, 0.2417137622833252, -0.05226154625415802, -0.09099028259515762, 0.008701488375663757, -0.34139493107795715, -0.023440662771463394, -0.10255773365497589, 0.11860350519418716, 0.5501222610473633, 0.0375334694981575, -0.0773211419582367, 0.514103353023529, 0.2463444322347641, 0.08411307632923126, 0.1213693767786026, 0.22227300703525543, 0.11915237456560135, 0.49250155687332153, -0.054757095873355865, 0.1569666713476181, -0.26011836528778076, 0.6130087971687317, -0.293676495552063, -0.6449798941612244, -0.006450075656175613, 0.4330599308013916, -0.3199162185192108, 0.019298594444990158, 0.13427764177322388, 0.19593317806720734, -0.018950358033180237, -0.05096309632062912, -0.19327275454998016, 0.07943595945835114, -0.038266152143478394, 0.08367450535297394, -0.0796862468123436, -0.015339978039264679, 0.11334706842899323, -0.060385964810848236, -0.024330582469701767, 0.2194375842809677, -0.1739778220653534, 0.2462838739156723, 0.01856643706560135, -0.4862477779388428, 0.04395106062293053, 0.27250242233276367, 0.08061250299215317, -0.0020288564264774323, 0.020942777395248413, 0.025240153074264526, 0.07943247258663177, 0.09207916259765625, -0.00848529301583767, 0.17573711276054382, 0.2830060124397278, 0.0104023152962327, 0.1338217407464981, 0.0929168313741684, -0.11335054785013199, -0.022985417395830154, 0.549501895904541, 0.12064985930919647, 0.12073557078838348, 0.1538299173116684, 0.007887693122029305, -0.09923069179058075, -0.09548267722129822, 0.2025635987520218, -0.0021281056106090546, -0.43780335783958435, 0.20901748538017273, -0.0668276771903038, -0.23699739575386047, -0.4171280860900879, 0.03724119812250137, -0.19707870483398438, -0.014887806959450245, 0.39639368653297424, 0.06117821857333183, 0.0039176661521196365, -0.23815946280956268, 0.019820354878902435, -0.5056633353233337, 0.2021569162607193, 0.255349725484848, 0.41554558277130127, -0.09738849103450775, -0.0015716329216957092, -0.7462612986564636, 0.01747530698776245, -0.06759652495384216, 0.03142719715833664, 0.19182004034519196, -0.06976527720689774, 0.03682664781808853, 0.011216778308153152, 0.4993739724159241, -0.027098100632429123, 0.09059867262840271, 0.4497200548648834, -0.20391367375850677, -0.39025649428367615, -0.136851966381073, 0.082676462829113, -0.215025395154953, -0.4896925985813141, 0.04883141815662384, -0.010604845359921455, -0.07951744645833969, -0.2879243493080139, 0.09391817450523376, 0.17607006430625916, 0.08227121829986572, 0.39898356795310974, 0.06623358279466629, 0.5405977964401245, 0.2156977653503418, -0.12622126936912537, 0.11104851961135864, 0.15623104572296143, 0.129463329911232, 0.22703734040260315, 0.21757766604423523, -0.055619560182094574, -0.2633456289768219, -0.11211684346199036, -0.18947428464889526, 0.015730757266283035, -0.31365966796875, 0.029490044340491295, -0.23108893632888794, -0.11218072474002838, 0.04490720480680466, 0.2746727466583252, -0.07003086805343628, 0.11878283321857452, 0.02889440581202507, 0.09179265797138214, -0.3649129271507263, 0.08666079491376877, 0.27735456824302673, -0.16228407621383667, -0.3062392473220825, 0.23320603370666504, 0.23558026552200317, -0.37375855445861816, 0.06525007635354996, -0.05757562816143036, 0.09475786238908768, 0.47659212350845337, -0.12492737919092178, -0.24352942407131195, 0.3183234930038452, -0.09417065978050232, 0.19253087043762207, -0.09821067750453949, 0.43771255016326904, 0.010331802070140839, 0.08201025426387787, 0.08377249538898468, -0.013787619769573212 ]
https://github.com/huggingface/datasets/issues/6505
Got stuck when I trying to load a dataset
In my case, `.cahce` was in a shared folder. Moving it into the user's home folder fixed the problem. #2618 for more details
### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0
23
Got stuck when I trying to load a dataset ### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0 In my case, `.cahce` was in a shared folder. Moving it into the user's home folder fixed the problem. #2618 for more details
[ -0.14756199717521667, -0.2995699346065521, -0.0653565526008606, 0.31419837474823, 0.33236753940582275, 0.08560382574796677, 0.4291490912437439, 0.07434698939323425, 0.1930258572101593, 0.11410294473171234, -0.14673036336898804, 0.46443212032318115, 0.2579030990600586, -0.08644133061170578, -0.21409069001674652, 0.07133369147777557, -0.15374550223350525, 0.10617315024137497, 0.03897786885499954, -0.045559726655483246, 0.0758349671959877, 0.15758033096790314, -0.283481627702713, 0.020882271230220795, 0.03708616644144058, -0.001890605315566063, 0.13906019926071167, -0.026892490684986115, -0.043990589678287506, -0.3760533332824707, 0.4784262180328369, 0.03980880603194237, 0.10186578333377838, 0.8280534744262695, -0.00012375821825116873, 0.08041734993457794, 0.5884152054786682, 0.04863269627094269, -0.47880837321281433, -0.27008670568466187, -0.15578703582286835, -0.42948222160339355, 0.21695563197135925, -0.08768706768751144, 0.023126736283302307, 0.03955814242362976, 0.007984669879078865, -0.4350268840789795, 0.35528743267059326, 0.29016414284706116, 0.09129959344863892, 0.03166916221380234, 0.07319514453411102, 0.08587704598903656, -0.01350221037864685, 0.21722231805324554, 0.01225481741130352, 0.3670719563961029, 0.4771384596824646, 0.1834782063961029, 0.3030875027179718, -0.20346447825431824, -0.2555580735206604, 0.09509250521659851, 0.03530731052160263, -0.08309346437454224, 0.1704246997833252, -0.2451888918876648, 0.40027326345443726, 0.27393287420272827, 0.7686863541603088, 0.007529702037572861, -0.15956151485443115, -0.19751521944999695, 0.13276837766170502, -0.12937790155410767, 0.16558529436588287, 0.14028246700763702, -0.2675146162509918, 0.19136492908000946, -0.08058757334947586, -0.001065738731995225, -0.27770256996154785, 0.06846296787261963, -0.21840065717697144, -0.280803382396698, -0.0537019819021225, 0.1772727370262146, -0.024858716875314713, -0.02612694352865219, 0.08065015822649002, -0.32605305314064026, 0.08579538762569427, 0.4067389667034149, -0.7832556962966919, 0.13611379265785217, 0.030283112078905106, 0.0000859573483467102, 0.2610495686531067, 0.15768161416053772, 0.15574167668819427, 0.03331049904227257, 0.06385856866836548, -0.005135808140039444, 0.3388919234275818, 0.17822860181331635, 0.007959946990013123, -0.11140874773263931, 0.4228983521461487, 0.029214000329375267, -0.10680238902568817, -0.04791522026062012, -0.18001703917980194, -0.1859087198972702, 0.4948347210884094, -0.14530077576637268, 0.23777665197849274, -0.31503981351852417, -0.21850495040416718, 0.07930101454257965, -0.1574152261018753, -0.01511208526790142, 0.05584695562720299, 0.5164162516593933, -0.345670223236084, 0.3366512060165405, 0.1619708389043808, -0.13369007408618927, -0.2913295030593872, -0.08446334302425385, 0.02393290214240551, -0.3231823742389679, -0.08020554482936859, -0.15184247493743896, 0.30344924330711365, -0.40496891736984253, -0.07215926796197891, 0.007687182165682316, 0.05000879615545273, -0.06870526075363159, 0.12046264111995697, -0.296517014503479, -0.13809683918952942, 0.2439594268798828, -0.04193419963121414, 0.26041102409362793, -0.021446581929922104, -0.24441561102867126, -0.018968723714351654, 0.42398756742477417, -0.3262426555156708, -0.05408423766493797, -0.08144380152225494, 0.10603557527065277, -0.015182830393314362, 0.12755605578422546, -0.411417156457901, -0.0372360460460186, -0.0014210715889930725, -0.12949082255363464, -0.05371396988630295, -0.07776572555303574, 0.14094987511634827, -0.10010458528995514, 0.34810468554496765, 0.3137204051017761, -0.5250808000564575, 0.13998408615589142, -0.43749821186065674, -0.0792233943939209, 0.22952362895011902, 0.18684424459934235, -0.17968042194843292, 0.3122308552265167, -0.3676093518733978, -0.06658966839313507, 0.2792798578739166, -0.16989703476428986, -0.6536527276039124, 0.47545549273490906, -0.32030189037323, 0.04723047465085983, -0.037807680666446686, 0.20811080932617188, 0.051852259784936905, -0.004260146524757147, 0.32945650815963745, 0.2083030641078949, 0.06910814344882965, -0.12840238213539124, -0.2383829802274704, -0.25940951704978943, 0.04954252764582634, 0.4234248101711273, -0.09152686595916748, 0.04527811333537102, 0.16986384987831116, 0.06094218045473099, 0.3191356360912323, 0.18148069083690643, -0.13296645879745483, 0.4863663911819458, 0.19693128764629364, 0.17065447568893433, 0.027730334550142288, 0.03488733619451523, -0.4840688705444336, 0.2070598602294922, -0.026043666526675224, -0.07545831799507141, -0.00713752955198288, -0.06580285727977753, -0.3515719473361969, 0.16082236170768738, -0.18293313682079315, 0.13161014020442963, -0.058573298156261444, 0.03322797641158104, 0.07216514647006989, 0.33924901485443115, -0.015438348054885864, 0.5650488138198853, -0.25436049699783325, 0.020959267392754555, -0.3576246201992035, 0.1781046837568283, 0.01383025012910366, 0.015149884857237339, -0.018109893426299095, -0.2818581759929657, 0.056803248822689056, -0.18974770605564117, -0.268172949552536, 0.07827740907669067, 0.02645184099674225, -0.041282474994659424, -0.36079248785972595, -0.28894805908203125, 0.02705584652721882, -0.039068855345249176, -0.007290991023182869, 0.35410022735595703, 0.4311226010322571, -0.2158794403076172, 0.08679250627756119, 0.026700980961322784, -0.3624246120452881, 0.4272853434085846, 0.07481610774993896, -0.3314993381500244, 0.26272234320640564, -0.11857450008392334, -0.07976316660642624, 0.24132591485977173, 0.6704699397087097, 0.0676475465297699, 0.3770867884159088, 0.14791221916675568, -0.14288648962974548, -0.1943265199661255, 0.5178008079528809, -0.18419933319091797, -0.08062107115983963, 0.3954070210456848, 0.047313474118709564, 0.11418423801660538, 0.028463095426559448, 0.016698244959115982, 0.46451812982559204, 0.18100999295711517, -0.21948358416557312, -0.02411067672073841, 0.281673789024353, -0.2495666891336441, 0.022940441966056824, 0.05419185012578964, -0.040566571056842804, 0.46552348136901855, 0.2352648228406906, -0.0312562994658947, 0.0006105490028858185, -0.3826003968715668, 0.14282731711864471, 0.29854652285575867, -0.06341217458248138, 0.20036181807518005, -0.40181905031204224, -0.04347209632396698, 0.23071901500225067, 0.1291397362947464, -0.13810202479362488, -0.14454340934753418, -0.33830076456069946, 0.20466087758541107, 0.42485812306404114, 0.26294317841529846, -0.08904463052749634, 0.09143474698066711, 0.09263424575328827, -0.3372781276702881, -0.246011421084404, -0.048465296626091, -0.4709993600845337, -0.13478843867778778, 0.37840303778648376, -0.0016846884973347187, 0.29870399832725525, -0.11603720486164093, -0.234195739030838, 0.08828860521316528, -0.11083395034074783, 0.029360055923461914, 0.15322017669677734, 0.344746857881546, 0.07942575216293335, 0.5676672458648682, -0.04440559819340706, 0.27355051040649414, 0.24267175793647766, -0.16614793241024017, -0.13948945701122284, 0.23836016654968262, -0.032650526612997055, 0.13928423821926117, 0.01740255579352379, -0.3209625780582428, -0.2567274868488312, -0.37672948837280273, 0.2944645583629608, -0.2688992917537689, 0.02011346071958542, 0.29028573632240295, 0.09893740713596344, 0.36163946986198425, 0.21879208087921143, 0.10703718662261963, -0.1275881975889206, -0.4673331081867218, 0.32085660099983215, 0.06556271761655807, -0.3119952082633972, -0.009376555681228638, 0.294352650642395, 0.10033953189849854, -0.04088583216071129, -0.5374166965484619, 0.08342333883047104, -0.49256646633148193, 0.10881419479846954, -0.3642776906490326, -0.07865653187036514, 0.23322229087352753, -0.3113851845264435, 0.05039535462856293, 0.0913776084780693, -0.24596789479255676, -0.018697917461395264, 0.040366314351558685, 0.1022227481007576, 0.28081437945365906, 0.5861592292785645, -0.11759054660797119, 0.34345394372940063, 0.28904950618743896, -0.1113666296005249, 0.23438672721385956, 0.08819349855184555, 0.2808306813240051, -0.4250522553920746, -0.4068979024887085, -0.2516186535358429, 0.19838754832744598, -0.1327836662530899, 0.0013649016618728638, -0.039240043610334396, -0.06804406642913818, -0.1968057006597519, -0.30485010147094727, -0.018140770494937897, -0.13691067695617676, 0.04634683579206467, -0.26728329062461853, -0.17720651626586914, 0.011736534535884857, -0.05058322101831436, -0.12934593856334686, -0.19541439414024353, -0.2013590931892395, 0.3096255660057068, 0.18669505417346954, -0.14182531833648682, -0.22736749053001404, -0.09904160350561142, -0.39430612325668335, 0.33654481172561646, -0.18966332077980042, 0.43215063214302063, -0.20643949508666992, 0.20712727308273315, 0.3475887179374695, -0.2820998728275299, 0.6598769426345825, -0.0805605873465538, 0.3348085880279541, 0.20435523986816406, 0.015070855617523193, -0.48171448707580566, 0.026628155261278152, 0.14627082645893097, 0.2199012041091919, 0.1353241354227066, 0.26050111651420593, -0.49152258038520813, -0.14013223350048065, -0.045114435255527496, 0.35974612832069397, -0.06620731949806213, -0.4381331503391266, -0.32462772727012634, -0.36435434222221375, -0.38030877709388733, -0.0707901194691658, -0.07795590907335281, 0.09101416170597076, 0.035235390067100525, -0.3288101851940155, -0.19814306497573853, 0.012730386108160019, -0.050938114523887634, -0.07166477292776108, -0.17157301306724548, -0.2440704107284546, 0.5125733017921448, -0.1256209909915924, 0.18814513087272644, 0.29707732796669006, 0.47556760907173157, -0.0244440995156765, -0.3974202275276184, 0.08360201865434647, -0.07162990421056747, 0.0606268085539341, 0.19636262953281403, -0.07904848456382751, 0.293417364358902, 0.039977435022592545, 0.3786969780921936, -0.03214054927229881, 0.00013478798791766167, 0.11415176093578339, 0.11657103151082993, -0.558554470539093, -0.43204396963119507, 0.14773830771446228, -0.0454491451382637, -0.010962508618831635, 0.5393624305725098, -0.17628790438175201, -0.015161082148551941, 0.23311688005924225, -0.3448255658149719, 0.9554377794265747, -0.22189591825008392, 0.05559755116701126, -0.10647290199995041, 0.02941734343767166, 0.2389659285545349, -0.18901662528514862, 0.045965902507305145, -0.21380481123924255, -0.16405165195465088, 0.053572915494441986, -0.20898392796516418, 0.18096964061260223, 0.2723594903945923, 0.08723922073841095, 0.22162479162216187, -0.3284206688404083, 0.23071952164173126, 0.025341695174574852, 0.4471805691719055, -0.1698957085609436, -0.03585042804479599, -0.5194597244262695, 0.02654704451560974, -0.11913806200027466, 0.06875979155302048, -0.000707017257809639, 0.1327541470527649, -0.22025610506534576, 0.012326981872320175, -0.17371337115764618, 0.08791802078485489, -0.22347497940063477, 0.05343705788254738, -0.35568249225616455, -0.633313775062561, 0.3397536873817444, 0.349176287651062, -0.16806422173976898, 0.3479357659816742, -0.017139555886387825, 0.322363018989563, -0.25171101093292236, -0.07651263475418091, -0.02184145525097847, -0.12786494195461273, -0.019676202908158302, -0.10734742879867554, -0.43838122487068176, 0.049491140991449356, -0.17352928221225739, -0.25038450956344604, 0.13329270482063293, 0.18047857284545898, 0.31606584787368774, 0.012458069249987602, -0.21124114096164703, -0.28569895029067993, 0.10759682953357697, -0.010817136615514755, 0.0418323390185833, 0.29788750410079956, 0.03975846990942955, 0.2669132351875305, 0.1109829694032669, -0.22194670140743256, -0.017123714089393616, 0.5728828310966492, -0.07916150242090225, -0.027912698686122894, 0.6649041175842285, 0.26792287826538086, -0.1384141445159912, -0.2283843755722046, 0.23382270336151123, -0.07310082018375397, -0.5962603688240051, 0.19566604495048523, -0.0224203709512949, 0.46563923358917236, 0.10623937100172043, -0.027257461100816727, -0.09597253799438477, -0.43287914991378784, -0.08363057672977448, -0.6366723775863647, -0.34940841794013977, -0.05741351842880249, 0.025471050292253494, 0.12531410157680511, 0.17513889074325562, -0.23246736824512482, -0.11015419661998749, -0.09707743674516678, -0.1376781016588211, 0.150198295712471, -0.2709207236766815, -0.09309391677379608, 0.15591932833194733, -0.05704586207866669, 0.19726970791816711, -0.28615719079971313, 0.048667751252651215, 0.16435900330543518, 0.16197587549686432, -0.15901458263397217, 0.04230492189526558, 0.22811582684516907, -0.0007025133818387985, 0.01833907514810562, 0.011892885901033878, -0.7463324069976807, -0.265785276889801, -0.07899288088083267, 0.18060339987277985, 0.1329132318496704, 0.06434297561645508, -0.19072085618972778, -0.14010347425937653, 0.10891135036945343, -0.3651726245880127, 0.4115532636642456, -0.15696361660957336, 0.10463712364435196, 0.2865174114704132, 0.09398601949214935, 0.30518585443496704, 0.1926060914993286, -0.5772462487220764, 0.0446522980928421, 0.25498896837234497, -0.06436599045991898, 0.39617544412612915, -0.521146833896637, 0.17091479897499084, -0.020631060004234314, 0.16048093140125275, 0.3715542256832123, -0.21397225558757782, -0.012139791622757912, 0.3651035726070404, 0.039951130747795105, -0.1631409227848053, -0.11998256295919418, 0.2417137622833252, -0.05226154625415802, -0.09099028259515762, 0.008701488375663757, -0.34139493107795715, -0.023440662771463394, -0.10255773365497589, 0.11860350519418716, 0.5501222610473633, 0.0375334694981575, -0.0773211419582367, 0.514103353023529, 0.2463444322347641, 0.08411307632923126, 0.1213693767786026, 0.22227300703525543, 0.11915237456560135, 0.49250155687332153, -0.054757095873355865, 0.1569666713476181, -0.26011836528778076, 0.6130087971687317, -0.293676495552063, -0.6449798941612244, -0.006450075656175613, 0.4330599308013916, -0.3199162185192108, 0.019298594444990158, 0.13427764177322388, 0.19593317806720734, -0.018950358033180237, -0.05096309632062912, -0.19327275454998016, 0.07943595945835114, -0.038266152143478394, 0.08367450535297394, -0.0796862468123436, -0.015339978039264679, 0.11334706842899323, -0.060385964810848236, -0.024330582469701767, 0.2194375842809677, -0.1739778220653534, 0.2462838739156723, 0.01856643706560135, -0.4862477779388428, 0.04395106062293053, 0.27250242233276367, 0.08061250299215317, -0.0020288564264774323, 0.020942777395248413, 0.025240153074264526, 0.07943247258663177, 0.09207916259765625, -0.00848529301583767, 0.17573711276054382, 0.2830060124397278, 0.0104023152962327, 0.1338217407464981, 0.0929168313741684, -0.11335054785013199, -0.022985417395830154, 0.549501895904541, 0.12064985930919647, 0.12073557078838348, 0.1538299173116684, 0.007887693122029305, -0.09923069179058075, -0.09548267722129822, 0.2025635987520218, -0.0021281056106090546, -0.43780335783958435, 0.20901748538017273, -0.0668276771903038, -0.23699739575386047, -0.4171280860900879, 0.03724119812250137, -0.19707870483398438, -0.014887806959450245, 0.39639368653297424, 0.06117821857333183, 0.0039176661521196365, -0.23815946280956268, 0.019820354878902435, -0.5056633353233337, 0.2021569162607193, 0.255349725484848, 0.41554558277130127, -0.09738849103450775, -0.0015716329216957092, -0.7462612986564636, 0.01747530698776245, -0.06759652495384216, 0.03142719715833664, 0.19182004034519196, -0.06976527720689774, 0.03682664781808853, 0.011216778308153152, 0.4993739724159241, -0.027098100632429123, 0.09059867262840271, 0.4497200548648834, -0.20391367375850677, -0.39025649428367615, -0.136851966381073, 0.082676462829113, -0.215025395154953, -0.4896925985813141, 0.04883141815662384, -0.010604845359921455, -0.07951744645833969, -0.2879243493080139, 0.09391817450523376, 0.17607006430625916, 0.08227121829986572, 0.39898356795310974, 0.06623358279466629, 0.5405977964401245, 0.2156977653503418, -0.12622126936912537, 0.11104851961135864, 0.15623104572296143, 0.129463329911232, 0.22703734040260315, 0.21757766604423523, -0.055619560182094574, -0.2633456289768219, -0.11211684346199036, -0.18947428464889526, 0.015730757266283035, -0.31365966796875, 0.029490044340491295, -0.23108893632888794, -0.11218072474002838, 0.04490720480680466, 0.2746727466583252, -0.07003086805343628, 0.11878283321857452, 0.02889440581202507, 0.09179265797138214, -0.3649129271507263, 0.08666079491376877, 0.27735456824302673, -0.16228407621383667, -0.3062392473220825, 0.23320603370666504, 0.23558026552200317, -0.37375855445861816, 0.06525007635354996, -0.05757562816143036, 0.09475786238908768, 0.47659212350845337, -0.12492737919092178, -0.24352942407131195, 0.3183234930038452, -0.09417065978050232, 0.19253087043762207, -0.09821067750453949, 0.43771255016326904, 0.010331802070140839, 0.08201025426387787, 0.08377249538898468, -0.013787619769573212 ]
https://github.com/huggingface/datasets/issues/6505
Got stuck when I trying to load a dataset
> In my case, `.cahce` was in a shared folder. Moving it into the user's home folder fixed the problem. #2618 for more details在我的情况下, `.cahce` 在一个共享文件夹中。将其移动到用户的主文件夹中解决了问题。 #2618 获取更多详细信息。 Can you be more specific? thank.
### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0
34
Got stuck when I trying to load a dataset ### Describe the bug Hello, everyone. I met a problem when I am trying to load a data file using load_dataset method on a Debian 10 system. The data file is not very large, only 1.63MB with 600 records. Here is my code: from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') I waited it for 20 minutes. It still no response. I cannot using Ctrl+C to cancel the command. I have to use Ctrl+Z to kill it. I also try it with a txt file, it still no response in a long time. I can load the same file successfully using my laptop (windows 10, python 3.8.5, datasets==2.14.5). I can also make it on another computer (Ubuntu 20.04.5 LTS, python 3.10.13, datasets 2.14.7). It only takes me 1-2 miniutes. Could you give me some suggestions? Thank you. ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset('json', data_files='mypath/oaast_rm_zh.json') ### Expected behavior I hope it can load the file successfully. ### Environment info OS: Debian GNU/Linux 10 Python: Python 3.10.13 Pip list: Package Version ------------------------- ------------ accelerate 0.25.0 addict 2.4.0 aiofiles 23.2.1 aiohttp 3.9.1 aiosignal 1.3.1 aliyun-python-sdk-core 2.14.0 aliyun-python-sdk-kms 2.16.2 altair 5.2.0 annotated-types 0.6.0 anyio 3.7.1 async-timeout 4.0.3 attrs 23.1.0 certifi 2023.11.17 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 contourpy 1.2.0 crcmod 1.7 cryptography 41.0.7 cycler 0.12.1 datasets 2.14.7 dill 0.3.7 docstring-parser 0.15 einops 0.7.0 exceptiongroup 1.2.0 fastapi 0.105.0 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.46.0 frozenlist 1.4.1 fsspec 2023.10.0 gast 0.5.4 gradio 3.50.2 gradio_client 0.6.1 h11 0.14.0 httpcore 1.0.2 httpx 0.25.2 huggingface-hub 0.19.4 idna 3.6 importlib-metadata 7.0.0 importlib-resources 6.1.1 jieba 0.42.1 Jinja2 3.1.2 jmespath 0.10.0 joblib 1.3.2 jsonschema 4.20.0 jsonschema-specifications 2023.11.2 kiwisolver 1.4.5 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.8.2 mdurl 0.1.2 modelscope 1.10.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.15 networkx 3.2.1 nltk 3.8.1 numpy 1.26.2 nvidia-cublas-cu12 12.1.3.1 nvidia-cuda-cupti-cu12 12.1.105 nvidia-cuda-nvrtc-cu12 12.1.105 nvidia-cuda-runtime-cu12 12.1.105 nvidia-cudnn-cu12 8.9.2.26 nvidia-cufft-cu12 11.0.2.54 nvidia-curand-cu12 10.3.2.106 nvidia-cusolver-cu12 11.4.5.107 nvidia-cusparse-cu12 12.1.0.106 nvidia-nccl-cu12 2.18.1 nvidia-nvjitlink-cu12 12.3.101 nvidia-nvtx-cu12 12.1.105 orjson 3.9.10 oss2 2.18.3 packaging 23.2 pandas 2.1.4 peft 0.7.1 Pillow 10.1.0 pip 23.3.1 platformdirs 4.1.0 protobuf 4.25.1 psutil 5.9.6 pyarrow 14.0.1 pyarrow-hotfix 0.6 pycparser 2.21 pycryptodome 3.19.0 pydantic 2.5.2 pydantic_core 2.14.5 pydub 0.25.1 Pygments 2.17.2 pyparsing 3.1.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.32.0 regex 2023.10.3 requests 2.31.0 rich 13.7.0 rouge-chinese 1.0.3 rpds-py 0.13.2 safetensors 0.4.1 scipy 1.11.4 semantic-version 2.10.0 sentencepiece 0.1.99 setuptools 68.2.2 shtab 1.6.5 simplejson 3.19.2 six 1.16.0 sniffio 1.3.0 sortedcontainers 2.4.0 sse-starlette 1.8.2 starlette 0.27.0 sympy 1.12 tiktoken 0.5.2 tokenizers 0.15.0 tomli 2.0.1 toolz 0.12.0 torch 2.1.2 tqdm 4.66.1 transformers 4.36.1 triton 2.1.0 trl 0.7.4 typing_extensions 4.9.0 tyro 0.6.0 tzdata 2023.3 urllib3 2.1.0 uvicorn 0.24.0.post1 websockets 11.0.3 wheel 0.41.2 xxhash 3.4.1 yapf 0.40.2 yarl 1.9.4 zipp 3.17.0 > In my case, `.cahce` was in a shared folder. Moving it into the user's home folder fixed the problem. #2618 for more details在我的情况下, `.cahce` 在一个共享文件夹中。将其移动到用户的主文件夹中解决了问题。 #2618 获取更多详细信息。 Can you be more specific? thank.
[ -0.14756199717521667, -0.2995699346065521, -0.0653565526008606, 0.31419837474823, 0.33236753940582275, 0.08560382574796677, 0.4291490912437439, 0.07434698939323425, 0.1930258572101593, 0.11410294473171234, -0.14673036336898804, 0.46443212032318115, 0.2579030990600586, -0.08644133061170578, -0.21409069001674652, 0.07133369147777557, -0.15374550223350525, 0.10617315024137497, 0.03897786885499954, -0.045559726655483246, 0.0758349671959877, 0.15758033096790314, -0.283481627702713, 0.020882271230220795, 0.03708616644144058, -0.001890605315566063, 0.13906019926071167, -0.026892490684986115, -0.043990589678287506, -0.3760533332824707, 0.4784262180328369, 0.03980880603194237, 0.10186578333377838, 0.8280534744262695, -0.00012375821825116873, 0.08041734993457794, 0.5884152054786682, 0.04863269627094269, -0.47880837321281433, -0.27008670568466187, -0.15578703582286835, -0.42948222160339355, 0.21695563197135925, -0.08768706768751144, 0.023126736283302307, 0.03955814242362976, 0.007984669879078865, -0.4350268840789795, 0.35528743267059326, 0.29016414284706116, 0.09129959344863892, 0.03166916221380234, 0.07319514453411102, 0.08587704598903656, -0.01350221037864685, 0.21722231805324554, 0.01225481741130352, 0.3670719563961029, 0.4771384596824646, 0.1834782063961029, 0.3030875027179718, -0.20346447825431824, -0.2555580735206604, 0.09509250521659851, 0.03530731052160263, -0.08309346437454224, 0.1704246997833252, -0.2451888918876648, 0.40027326345443726, 0.27393287420272827, 0.7686863541603088, 0.007529702037572861, -0.15956151485443115, -0.19751521944999695, 0.13276837766170502, -0.12937790155410767, 0.16558529436588287, 0.14028246700763702, -0.2675146162509918, 0.19136492908000946, -0.08058757334947586, -0.001065738731995225, -0.27770256996154785, 0.06846296787261963, -0.21840065717697144, -0.280803382396698, -0.0537019819021225, 0.1772727370262146, -0.024858716875314713, -0.02612694352865219, 0.08065015822649002, -0.32605305314064026, 0.08579538762569427, 0.4067389667034149, -0.7832556962966919, 0.13611379265785217, 0.030283112078905106, 0.0000859573483467102, 0.2610495686531067, 0.15768161416053772, 0.15574167668819427, 0.03331049904227257, 0.06385856866836548, -0.005135808140039444, 0.3388919234275818, 0.17822860181331635, 0.007959946990013123, -0.11140874773263931, 0.4228983521461487, 0.029214000329375267, -0.10680238902568817, -0.04791522026062012, -0.18001703917980194, -0.1859087198972702, 0.4948347210884094, -0.14530077576637268, 0.23777665197849274, -0.31503981351852417, -0.21850495040416718, 0.07930101454257965, -0.1574152261018753, -0.01511208526790142, 0.05584695562720299, 0.5164162516593933, -0.345670223236084, 0.3366512060165405, 0.1619708389043808, -0.13369007408618927, -0.2913295030593872, -0.08446334302425385, 0.02393290214240551, -0.3231823742389679, -0.08020554482936859, -0.15184247493743896, 0.30344924330711365, -0.40496891736984253, -0.07215926796197891, 0.007687182165682316, 0.05000879615545273, -0.06870526075363159, 0.12046264111995697, -0.296517014503479, -0.13809683918952942, 0.2439594268798828, -0.04193419963121414, 0.26041102409362793, -0.021446581929922104, -0.24441561102867126, -0.018968723714351654, 0.42398756742477417, -0.3262426555156708, -0.05408423766493797, -0.08144380152225494, 0.10603557527065277, -0.015182830393314362, 0.12755605578422546, -0.411417156457901, -0.0372360460460186, -0.0014210715889930725, -0.12949082255363464, -0.05371396988630295, -0.07776572555303574, 0.14094987511634827, -0.10010458528995514, 0.34810468554496765, 0.3137204051017761, -0.5250808000564575, 0.13998408615589142, -0.43749821186065674, -0.0792233943939209, 0.22952362895011902, 0.18684424459934235, -0.17968042194843292, 0.3122308552265167, -0.3676093518733978, -0.06658966839313507, 0.2792798578739166, -0.16989703476428986, -0.6536527276039124, 0.47545549273490906, -0.32030189037323, 0.04723047465085983, -0.037807680666446686, 0.20811080932617188, 0.051852259784936905, -0.004260146524757147, 0.32945650815963745, 0.2083030641078949, 0.06910814344882965, -0.12840238213539124, -0.2383829802274704, -0.25940951704978943, 0.04954252764582634, 0.4234248101711273, -0.09152686595916748, 0.04527811333537102, 0.16986384987831116, 0.06094218045473099, 0.3191356360912323, 0.18148069083690643, -0.13296645879745483, 0.4863663911819458, 0.19693128764629364, 0.17065447568893433, 0.027730334550142288, 0.03488733619451523, -0.4840688705444336, 0.2070598602294922, -0.026043666526675224, -0.07545831799507141, -0.00713752955198288, -0.06580285727977753, -0.3515719473361969, 0.16082236170768738, -0.18293313682079315, 0.13161014020442963, -0.058573298156261444, 0.03322797641158104, 0.07216514647006989, 0.33924901485443115, -0.015438348054885864, 0.5650488138198853, -0.25436049699783325, 0.020959267392754555, -0.3576246201992035, 0.1781046837568283, 0.01383025012910366, 0.015149884857237339, -0.018109893426299095, -0.2818581759929657, 0.056803248822689056, -0.18974770605564117, -0.268172949552536, 0.07827740907669067, 0.02645184099674225, -0.041282474994659424, -0.36079248785972595, -0.28894805908203125, 0.02705584652721882, -0.039068855345249176, -0.007290991023182869, 0.35410022735595703, 0.4311226010322571, -0.2158794403076172, 0.08679250627756119, 0.026700980961322784, -0.3624246120452881, 0.4272853434085846, 0.07481610774993896, -0.3314993381500244, 0.26272234320640564, -0.11857450008392334, -0.07976316660642624, 0.24132591485977173, 0.6704699397087097, 0.0676475465297699, 0.3770867884159088, 0.14791221916675568, -0.14288648962974548, -0.1943265199661255, 0.5178008079528809, -0.18419933319091797, -0.08062107115983963, 0.3954070210456848, 0.047313474118709564, 0.11418423801660538, 0.028463095426559448, 0.016698244959115982, 0.46451812982559204, 0.18100999295711517, -0.21948358416557312, -0.02411067672073841, 0.281673789024353, -0.2495666891336441, 0.022940441966056824, 0.05419185012578964, -0.040566571056842804, 0.46552348136901855, 0.2352648228406906, -0.0312562994658947, 0.0006105490028858185, -0.3826003968715668, 0.14282731711864471, 0.29854652285575867, -0.06341217458248138, 0.20036181807518005, -0.40181905031204224, -0.04347209632396698, 0.23071901500225067, 0.1291397362947464, -0.13810202479362488, -0.14454340934753418, -0.33830076456069946, 0.20466087758541107, 0.42485812306404114, 0.26294317841529846, -0.08904463052749634, 0.09143474698066711, 0.09263424575328827, -0.3372781276702881, -0.246011421084404, -0.048465296626091, -0.4709993600845337, -0.13478843867778778, 0.37840303778648376, -0.0016846884973347187, 0.29870399832725525, -0.11603720486164093, -0.234195739030838, 0.08828860521316528, -0.11083395034074783, 0.029360055923461914, 0.15322017669677734, 0.344746857881546, 0.07942575216293335, 0.5676672458648682, -0.04440559819340706, 0.27355051040649414, 0.24267175793647766, -0.16614793241024017, -0.13948945701122284, 0.23836016654968262, -0.032650526612997055, 0.13928423821926117, 0.01740255579352379, -0.3209625780582428, -0.2567274868488312, -0.37672948837280273, 0.2944645583629608, -0.2688992917537689, 0.02011346071958542, 0.29028573632240295, 0.09893740713596344, 0.36163946986198425, 0.21879208087921143, 0.10703718662261963, -0.1275881975889206, -0.4673331081867218, 0.32085660099983215, 0.06556271761655807, -0.3119952082633972, -0.009376555681228638, 0.294352650642395, 0.10033953189849854, -0.04088583216071129, -0.5374166965484619, 0.08342333883047104, -0.49256646633148193, 0.10881419479846954, -0.3642776906490326, -0.07865653187036514, 0.23322229087352753, -0.3113851845264435, 0.05039535462856293, 0.0913776084780693, -0.24596789479255676, -0.018697917461395264, 0.040366314351558685, 0.1022227481007576, 0.28081437945365906, 0.5861592292785645, -0.11759054660797119, 0.34345394372940063, 0.28904950618743896, -0.1113666296005249, 0.23438672721385956, 0.08819349855184555, 0.2808306813240051, -0.4250522553920746, -0.4068979024887085, -0.2516186535358429, 0.19838754832744598, -0.1327836662530899, 0.0013649016618728638, -0.039240043610334396, -0.06804406642913818, -0.1968057006597519, -0.30485010147094727, -0.018140770494937897, -0.13691067695617676, 0.04634683579206467, -0.26728329062461853, -0.17720651626586914, 0.011736534535884857, -0.05058322101831436, -0.12934593856334686, -0.19541439414024353, -0.2013590931892395, 0.3096255660057068, 0.18669505417346954, -0.14182531833648682, -0.22736749053001404, -0.09904160350561142, -0.39430612325668335, 0.33654481172561646, -0.18966332077980042, 0.43215063214302063, -0.20643949508666992, 0.20712727308273315, 0.3475887179374695, -0.2820998728275299, 0.6598769426345825, -0.0805605873465538, 0.3348085880279541, 0.20435523986816406, 0.015070855617523193, -0.48171448707580566, 0.026628155261278152, 0.14627082645893097, 0.2199012041091919, 0.1353241354227066, 0.26050111651420593, -0.49152258038520813, -0.14013223350048065, -0.045114435255527496, 0.35974612832069397, -0.06620731949806213, -0.4381331503391266, -0.32462772727012634, -0.36435434222221375, -0.38030877709388733, -0.0707901194691658, -0.07795590907335281, 0.09101416170597076, 0.035235390067100525, -0.3288101851940155, -0.19814306497573853, 0.012730386108160019, -0.050938114523887634, -0.07166477292776108, -0.17157301306724548, -0.2440704107284546, 0.5125733017921448, -0.1256209909915924, 0.18814513087272644, 0.29707732796669006, 0.47556760907173157, -0.0244440995156765, -0.3974202275276184, 0.08360201865434647, -0.07162990421056747, 0.0606268085539341, 0.19636262953281403, -0.07904848456382751, 0.293417364358902, 0.039977435022592545, 0.3786969780921936, -0.03214054927229881, 0.00013478798791766167, 0.11415176093578339, 0.11657103151082993, -0.558554470539093, -0.43204396963119507, 0.14773830771446228, -0.0454491451382637, -0.010962508618831635, 0.5393624305725098, -0.17628790438175201, -0.015161082148551941, 0.23311688005924225, -0.3448255658149719, 0.9554377794265747, -0.22189591825008392, 0.05559755116701126, -0.10647290199995041, 0.02941734343767166, 0.2389659285545349, -0.18901662528514862, 0.045965902507305145, -0.21380481123924255, -0.16405165195465088, 0.053572915494441986, -0.20898392796516418, 0.18096964061260223, 0.2723594903945923, 0.08723922073841095, 0.22162479162216187, -0.3284206688404083, 0.23071952164173126, 0.025341695174574852, 0.4471805691719055, -0.1698957085609436, -0.03585042804479599, -0.5194597244262695, 0.02654704451560974, -0.11913806200027466, 0.06875979155302048, -0.000707017257809639, 0.1327541470527649, -0.22025610506534576, 0.012326981872320175, -0.17371337115764618, 0.08791802078485489, -0.22347497940063477, 0.05343705788254738, -0.35568249225616455, -0.633313775062561, 0.3397536873817444, 0.349176287651062, -0.16806422173976898, 0.3479357659816742, -0.017139555886387825, 0.322363018989563, -0.25171101093292236, -0.07651263475418091, -0.02184145525097847, -0.12786494195461273, -0.019676202908158302, -0.10734742879867554, -0.43838122487068176, 0.049491140991449356, -0.17352928221225739, -0.25038450956344604, 0.13329270482063293, 0.18047857284545898, 0.31606584787368774, 0.012458069249987602, -0.21124114096164703, -0.28569895029067993, 0.10759682953357697, -0.010817136615514755, 0.0418323390185833, 0.29788750410079956, 0.03975846990942955, 0.2669132351875305, 0.1109829694032669, -0.22194670140743256, -0.017123714089393616, 0.5728828310966492, -0.07916150242090225, -0.027912698686122894, 0.6649041175842285, 0.26792287826538086, -0.1384141445159912, -0.2283843755722046, 0.23382270336151123, -0.07310082018375397, -0.5962603688240051, 0.19566604495048523, -0.0224203709512949, 0.46563923358917236, 0.10623937100172043, -0.027257461100816727, -0.09597253799438477, -0.43287914991378784, -0.08363057672977448, -0.6366723775863647, -0.34940841794013977, -0.05741351842880249, 0.025471050292253494, 0.12531410157680511, 0.17513889074325562, -0.23246736824512482, -0.11015419661998749, -0.09707743674516678, -0.1376781016588211, 0.150198295712471, -0.2709207236766815, -0.09309391677379608, 0.15591932833194733, -0.05704586207866669, 0.19726970791816711, -0.28615719079971313, 0.048667751252651215, 0.16435900330543518, 0.16197587549686432, -0.15901458263397217, 0.04230492189526558, 0.22811582684516907, -0.0007025133818387985, 0.01833907514810562, 0.011892885901033878, -0.7463324069976807, -0.265785276889801, -0.07899288088083267, 0.18060339987277985, 0.1329132318496704, 0.06434297561645508, -0.19072085618972778, -0.14010347425937653, 0.10891135036945343, -0.3651726245880127, 0.4115532636642456, -0.15696361660957336, 0.10463712364435196, 0.2865174114704132, 0.09398601949214935, 0.30518585443496704, 0.1926060914993286, -0.5772462487220764, 0.0446522980928421, 0.25498896837234497, -0.06436599045991898, 0.39617544412612915, -0.521146833896637, 0.17091479897499084, -0.020631060004234314, 0.16048093140125275, 0.3715542256832123, -0.21397225558757782, -0.012139791622757912, 0.3651035726070404, 0.039951130747795105, -0.1631409227848053, -0.11998256295919418, 0.2417137622833252, -0.05226154625415802, -0.09099028259515762, 0.008701488375663757, -0.34139493107795715, -0.023440662771463394, -0.10255773365497589, 0.11860350519418716, 0.5501222610473633, 0.0375334694981575, -0.0773211419582367, 0.514103353023529, 0.2463444322347641, 0.08411307632923126, 0.1213693767786026, 0.22227300703525543, 0.11915237456560135, 0.49250155687332153, -0.054757095873355865, 0.1569666713476181, -0.26011836528778076, 0.6130087971687317, -0.293676495552063, -0.6449798941612244, -0.006450075656175613, 0.4330599308013916, -0.3199162185192108, 0.019298594444990158, 0.13427764177322388, 0.19593317806720734, -0.018950358033180237, -0.05096309632062912, -0.19327275454998016, 0.07943595945835114, -0.038266152143478394, 0.08367450535297394, -0.0796862468123436, -0.015339978039264679, 0.11334706842899323, -0.060385964810848236, -0.024330582469701767, 0.2194375842809677, -0.1739778220653534, 0.2462838739156723, 0.01856643706560135, -0.4862477779388428, 0.04395106062293053, 0.27250242233276367, 0.08061250299215317, -0.0020288564264774323, 0.020942777395248413, 0.025240153074264526, 0.07943247258663177, 0.09207916259765625, -0.00848529301583767, 0.17573711276054382, 0.2830060124397278, 0.0104023152962327, 0.1338217407464981, 0.0929168313741684, -0.11335054785013199, -0.022985417395830154, 0.549501895904541, 0.12064985930919647, 0.12073557078838348, 0.1538299173116684, 0.007887693122029305, -0.09923069179058075, -0.09548267722129822, 0.2025635987520218, -0.0021281056106090546, -0.43780335783958435, 0.20901748538017273, -0.0668276771903038, -0.23699739575386047, -0.4171280860900879, 0.03724119812250137, -0.19707870483398438, -0.014887806959450245, 0.39639368653297424, 0.06117821857333183, 0.0039176661521196365, -0.23815946280956268, 0.019820354878902435, -0.5056633353233337, 0.2021569162607193, 0.255349725484848, 0.41554558277130127, -0.09738849103450775, -0.0015716329216957092, -0.7462612986564636, 0.01747530698776245, -0.06759652495384216, 0.03142719715833664, 0.19182004034519196, -0.06976527720689774, 0.03682664781808853, 0.011216778308153152, 0.4993739724159241, -0.027098100632429123, 0.09059867262840271, 0.4497200548648834, -0.20391367375850677, -0.39025649428367615, -0.136851966381073, 0.082676462829113, -0.215025395154953, -0.4896925985813141, 0.04883141815662384, -0.010604845359921455, -0.07951744645833969, -0.2879243493080139, 0.09391817450523376, 0.17607006430625916, 0.08227121829986572, 0.39898356795310974, 0.06623358279466629, 0.5405977964401245, 0.2156977653503418, -0.12622126936912537, 0.11104851961135864, 0.15623104572296143, 0.129463329911232, 0.22703734040260315, 0.21757766604423523, -0.055619560182094574, -0.2633456289768219, -0.11211684346199036, -0.18947428464889526, 0.015730757266283035, -0.31365966796875, 0.029490044340491295, -0.23108893632888794, -0.11218072474002838, 0.04490720480680466, 0.2746727466583252, -0.07003086805343628, 0.11878283321857452, 0.02889440581202507, 0.09179265797138214, -0.3649129271507263, 0.08666079491376877, 0.27735456824302673, -0.16228407621383667, -0.3062392473220825, 0.23320603370666504, 0.23558026552200317, -0.37375855445861816, 0.06525007635354996, -0.05757562816143036, 0.09475786238908768, 0.47659212350845337, -0.12492737919092178, -0.24352942407131195, 0.3183234930038452, -0.09417065978050232, 0.19253087043762207, -0.09821067750453949, 0.43771255016326904, 0.010331802070140839, 0.08201025426387787, 0.08377249538898468, -0.013787619769573212 ]
https://github.com/huggingface/datasets/issues/6496
Error when writing a dataset to HF Hub: A commit has happened since. Please refresh and try again.
I transferred from datasets-server, since the issue is more about `datasets` and the integration with `huggingface_hub`.
**Describe the bug** Getting a `412 Client Error: Precondition Failed` when trying to write a dataset to the HF hub. ``` huggingface_hub.utils._errors.HfHubHTTPError: 412 Client Error: Precondition Failed for url: https://huggingface.co/api/datasets/GLorr/test-dask/commit/main (Request ID: Root=1-657ae26f-3bd92bf861bb254b2cc0826c;50a09ab7-9347-406a-ba49-69f98abee9cc) A commit has happened since. Please refresh and try again. ``` **Steps to reproduce the bug** This is a minimal reproducer: ``` import dask.dataframe as dd import pandas as pd import random import os import huggingface_hub import datasets huggingface_hub.login(token=os.getenv("HF_TOKEN")) data = {"number": [random.randint(0,10) for _ in range(1000)]} df = pd.DataFrame.from_dict(data) dataframe = dd.from_pandas(df, npartitions=1) dataframe = dataframe.repartition(npartitions=3) schema = datasets.Features({"number": datasets.Value("int64")}).arrow_schema repo_id = "GLorr/test-dask" repo_path = f"hf://datasets/{repo_id}" huggingface_hub.create_repo(repo_id=repo_id, repo_type="dataset", exist_ok=True) dd.to_parquet(dataframe, path=f"{repo_path}/data", schema=schema) ``` **Expected behavior** Would expect to write to the hub without any problem. **Environment info** ``` datasets==2.15.0 huggingface-hub==0.19.4 ```
16
Error when writing a dataset to HF Hub: A commit has happened since. Please refresh and try again. **Describe the bug** Getting a `412 Client Error: Precondition Failed` when trying to write a dataset to the HF hub. ``` huggingface_hub.utils._errors.HfHubHTTPError: 412 Client Error: Precondition Failed for url: https://huggingface.co/api/datasets/GLorr/test-dask/commit/main (Request ID: Root=1-657ae26f-3bd92bf861bb254b2cc0826c;50a09ab7-9347-406a-ba49-69f98abee9cc) A commit has happened since. Please refresh and try again. ``` **Steps to reproduce the bug** This is a minimal reproducer: ``` import dask.dataframe as dd import pandas as pd import random import os import huggingface_hub import datasets huggingface_hub.login(token=os.getenv("HF_TOKEN")) data = {"number": [random.randint(0,10) for _ in range(1000)]} df = pd.DataFrame.from_dict(data) dataframe = dd.from_pandas(df, npartitions=1) dataframe = dataframe.repartition(npartitions=3) schema = datasets.Features({"number": datasets.Value("int64")}).arrow_schema repo_id = "GLorr/test-dask" repo_path = f"hf://datasets/{repo_id}" huggingface_hub.create_repo(repo_id=repo_id, repo_type="dataset", exist_ok=True) dd.to_parquet(dataframe, path=f"{repo_path}/data", schema=schema) ``` **Expected behavior** Would expect to write to the hub without any problem. **Environment info** ``` datasets==2.15.0 huggingface-hub==0.19.4 ``` I transferred from datasets-server, since the issue is more about `datasets` and the integration with `huggingface_hub`.
[ -0.049645330756902695, -0.45720374584198, 0.11370250582695007, 0.05369773879647255, 0.10257484018802643, -0.17956030368804932, -0.017056021839380264, 0.2555897831916809, -0.07975434511899948, 0.08024363219738007, -0.24189507961273193, -0.2631169557571411, 0.17090670764446259, 0.2232542186975479, 0.1797095686197281, -0.05194750428199768, 0.065325066447258, 0.05295531451702118, -0.1308254450559616, -0.127121239900589, -0.10212621837854385, 0.13134247064590454, 0.146963968873024, 0.2793698012828827, -0.5535674691200256, -0.16914749145507812, -0.24723534286022186, 0.44587960839271545, -0.12104452401399612, -0.2909700870513916, 0.25212210416793823, 0.27636075019836426, 0.22738727927207947, 0.3146519064903259, -0.00012797470844816417, -0.06988752633333206, 0.11605021357536316, -0.06458090245723724, -0.02816671133041382, -0.1367178112268448, -0.29921528697013855, -0.004335220903158188, 0.04005680978298187, -0.10970407724380493, -0.20841386914253235, 0.03019573912024498, -0.127452090382576, 0.07740932703018188, 0.5771014094352722, 0.3203026056289673, 0.10853617638349533, 0.33532097935676575, 0.20321978628635406, -0.29913920164108276, -0.10992727428674698, 0.19210627675056458, -0.21474990248680115, 0.21562741696834564, -0.1260821521282196, -0.20500782132148743, -0.0721694603562355, -0.23222091794013977, 0.12265534698963165, -0.06209986284375191, 0.262472540140152, -0.16207052767276764, 0.14291656017303467, -0.38740214705467224, 0.1104520931839943, 0.0619514025747776, 0.2928960919380188, -0.5416525602340698, -0.3721654415130615, 0.06724186986684799, 0.02271129935979843, -0.3729472756385803, 0.35731926560401917, 0.19452346861362457, 0.0476800911128521, 0.2028634399175644, 0.08556610345840454, -0.191604346036911, -0.05257101729512215, -0.14051254093647003, 0.06091673672199249, -0.030521847307682037, 0.05023569613695145, 0.053808216005563736, -0.05623287335038185, 0.052513934671878815, 0.12375885993242264, -0.2796976864337921, -0.3448720872402191, 0.2604353725910187, -0.2717355191707611, -0.25723761320114136, -0.08487539738416672, 0.20627626776695251, 0.16095414757728577, 0.34703683853149414, -0.0925019308924675, -0.005453072488307953, -0.11298321932554245, -0.08272381871938705, 0.04284800589084625, -0.034050293266773224, 0.0804375559091568, -0.04036200791597366, 0.19417370855808258, 0.27539554238319397, 0.25876906514167786, 0.0502358078956604, 0.20787222683429718, -0.20330119132995605, 0.21119648218154907, -0.21786996722221375, 0.34125465154647827, -0.18198591470718384, -0.20067639648914337, 0.589181125164032, -0.3625752925872803, 0.12144781649112701, -0.22331099212169647, 0.29813826084136963, -0.09677305817604065, -0.20927444100379944, 0.03411729633808136, 0.39562857151031494, -0.15909363329410553, 0.19236737489700317, -0.23723642528057098, 0.053062260150909424, -0.06403293460607529, 0.10828285664319992, 0.0061582960188388824, -0.19435621798038483, 0.039674945175647736, 0.23908017575740814, 0.27306050062179565, -0.45147082209587097, -0.136836975812912, -0.1000412255525589, -0.06128615885972977, 0.42177996039390564, 0.1273791790008545, 0.35161644220352173, 0.21983671188354492, -0.15266290307044983, -0.06025554984807968, -0.14319780468940735, -0.17570185661315918, -0.1587199866771698, -0.29239410161972046, 0.010846341028809547, -0.1630047708749771, 0.07132893055677414, -0.4118903577327728, -0.19817402958869934, -0.09514915198087692, 0.20203526318073273, 0.05003365874290466, 0.2331329733133316, -0.16543832421302795, -0.16471892595291138, 0.28295597434043884, 0.6479058265686035, 0.17223823070526123, 0.01398826390504837, 0.45313867926597595, 0.010223710909485817, 0.22154773771762848, 0.2706436812877655, 0.20004945993423462, 0.18863609433174133, -0.16163299977779388, 0.13104186952114105, 0.09375151991844177, -0.5439262986183167, -0.4556953012943268, 0.13658754527568817, -0.22468802332878113, 0.2146281599998474, -0.2271866500377655, -0.09614356607198715, -0.03363849222660065, 0.0629066601395607, 0.0009521245956420898, -0.05379520356655121, 0.2680762708187103, 0.16068100929260254, -0.20078858733177185, -0.1386183798313141, -0.28786325454711914, -0.042604345828294754, 0.031018784269690514, 0.24672061204910278, 0.37997448444366455, 0.07500988990068436, 0.41209593415260315, -0.13249745965003967, 0.19642870128154755, 0.4041304588317871, 0.39240577816963196, 0.15304461121559143, -0.04772438108921051, -0.07743699848651886, -0.229550302028656, 0.15717726945877075, -0.39072147011756897, 0.16433832049369812, 0.16406920552253723, -0.06525596976280212, -0.27923884987831116, 0.1129726991057396, -0.17597311735153198, -0.24455860257148743, -0.033032868057489395, -0.20939627289772034, -0.02581193670630455, 0.3342440128326416, -0.08911045640707016, 0.830444872379303, -0.08488041907548904, 0.36195072531700134, 0.04913446307182312, 0.5157832503318787, -0.08898549526929855, -0.2508929967880249, 0.37051212787628174, 0.1913931667804718, 0.3974505662918091, -0.028868408873677254, -0.1414482593536377, 0.31949207186698914, 0.08678998798131943, 0.22452445328235626, 0.027649709954857826, -0.10047726333141327, 0.18588870763778687, -0.18546262383460999, -0.1858350783586502, -0.07855461537837982, 0.06909952312707901, 0.000037185847759246826, 0.1020178273320198, 0.2063390016555786, 0.24811361730098724, 0.11070960015058517, -0.18549256026744843, 0.15741531550884247, 0.08498667925596237, 0.037320759147405624, -0.0849820077419281, 0.14132632315158844, 0.3233463764190674, -0.17720428109169006, -0.14594224095344543, -0.08883211761713028, -0.08985769003629684, -0.10328785330057144, 0.13328194618225098, -0.09476722776889801, 0.3051379323005676, 0.05957099050283432, 0.16377922892570496, -0.035110656172037125, 0.21338863670825958, 0.02259378507733345, 0.24794845283031464, -0.2301928699016571, -0.37822425365448, 0.0806727334856987, -0.40547695755958557, 0.032645367085933685, 0.0035255029797554016, -0.15836964547634125, 0.27751338481903076, 0.03974480181932449, 0.1998462826013565, 0.08488905429840088, -0.3387417495250702, 0.021064572036266327, -0.021819915622472763, 0.1216663047671318, -0.42688286304473877, -0.06458312273025513, -0.22060304880142212, 0.34033358097076416, 0.1309932917356491, -0.011727497912943363, -0.3914070725440979, -0.3381004333496094, -0.24239693582057953, 0.37852728366851807, 0.06871221959590912, 0.09208913147449493, 0.08653123676776886, 0.19093772768974304, 0.12409333884716034, 0.041577912867069244, -0.2328733652830124, 0.0733211487531662, 0.05844870209693909, -0.07328791916370392, -0.10684657841920853, 0.022715946659445763, 0.29701587557792664, -0.12407343089580536, 0.10276171565055847, -0.4598439931869507, -0.17685259878635406, -0.08180621266365051, -0.08225174248218536, 0.2302175611257553, 0.07967213541269302, 0.28662484884262085, -0.2325504571199417, 0.046668607741594315, 0.1645088940858841, 0.30571630597114563, -0.2046617865562439, 0.05365002155303955, 0.0014071849873289466, -0.14599516987800598, 0.12194274365901947, 0.44730037450790405, 0.06313835084438324, -0.4067177474498749, 0.2502555847167969, -0.021959107369184494, 0.22873330116271973, 0.0006269561126828194, -0.016689786687493324, 0.10530786216259003, -0.2932402193546295, -0.20652039349079132, -0.06956605613231659, -0.22493506968021393, 0.2259691208600998, -0.3102928102016449, -0.4844376742839813, 0.13921919465065002, 0.15504132211208344, 0.21735461056232452, -0.22992779314517975, -0.33079254627227783, -0.3877733051776886, -0.26461613178253174, 0.07567109167575836, -0.1936943382024765, -0.022109685465693474, 0.21491172909736633, -0.10121571272611618, 0.1058041900396347, -0.18521085381507874, -0.2449665069580078, 0.235212504863739, 0.48073646426200867, 0.127872496843338, -0.20040085911750793, 0.24805119633674622, -0.15493568778038025, 0.19634310901165009, 0.48913878202438354, 0.19531969726085663, 0.7712054252624512, 0.10255461931228638, 0.42058509588241577, -0.1452862024307251, -0.1996164172887802, -0.1609184443950653, -0.05021624267101288, 0.3610451817512512, -0.038630977272987366, -0.2003350555896759, 0.14559584856033325, -0.1653345674276352, -0.5603169798851013, 0.13265731930732727, -0.26050519943237305, -0.32092392444610596, -0.2383647859096527, 0.10514877736568451, 0.18075910210609436, 0.13727274537086487, 0.07103487849235535, 0.07945819944143295, 0.19569651782512665, 0.47093528509140015, 0.37656518816947937, 0.18676088750362396, -0.25199294090270996, 0.0813978984951973, -0.8549625277519226, 0.02509559690952301, -0.0077988095581531525, 0.37187376618385315, -0.2452135980129242, 0.28400668501853943, 0.28948265314102173, -0.1867104023694992, 0.5647758841514587, -0.28556376695632935, 0.09631911665201187, -0.14666514098644257, -0.10171163082122803, -0.5609168410301208, 0.03919217362999916, 0.1472456455230713, 0.4345385730266571, -0.2048841416835785, 0.3840600550174713, -0.16287419199943542, -0.1376141756772995, 0.11560073494911194, -0.4745601713657379, -0.10251796245574951, -0.23214195668697357, -0.27897971868515015, -0.4767875373363495, -0.4886607527732849, 0.3294573724269867, 0.32680922746658325, 0.2929244339466095, -0.05021248012781143, -0.0811145007610321, 0.0743635892868042, 0.10697150975465775, 0.13477064669132233, -0.13439221680164337, 0.20842355489730835, 0.07174818962812424, 0.03975721821188927, 0.08514297008514404, 0.10648991167545319, 0.25399455428123474, 0.3360605239868164, -0.00030637532472610474, -0.2687244117259979, 0.26280462741851807, 0.1445712000131607, 0.1646498739719391, 0.5682979226112366, 0.2464943379163742, 0.38736945390701294, 0.15087541937828064, 0.18254506587982178, -0.6216149926185608, 0.016619430854916573, 0.3386611342430115, -0.02722904458642006, -0.7182421088218689, 0.06979350745677948, 0.46476560831069946, -0.19788648188114166, 0.09781508147716522, 0.20742012560367584, 0.9158218502998352, -0.16986273229122162, 0.2686499357223511, 0.18696874380111694, 1.0896133184432983, -0.1746722012758255, 0.19821079075336456, 0.21037137508392334, -0.722187340259552, 0.4344913959503174, -0.30480682849884033, -0.01688985526561737, -0.4199788272380829, -0.2523021399974823, -0.10944494605064392, -0.2815026640892029, 0.06198379397392273, -0.37470823526382446, -0.11406400799751282, 0.10737881809473038, -0.2410946488380432, 0.3024697005748749, 0.030819546431303024, 0.1374528408050537, -0.5249733328819275, -0.19101309776306152, -0.29064124822616577, 0.07169928401708603, 0.007439237087965012, 0.5294772386550903, -0.1610669493675232, -0.2617763876914978, -0.4362768530845642, -0.09385399520397186, -0.30856195092201233, 0.15247824788093567, -0.0055192457512021065, -0.05348622798919678, -0.1322031319141388, 0.10296183824539185, 0.2081829309463501, -0.05289291962981224, 0.6611415147781372, 0.4141385555267334, -0.28375497460365295, 0.04848552122712135, -0.2005372941493988, -0.09788494557142258, -0.13923905789852142, -0.0773037001490593, -0.06679680943489075, -0.15868282318115234, -0.4070107936859131, -0.007059954106807709, -0.15226365625858307, -0.1813754290342331, -0.1273770034313202, 0.14050182700157166, -0.09222114086151123, -0.3336798846721649, -0.040648628026247025, -0.12953194975852966, 0.0337195061147213, -0.2407442033290863, 0.01141064241528511, 0.012429293245077133, -0.10770593583583832, -0.1570638120174408, 0.004096034914255142, -0.21720080077648163, -0.13379371166229248, 0.545667290687561, -0.04344563186168671, -0.02041844092309475, 0.33033299446105957, 0.11300984025001526, -0.1744108945131302, -0.12273026257753372, -0.08530981838703156, 0.4130399227142334, -0.6441500186920166, 0.2575520873069763, -0.1833505630493164, -0.11896606534719467, -0.34748712182044983, 0.3924836814403534, -0.0790148377418518, -0.2154444456100464, 0.20060314238071442, -0.2757212221622467, -0.3512105941772461, 0.10294124484062195, -0.3354746997356415, 0.26013651490211487, 0.2564582824707031, 0.3288767337799072, 0.0277900081127882, 0.267874538898468, -0.16188007593154907, 0.0841340720653534, -0.34548380970954895, 0.0634513646364212, 0.2940918207168579, -0.21855339407920837, 0.20930486917495728, -0.14408999681472778, -0.062163591384887695, 0.44314199686050415, -0.30883097648620605, -0.02360803261399269, -0.4261995255947113, 0.22570587694644928, 0.05014500021934509, -0.27963700890541077, -0.013810144737362862, -0.22093364596366882, 0.008262492716312408, -0.11879578232765198, 0.23065480589866638, 0.3790528476238251, 0.11446090042591095, -0.2872173488140106, 0.8558247685432434, -0.08764231950044632, -0.26176732778549194, 0.0041451044380664825, 0.30240941047668457, 0.04787096753716469, -0.40139663219451904, -0.10333411395549774, -0.2463398277759552, -0.06450754404067993, 0.1801128387451172, 0.22564375400543213, 0.3449157476425171, 0.025672441348433495, 0.23550423979759216, -0.23318077623844147, -0.06412996351718903, 0.051704443991184235, 0.45511770248413086, -0.06025432050228119, -0.19896289706230164, -0.2965849041938782, 0.13470035791397095, 0.02961057797074318, 0.021021753549575806, -0.2152271270751953, 0.39973098039627075, -0.117003433406353, -0.14008456468582153, 0.1580376774072647, 0.27205196022987366, -0.1978638470172882, -0.11890414357185364, 0.11635711044073105, 0.33671003580093384, -0.2378438264131546, -0.04837556183338165, 0.10119199752807617, 0.02547818049788475, 0.14287108182907104, 0.29397061467170715, 0.023457620292901993, 0.2766546308994293, 0.29742032289505005, 0.210804283618927, 0.11573535948991776, -0.03309473395347595, 0.05823827534914017, 0.2736506760120392, -0.324593722820282, -0.0382392518222332, -0.025670617818832397, 0.1463163197040558, 0.10645709186792374, -0.07574091851711273, 0.3479346036911011, -0.11140566319227219, -0.29982855916023254, -0.42044031620025635, 0.37388160824775696, -0.2602461576461792, -0.022851653397083282, 0.25546079874038696, -0.14533846080303192, -0.0712820515036583, -0.11702392995357513, -0.13901770114898682, -0.12178435921669006, -0.008702017366886139, 0.0765683576464653, 0.14861109852790833, -0.06415117532014847, -0.1571747362613678, 0.19108498096466064, 0.20251207053661346, -0.08224181830883026, 0.30882665514945984, -0.051677629351615906, -0.247260183095932, -0.3001663386821747, 0.3465855121612549, 0.5801001787185669, 0.21281667053699493, 0.1995580643415451, 0.41208431124687195, 0.36121809482574463, 0.11971183121204376, 0.41320377588272095, 0.13190266489982605, 0.19167374074459076, -0.041191037744283676, 0.23677800595760345, -0.003565012477338314, -0.04796324670314789, -0.35456153750419617, 0.04176229611039162, 0.49659985303878784, -0.30751925706863403, 0.4628637135028839, -0.38475388288497925, -0.03395792469382286, -0.07698320597410202, 0.23107510805130005, -0.055219512432813644, 0.23542246222496033, 0.10873501002788544, -0.17595596611499786, 0.047524385154247284, -0.34493258595466614, -0.017972394824028015, -0.11183403432369232, 0.3895779550075531, 0.3655734062194824, -0.06961458176374435, -0.45532044768333435, -0.14687861502170563, -0.27491384744644165, 0.2342330664396286, -0.17321929335594177, 0.3482787013053894, 0.18249988555908203, -0.0839209035038948, -0.22599542140960693, -0.10861234366893768, 0.22139368951320648, 0.19865788519382477, -0.09233257919549942, 0.16285356879234314, 0.0002676472067832947, 0.1219923198223114, -0.1286780834197998, -0.15780620276927948, -0.03249895200133324, -0.1866808831691742, 0.7305676937103271, 0.0941038504242897, -0.08685699105262756, -0.1000983864068985, -0.1635679006576538, 0.13818643987178802, -0.29198741912841797, 0.283661425113678, 0.3410094976425171, 0.10857168585062027, -0.13930024206638336, -0.441011905670166, -0.2743636667728424, -0.3339282274246216, -0.03461097925901413, -0.06725732237100601, -0.1890740990638733, 0.4599016308784485, 0.06673619151115417, -0.3444191813468933, -0.20428705215454102, 0.32984721660614014, 0.06485320627689362, 0.0831616073846817, -0.050448112189769745, -0.03171028196811676, -0.12249046564102173, -0.012857693247497082, 0.4358018934726715, 0.06903090327978134, 0.24352125823497772, 0.4985155463218689, -0.29088449478149414, -0.3511469066143036, 0.5450422167778015, 0.06484831869602203, -0.22654584050178528, 0.135393425822258, 0.37824806571006775, 0.21423843502998352, -0.18484456837177277, -0.35232770442962646, 0.01831641048192978, 0.10133238881826401, 0.025120913982391357, -0.24173960089683533, 0.3829624354839325, -0.2507880926132202, -0.04555033519864082, 0.02394169196486473, 0.17772594094276428, 0.01173708401620388, -0.14647261798381805, 0.30899137258529663, -0.2694498896598816 ]
https://github.com/huggingface/datasets/issues/6490
`load_dataset(...,save_infos=True)` not working without loading script
Also, once the README.md exists in the python environment it is used when loading another dataset in the same format (e.g. json) since it always resolves the path to the same directory. The consequence here is any other dataset won't load because of infos mismatch. To reproduce this aspect: 1. Do a `load_datasets(...,save_infos=True)` with one dataset without a loading script 2. Try to load another dataset without a loading script in the same format (e.g. json) but with a different schema
### Describe the bug It seems that saving a dataset infos back into the card file is not working for datasets without a loading script. After tracking the problem a bit it looks like saving the infos uses `Builder.get_imported_module_dir()` as its destination directory. Internally this is a call to `inspect.getfile()` but since the actual builder class used is dynamically created (cf. `datasets.load.configure_builder_class`) this method actually return te path to the parent builder class (e.g. `datasets.packaged_modules.json.JSON`). ### Steps to reproduce the bug 1. Have a local dataset without any loading script 2. Make sure there are no dataset infos in the README.md 3. Load with `save_infos=True` 4. No change in the dataset README.md 5. A new README.md file is created in the directory of the parent builder class (e.g. for json in `.../site-packages/datasets/packaged_modules/json/README.md`) ### Expected behavior The dataset README.md should be updated and no file should be created in the python environment. ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-6.2.0-37-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.3 - `fsspec` version: 2023.6.0
81
`load_dataset(...,save_infos=True)` not working without loading script ### Describe the bug It seems that saving a dataset infos back into the card file is not working for datasets without a loading script. After tracking the problem a bit it looks like saving the infos uses `Builder.get_imported_module_dir()` as its destination directory. Internally this is a call to `inspect.getfile()` but since the actual builder class used is dynamically created (cf. `datasets.load.configure_builder_class`) this method actually return te path to the parent builder class (e.g. `datasets.packaged_modules.json.JSON`). ### Steps to reproduce the bug 1. Have a local dataset without any loading script 2. Make sure there are no dataset infos in the README.md 3. Load with `save_infos=True` 4. No change in the dataset README.md 5. A new README.md file is created in the directory of the parent builder class (e.g. for json in `.../site-packages/datasets/packaged_modules/json/README.md`) ### Expected behavior The dataset README.md should be updated and no file should be created in the python environment. ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-6.2.0-37-generic-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.3 - `fsspec` version: 2023.6.0 Also, once the README.md exists in the python environment it is used when loading another dataset in the same format (e.g. json) since it always resolves the path to the same directory. The consequence here is any other dataset won't load because of infos mismatch. To reproduce this aspect: 1. Do a `load_datasets(...,save_infos=True)` with one dataset without a loading script 2. Try to load another dataset without a loading script in the same format (e.g. json) but with a different schema
[ -0.4919635057449341, 0.22427961230278015, 0.13527803122997284, 0.4852665066719055, 0.47176849842071533, 0.11189969629049301, 0.3482665717601776, 0.15804527699947357, 0.22043921053409576, 0.08041861653327942, 0.14106868207454681, 0.4444196820259094, -0.011690475977957249, 0.19588156044483185, 0.21268872916698456, 0.33730173110961914, -0.09457249194383621, 0.14236454665660858, -0.1201694905757904, 0.05272836238145828, -0.21206477284431458, 0.035287417471408844, -0.19017791748046875, -0.08489497005939484, -0.4773678481578827, 0.23864151537418365, -0.04664749652147293, 0.4366922080516815, 0.08413207530975342, -0.40182816982269287, 0.39586973190307617, -0.03622046485543251, 0.1927085518836975, 0.3792871832847595, -0.00011824221292044967, 0.05757880210876465, 0.3900054693222046, -0.16650885343551636, -0.4850439429283142, -0.5072750449180603, -0.3807430863380432, -0.3608664274215698, 0.11445669084787369, -0.20170237123966217, -0.13050706684589386, -0.30152344703674316, 0.1025484949350357, -0.30168166756629944, 0.03786197304725647, 0.20030450820922852, 0.1604764759540558, 0.07176002115011215, -0.1295434683561325, -0.13266655802726746, 0.11889562755823135, 0.4112083911895752, 0.1419123411178589, 0.2688640058040619, -0.0338941290974617, -0.1333169788122177, 0.1287764012813568, 0.30791619420051575, -0.31467723846435547, -0.3499792516231537, 0.5984265804290771, 0.12272516638040543, 0.3323505222797394, -0.08905535936355591, 0.24446365237236023, 0.22815880179405212, 0.5884866118431091, -0.3812199831008911, -0.34571871161460876, -0.5476942658424377, -0.012709374539554119, -0.06834333389997482, 0.3273792862892151, 0.21312089264392853, -0.06580298393964767, 0.0750560313463211, 0.018427368253469467, -0.32629072666168213, 0.12866191565990448, -0.06719930469989777, -0.005155254155397415, -0.009931981563568115, -0.1455114483833313, 0.03024967387318611, -0.2635367512702942, 0.010961288586258888, 0.441893607378006, -0.4826909899711609, -0.32519739866256714, 0.2760459780693054, -0.08970190584659576, 0.2576383948326111, 0.33046337962150574, 0.24525299668312073, -0.11872944980859756, 0.3165018558502197, 0.013242488726973534, 0.22083890438079834, -0.07422027736902237, 0.19284850358963013, 0.3449094593524933, 0.04438846930861473, 0.20445787906646729, 0.3646496832370758, 0.23995597660541534, 0.3364662528038025, -0.1887860894203186, -0.16961675882339478, -0.07710135728120804, 0.003922429867088795, 0.18821635842323303, -0.08159384876489639, 0.177713543176651, -0.1297059804201126, -0.09509962797164917, 0.24062874913215637, 0.12332127243280411, -0.007645091507583857, 0.13718794286251068, 0.5757016539573669, -0.214419424533844, 0.2904318869113922, 0.23762337863445282, 0.00935911014676094, -0.1088000163435936, 0.1364835500717163, -0.1855531483888626, -0.11974823474884033, -0.14970973134040833, 0.16777528822422028, 0.1793166846036911, -0.18864408135414124, 0.3859708309173584, 0.18723702430725098, -0.24437521398067474, -0.17382743954658508, -0.16744139790534973, 0.02307206764817238, 0.252400279045105, 0.4556206464767456, 0.1735365241765976, 0.29385894536972046, 0.031229916960000992, -0.2069709300994873, -0.0894082561135292, 0.2991907596588135, -0.3490280508995056, -0.2553075850009918, 0.10553255677223206, 0.12039117515087128, -0.2655090093612671, 0.09626401960849762, -0.20197126269340515, -0.13019368052482605, 0.19454917311668396, -0.2871304154396057, 0.0588311105966568, -0.23019807040691376, -0.3017134368419647, -0.18975457549095154, 0.41103866696357727, 0.6502851843833923, -0.17142149806022644, -0.21704597771167755, 0.0740400105714798, -0.13861770927906036, -0.08222750574350357, -0.08674505352973938, -0.3038117587566376, 0.5277004837989807, -0.33734485507011414, -0.22423355281352997, 0.5024397373199463, -0.3275897800922394, -0.3685244917869568, 0.11668287217617035, -0.0545111745595932, 0.3279322683811188, -0.0027079060673713684, 0.19049666821956635, -0.2284305840730667, -0.05327760428190231, 0.13671761751174927, 0.32526838779449463, 0.13696321845054626, 0.19856055080890656, -0.06448337435722351, -0.1958923637866974, 0.04749137535691261, -0.02047005668282509, 0.12823331356048584, 0.045217365026474, 0.11015995591878891, 0.13272134959697723, 0.42314398288726807, -0.057271089404821396, -0.039077453315258026, 0.29077404737472534, 0.19980789721012115, 0.022228632122278214, 0.15246644616127014, -0.0798688605427742, -0.6985900402069092, 0.41283610463142395, -0.2812158465385437, -0.3370819091796875, -0.13545146584510803, -0.11862677335739136, -0.004574987106025219, -0.06284655630588531, -0.3906468152999878, -0.1703246682882309, -0.014376623556017876, 0.3019352853298187, -0.13640666007995605, 0.027301982045173645, -0.3671349585056305, 0.4161284565925598, -0.25097182393074036, 0.18816566467285156, -0.41497349739074707, 0.22892612218856812, 0.19398391246795654, -0.29834240674972534, -0.03125668317079544, 0.07806409895420074, 0.18510054051876068, -0.11493435502052307, -0.10919225215911865, 0.5091590881347656, 0.1291625201702118, 0.33592313528060913, -0.36158016324043274, -0.2064027339220047, 0.08860073238611221, -0.06266625970602036, -0.10156580060720444, -0.022845525294542313, 0.36130058765411377, -0.09573855996131897, -0.33590981364250183, 0.30373674631118774, -0.16177649796009064, 0.2930753529071808, 0.18813858926296234, -0.11047770082950592, 0.06137189269065857, -0.08900709450244904, -0.09780240803956985, -0.19130006432533264, 0.0465703122317791, 0.3251187801361084, 0.22125662863254547, 0.1641491800546646, -0.16483628749847412, 0.12265951186418533, 0.3807365596294403, 0.13050410151481628, 0.051151156425476074, -0.10320114344358444, -0.23721051216125488, -0.022492073476314545, 0.08222921937704086, 0.15210434794425964, 0.44436442852020264, 0.08859656006097794, -0.12422756850719452, 0.2515198290348053, -0.00033286213874816895, -0.10135073214769363, 0.378043532371521, 0.15329253673553467, 0.17153525352478027, 0.3028101623058319, 0.05782128870487213, 0.14315834641456604, -0.24846193194389343, 0.19673104584217072, 0.0008942745625972748, -0.06788074225187302, -0.535574197769165, 0.20003220438957214, -0.40937045216560364, -0.19182509183883667, -0.19745662808418274, -0.2814998924732208, -0.2851894199848175, -0.26081663370132446, -0.2682395577430725, 0.2844981849193573, -0.05065514147281647, -0.05918221175670624, -0.035731665790081024, 0.1583346277475357, -0.2343425750732422, -0.43752697110176086, -0.29543620347976685, -0.11557961255311966, -0.185458242893219, -0.11258897185325623, 0.3972390592098236, 0.262960821390152, 0.1025758609175682, -0.23175498843193054, -0.001911425031721592, -0.1846248358488083, -0.06016572564840317, 0.18057414889335632, 0.12383783608675003, 0.3054972290992737, 0.1907423734664917, -0.009797058999538422, 0.3362806439399719, 0.06551318615674973, 0.22450880706310272, -0.05204053223133087, 0.014753887429833412, 0.011029491201043129, 0.11451523751020432, -0.12869428098201752, -0.3740030527114868, -0.13446518778800964, 0.054563723504543304, -0.2921253740787506, 0.08245058357715607, 0.1941821426153183, 0.17287710309028625, 0.22139513492584229, 0.16646364331245422, 0.11078950017690659, -0.4709973633289337, 0.023639801889657974, -0.12910562753677368, -0.5550045371055603, 0.3923901617527008, -0.25746503472328186, -0.40808695554733276, 0.26144760847091675, 0.04357054829597473, 0.21856723725795746, -0.12701262533664703, -0.4215736985206604, 0.17169378697872162, -0.08630211651325226, -0.02299502305686474, 0.09046797454357147, 0.3747577369213104, 0.2640834450721741, 0.06586594879627228, 0.09382084757089615, -0.1345573365688324, -0.19632570445537567, 0.08058512955904007, 0.048438288271427155, 0.3296056389808655, -0.1519531011581421, 0.1872301995754242, -0.13226385414600372, 0.1584833264350891, 0.1736096292734146, -0.007597476243972778, 0.26923781633377075, -0.21304774284362793, 0.8292006850242615, -0.3959234058856964, -0.2763271927833557, -0.3023560047149658, 0.044676266610622406, -0.17459708452224731, 0.1012321412563324, -0.01603436842560768, 0.26033398509025574, -0.40432995557785034, -0.07511362433433533, 0.09897889941930771, -0.3900530934333801, 0.09909294545650482, -0.17301300168037415, -0.08944020420312881, 0.2418186366558075, 0.39473140239715576, -0.1684381365776062, -0.07125475257635117, 0.10085499286651611, 0.4097997546195984, 0.28667107224464417, -0.0714602917432785, -0.1325334906578064, -0.2025592029094696, -0.1454494595527649, 0.04531540721654892, -0.005096639972180128, 0.1611253172159195, 0.03205549344420433, 0.002840586006641388, 0.03284405544400215, -0.08539709448814392, 0.21507874131202698, -0.1407071202993393, 0.09033603966236115, 0.3214641511440277, -0.03945993259549141, -0.5202383995056152, -0.13457784056663513, 0.2358805537223816, -0.05711844190955162, -0.1513369083404541, 0.4126027822494507, 0.002206943929195404, -0.26083695888519287, 0.08463697880506516, 0.20020949840545654, -0.29626554250717163, -0.18960411846637726, -0.46431848406791687, 0.0003005005419254303, -0.38678812980651855, -0.25002700090408325, -0.09769418090581894, 0.12839213013648987, -0.00645260326564312, -0.04578730836510658, -0.20837411284446716, -0.051363032311201096, -0.05446241796016693, -0.09075905382633209, 0.3776136040687561, 0.06433329731225967, 0.26112329959869385, 0.3485864996910095, 0.1837824285030365, 0.20891158282756805, 0.7893605828285217, -0.0551636628806591, -0.22993728518486023, 0.020658191293478012, -0.07731515914201736, 0.431550532579422, 0.34382712841033936, -0.2413129210472107, -0.19288083910942078, 0.011452422477304935, -0.1030159592628479, -0.4517906904220581, -0.07351914048194885, 0.0023764194920659065, -0.14147363603115082, -0.19415515661239624, -0.6341943740844727, 0.5777969360351562, -0.1485898196697235, -0.00797591358423233, 0.3437846302986145, -0.06882226467132568, -0.36090973019599915, 0.18577627837657928, -0.0157620906829834, 0.7044552564620972, 0.10880985856056213, 0.2541565001010895, 0.21671614050865173, -0.022865114733576775, 0.34631919860839844, 0.011763643473386765, 0.008636672049760818, -0.47205591201782227, -0.09658588469028473, -0.060285985469818115, -0.2321232557296753, 0.26296404004096985, 0.037006597965955734, -0.08246016502380371, 0.4033883213996887, -0.15729308128356934, 0.17793741822242737, 0.028293224051594734, 0.22324073314666748, -0.31890869140625, -0.3522525727748871, -0.3908747434616089, 0.04981408268213272, 0.22885458171367645, 0.3349798917770386, -0.07734902948141098, -0.034898541867733, -0.15357017517089844, -0.06544801592826843, -0.061191659420728683, 0.36365053057670593, -0.29045379161834717, -0.03915389999747276, 0.04355664178729057, 0.017277255654335022, 0.026636209338903427, 0.22298668324947357, -0.07064506411552429, 0.2002038210630417, -0.21022823452949524, 0.23004046082496643, -0.30193811655044556, 0.20570708811283112, -0.07905029505491257, -0.03943762928247452, 0.4670698046684265, 0.16116094589233398, -0.08535636961460114, 0.09229591488838196, -0.44855189323425293, 0.10332202911376953, 0.17889800667762756, 0.0726042315363884, 0.23944972455501556, -0.20569822192192078, -0.2724451422691345, 0.07779723405838013, 0.3938802480697632, -0.13748472929000854, 0.0904466062784195, 0.26185697317123413, 0.11766136437654495, 0.253537118434906, -0.22908221185207367, -0.30576878786087036, -0.05188564583659172, 0.539665699005127, -0.21997880935668945, -0.07221631705760956, 0.4379061162471771, -0.001079309731721878, -0.0568176805973053, -0.20333009958267212, 0.43278491497039795, 0.34589165449142456, -0.1647513210773468, 0.06903765350580215, 0.0908893346786499, 0.017400220036506653, -0.009451433084905148, 0.20047928392887115, -0.07763850688934326, -0.31702721118927, -0.17509394884109497, -0.3719165623188019, -0.2661493420600891, 0.0336877778172493, 0.08581453561782837, 0.08968537300825119, 0.06019175052642822, -0.10889986157417297, 0.15832197666168213, -0.04494406282901764, -0.23210878670215607, 0.09154179692268372, 0.03114892728626728, 0.10851049423217773, 0.020997149869799614, 0.3404780328273773, 0.14306879043579102, -0.31571245193481445, 0.010848252102732658, 0.03627201169729233, 0.001497630961239338, -0.15635064244270325, -0.26640740036964417, 0.16605904698371887, 0.19908860325813293, 0.21000149846076965, -0.08477665483951569, -0.4026588201522827, -0.1324930191040039, -0.3539981245994568, 0.24452534317970276, 0.164036363363266, -0.04783955216407776, -0.032720670104026794, 0.04223235324025154, 0.17252224683761597, -0.3125014901161194, 0.1462065875530243, -0.3986929655075073, 0.16656173765659332, -0.04300766810774803, -0.06495267897844315, -0.47601431608200073, 0.06016269326210022, 0.04938642308115959, 0.11113190650939941, -0.09382800757884979, 0.16309845447540283, 0.531139075756073, -0.23687182366847992, -0.03545631468296051, 0.06392976641654968, 0.11469538509845734, 0.39614489674568176, -0.18965333700180054, -0.10776135325431824, 0.1644403338432312, 0.09621575474739075, -0.20600172877311707, -0.03881406411528587, -0.0039039310067892075, 0.007297698874026537, -0.019810570403933525, 0.14052392542362213, 0.16718539595603943, -0.29812315106391907, -0.27136099338531494, 0.11382921785116196, 0.42529353499412537, -0.10019789636135101, 0.28943976759910583, 0.43660497665405273, 0.12062129378318787, 0.29140564799308777, 0.26167482137680054, 0.12296722829341888, 0.22409947216510773, 0.6904889345169067, -0.12648305296897888, 0.17941585183143616, 0.06833795458078384, 0.1169218048453331, -0.08030837029218674, -0.6053560972213745, 0.20570334792137146, 0.09458275139331818, -0.04557912051677704, 0.05508003383874893, -0.12405450642108917, 0.19542601704597473, -0.3318668007850647, 0.19425852596759796, -0.0144882220774889, 0.23593679070472717, -0.1309693455696106, -0.1239117980003357, -0.13820332288742065, -0.17154169082641602, 0.06974266469478607, 0.023721348494291306, 0.08674880862236023, -0.21402229368686676, -0.17784443497657776, 0.14876866340637207, -0.177071675658226, -0.06628704071044922, -0.0357353538274765, 0.11806488782167435, 0.027742773294448853, -0.32216545939445496, 0.12129932641983032, -0.10970190167427063, -0.06124274432659149, 0.12549537420272827, 0.18946854770183563, 0.4179531931877136, 0.3371010720729828, 0.1588304042816162, 0.18835605680942535, 0.06455008685588837, -0.06270646303892136, -0.1248902827501297, 0.1427852213382721, -0.1929090917110443, -0.014720737934112549, 0.2584262490272522, 0.13099230825901031, -0.13017801940441132, -0.3180876672267914, 0.23509261012077332, 0.42962151765823364, -0.2095101773738861, 0.5585761070251465, -0.027723222970962524, -0.016087308526039124, -0.19482465088367462, 0.12171902507543564, -0.15785875916481018, -0.09775598347187042, 0.6227870583534241, 0.07240402698516846, 0.2345968782901764, -0.06486497074365616, 0.06310991197824478, 0.03149224817752838, 0.47720959782600403, 0.2103574424982071, -0.36732718348503113, -0.14616042375564575, 0.010520800948143005, -0.8327064514160156, -0.13133054971694946, 0.33605778217315674, 0.01595844142138958, 0.19726398587226868, 0.13108870387077332, -0.06890527158975601, -0.11547382175922394, 0.14945898950099945, 0.09934622794389725, 0.42537036538124084, -0.024255268275737762, -0.10473299026489258, -0.3271118998527527, -0.39196640253067017, 0.00456888135522604, -0.12566183507442474, -0.4388872981071472, 0.05680707097053528, -0.5012510418891907, -0.01918988674879074, 0.0021349843591451645, -0.05723551660776138, -0.033304326236248016, 0.08151943981647491, 0.5834273099899292, -0.18935492634773254, -0.011328451335430145, -0.003308802843093872, -0.1035083755850792, -0.35389992594718933, -0.037581685930490494, -0.056667376309633255, 0.2751624882221222, -0.0704667717218399, 0.32256802916526794, -0.3189772069454193, -0.0003509819507598877, -0.5139651894569397, -0.09675861895084381, 0.21185098588466644, 0.016929907724261284, -0.3437303900718689, 0.1788235604763031, -0.2974097430706024, 0.35333749651908875, 0.07448254525661469, 0.05388909950852394, -0.16121654212474823, 0.21688424050807953, -0.2747080326080322, -0.2413661628961563, 0.5161939859390259, -0.17306503653526306, -0.18294450640678406, -0.2204076647758484, 0.4070802628993988, -0.34451615810394287, -0.05425311625003815, -0.5916758179664612, 0.10966788977384567, 0.38994038105010986, -0.16231229901313782, -0.1581588089466095, -0.04059271141886711, -0.264180064201355, 0.32213282585144043, -0.22162121534347534, 0.14688219130039215, 0.09969036281108856, -0.10288471728563309, -0.08416812866926193, -0.1921115517616272 ]
https://github.com/huggingface/datasets/issues/6488
429 Client Error
I'm getting a similar issue even though I've already downloaded the dataset 😅 ``` huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/HuggingFaceM4/WebSight ```
Hello, I was downloading the following dataset and after 20% of data was downloaded, I started getting error 429. It is not resolved since a few days. How should I resolve it? Thanks Dataset: https://huggingface.co/datasets/cerebras/SlimPajama-627B Error: `requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/datasets/cerebras/SlimPajama-627B/resolve/2d0accdd58c5d5511943ca1f5ff0e3eb5e293543/train/chunk1/example_train_3300.jsonl.zst`
25
429 Client Error Hello, I was downloading the following dataset and after 20% of data was downloaded, I started getting error 429. It is not resolved since a few days. How should I resolve it? Thanks Dataset: https://huggingface.co/datasets/cerebras/SlimPajama-627B Error: `requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/datasets/cerebras/SlimPajama-627B/resolve/2d0accdd58c5d5511943ca1f5ff0e3eb5e293543/train/chunk1/example_train_3300.jsonl.zst` I'm getting a similar issue even though I've already downloaded the dataset 😅 ``` huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/HuggingFaceM4/WebSight ```
[ 0.02211528643965721, -0.2960439920425415, -0.005823493003845215, 0.38508784770965576, 0.11384490132331848, -0.0017009451985359192, -0.05616353079676628, 0.37640678882598877, -0.20437386631965637, 0.0015219524502754211, -0.1925979107618332, -0.2489209771156311, 0.173841193318367, -0.048468153923749924, -0.03183656558394432, -0.1046554446220398, -0.1687750220298767, -0.011998265981674194, -0.2413991093635559, 0.019596949219703674, -0.09679225087165833, 0.07778935134410858, -0.02407662197947502, 0.10562267154455185, -0.3127421438694, -0.19333390891551971, -0.01258937269449234, 0.26902955770492554, -0.38134175539016724, -0.18884022533893585, 0.212845578789711, -0.0800073891878128, 0.34856054186820984, 0.16972096264362335, -0.00012080527085345238, -0.12274481356143951, 0.17395761609077454, 0.010570591315627098, -0.12799669802188873, 0.17027442157268524, -0.2774662971496582, -0.22907552123069763, 0.10237962007522583, -0.1622866541147232, 0.21392634510993958, -0.10857436060905457, -0.17052598297595978, 0.1629962921142578, 0.807856023311615, 0.15897831320762634, 0.09271514415740967, -0.07334742695093155, 0.06057165190577507, 0.2525217533111572, -0.022386081516742706, -0.1384662389755249, 0.08769966661930084, -0.036449968814849854, 0.33533862233161926, 0.033344440162181854, -0.07884954661130905, 0.3439878821372986, 0.18250203132629395, 0.34871765971183777, 0.06923799961805344, -0.35015207529067993, -0.21476352214813232, -0.5267685651779175, -0.03012102097272873, 0.3858460783958435, 0.6945130825042725, 0.2208673655986786, -0.2108898162841797, -0.19810298085212708, 0.09015326201915741, -0.05505067855119705, 0.2105388343334198, 0.291419118642807, -0.1360643357038498, 0.028717271983623505, -0.23062191903591156, -0.39864012598991394, -0.1499391496181488, -0.09339645504951477, -0.20500905811786652, 0.058033645153045654, -0.1344936639070511, 0.15722402930259705, 0.2986440062522888, -0.16704170405864716, -0.006266347132623196, 0.007375139743089676, -0.13419115543365479, 0.14716647565364838, -0.5640112161636353, -0.28648805618286133, 0.18022149801254272, 0.515166163444519, 0.28289249539375305, 0.1954701840877533, 0.5186325311660767, 0.16659274697303772, -0.1487334817647934, -0.018233008682727814, 0.2982443869113922, 0.09625548124313354, -0.12135636061429977, -0.15716277062892914, 0.43522942066192627, 0.2685542404651642, 0.19778071343898773, 0.18445748090744019, -0.09976399689912796, -0.13527388870716095, -0.24282540380954742, -0.08042296022176743, 0.3356567621231079, -0.1320084184408188, -0.19239211082458496, 0.10552158951759338, -0.5434109568595886, -0.05330616235733032, 0.37251755595207214, 0.10143125057220459, -0.1702324002981186, 0.3439062237739563, 0.04682125896215439, -0.14157623052597046, -0.13852271437644958, -0.3579619228839874, -0.03642057254910469, 0.1915024220943451, -0.030987216159701347, -0.04886642098426819, 0.07293745875358582, -0.044728804379701614, -0.0712929293513298, -0.12990741431713104, 0.03675246611237526, -0.3427143692970276, 0.20771585404872894, -0.03445683419704437, -0.11006846278905869, 0.23786665499210358, -0.021788833662867546, 0.20400705933570862, -0.059739429503679276, 0.1936252862215042, -0.0498356856405735, -0.0346483439207077, -0.5439447164535522, -0.3908381462097168, 0.06323633342981339, 0.1129649206995964, -0.05446399748325348, 0.14783239364624023, -0.16570985317230225, -0.19272999465465546, -0.07151491194963455, -0.024895694106817245, 0.13824062049388885, 0.014315837994217873, 0.022900473326444626, 0.045711368322372437, 0.1046685203909874, 0.620095431804657, -0.19022776186466217, -0.049949225038290024, -0.1373066008090973, -0.16448448598384857, -0.14149457216262817, 0.3961647152900696, -0.2379811853170395, 0.3473072052001953, -0.1570238173007965, 0.01206718385219574, 0.4891650974750519, -0.27054688334465027, -0.7099472284317017, 0.14452166855335236, -0.14127925038337708, -0.021446648985147476, -0.18661713600158691, 0.22878876328468323, 0.1014765202999115, -0.01386451255530119, 0.14355605840682983, 0.11015583574771881, 0.08207878470420837, 0.1546168029308319, -0.05955947935581207, -0.2779209613800049, -0.27501630783081055, 0.1717340648174286, -0.23584996163845062, -0.09915047138929367, 0.07573121786117554, -0.0683489739894867, 0.35600802302360535, -0.07451164722442627, 0.25269559025764465, 0.3825383186340332, 0.4632791578769684, 0.2157362401485443, -0.06525500863790512, 0.08715910464525223, -0.43034517765045166, 0.04382406175136566, -0.3010740876197815, -0.044784754514694214, -0.19630517065525055, -0.06468016654253006, -0.11080925166606903, 0.041418738663196564, -0.20917876064777374, 0.2387789934873581, -0.04966718703508377, -0.13532885909080505, 0.22673183679580688, -0.05465775728225708, -0.023815229535102844, 0.45109379291534424, 0.01545443944633007, 0.28611597418785095, -0.4075610935688019, 0.44216930866241455, -0.04588839411735535, 0.0971715971827507, 0.44565898180007935, 0.0059188008308410645, 0.18009474873542786, -0.31053218245506287, 0.08293856680393219, 0.130767822265625, -0.2981671094894409, 0.20262107253074646, 0.3175387680530548, 0.2573792338371277, 0.2915685474872589, -0.16541464626789093, -0.18329639732837677, -0.02008652687072754, 0.17613787949085236, 0.18552392721176147, 0.19184425473213196, 0.04582979530096054, 0.30574914813041687, 0.10779575258493423, -0.0642339438199997, 0.19110703468322754, 0.275468111038208, -0.0722016990184784, -0.06929526478052139, 0.17684821784496307, 0.2932994067668915, -0.16481201350688934, -0.010671323165297508, -0.052007220685482025, 0.05339415371417999, -0.02757609635591507, 0.12089245021343231, -0.11453807353973389, 0.11127997934818268, 0.24859699606895447, 0.13788041472434998, -0.12259703874588013, 0.33689090609550476, 0.016551222652196884, 0.18521380424499512, -0.15951693058013916, -0.06919360160827637, -0.03088858537375927, 0.25009050965309143, -0.08397141098976135, -0.1013064756989479, 0.21501357853412628, 0.06775953620672226, 0.007385730743408203, 0.03865247592329979, -0.11901139467954636, -0.205349862575531, -0.30599403381347656, 0.17045047879219055, 0.2907586693763733, -0.21190784871578217, -0.038560349494218826, -0.28060978651046753, -0.22055509686470032, -0.04316558688879013, -0.32756027579307556, -0.4374304711818695, -0.30062583088874817, -0.060241661965847015, 0.016379104927182198, -0.15448088943958282, 0.19101500511169434, -0.1230880469083786, 0.3418419659137726, 0.3532926142215729, 0.2090701013803482, -0.15848000347614288, 0.0979447066783905, 0.11503668129444122, 0.008910655975341797, -0.010426436550915241, -0.2568134367465973, 0.18704426288604736, -0.28275826573371887, 0.28889548778533936, -0.3843104839324951, -0.24094080924987793, 0.17368707060813904, 0.12889152765274048, 0.04978112503886223, 0.024970434606075287, 0.5536835789680481, -0.0030403397977352142, 0.12242546677589417, 0.18565882742404938, 0.11791546642780304, 0.0588100329041481, -0.01903802715241909, 0.1256195455789566, 0.2394663542509079, 0.3131018579006195, -0.01471555233001709, -0.024567050859332085, -0.4143623411655426, 0.1953059583902359, -0.17560425400733948, 0.2709994912147522, -0.2337188720703125, -0.10051023215055466, 0.1474781185388565, -0.43176016211509705, -0.001248091459274292, 0.059731677174568176, -0.44767895340919495, 0.26306769251823425, -0.08138709515333176, -0.16584768891334534, 0.26871275901794434, 0.13972817361354828, 0.11616478860378265, -0.07289066165685654, -0.5879154205322266, -0.25355854630470276, -0.3015245199203491, 0.055601198226213455, -0.35541900992393494, -0.012927504256367683, 0.21554887294769287, -0.15514013171195984, 0.005494518205523491, 0.1502632200717926, -0.005395745858550072, -0.04797958582639694, 0.22064560651779175, 0.5088876485824585, 0.0024923402816057205, 0.2598956823348999, 0.010983012616634369, 0.43342018127441406, 0.6063065528869629, 0.1711193472146988, 0.5159101486206055, 0.354915589094162, 0.0047531574964523315, 0.263847291469574, -0.003996545448899269, 0.006073096767067909, 0.033337049186229706, 0.34207433462142944, 0.4024461507797241, 0.3908817768096924, 0.2736872434616089, -0.4294758141040802, -0.40323635935783386, -0.375956654548645, -0.42216333746910095, -0.13396140933036804, 0.11682166159152985, 0.1847480982542038, 0.048861388117074966, -0.2609182894229889, 0.12742318212985992, -0.13496467471122742, -0.04045795649290085, 0.2725135385990143, 0.16916969418525696, 0.05717427656054497, -0.36935722827911377, -0.0041428725235164165, -0.4859957695007324, 0.5357804298400879, 0.1011798158288002, 0.17850780487060547, 0.01013265922665596, 0.2660069763660431, 0.22866134345531464, -0.05347266420722008, 0.41266101598739624, 0.10455725342035294, 0.3368294835090637, -0.47814586758613586, 0.040852613747119904, -0.03381626307964325, 0.18355172872543335, 0.1067550778388977, 0.2997492849826813, 0.4986858665943146, -0.000426366925239563, -0.38495418429374695, -0.01391720399260521, -0.0496046245098114, -0.06923104077577591, -0.2585243284702301, -0.27846968173980713, -0.13318462669849396, -0.5641449689865112, -0.3142164647579193, 0.021718062460422516, -0.11374243348836899, 0.24254055321216583, 0.25106802582740784, -0.4566757082939148, 0.37862998247146606, -0.37844839692115784, 0.0009844675660133362, -0.19215507805347443, -0.00561861228197813, 0.1370159089565277, 0.1254798173904419, 0.08365263044834137, 0.4034497141838074, 0.5834079384803772, 0.7088326811790466, -0.08457684516906738, -0.4048428535461426, -0.039648182690143585, 0.3350074887275696, -0.034223563969135284, 0.33352142572402954, 0.08475395292043686, 0.21330177783966064, 0.35794055461883545, 0.46672385931015015, -0.2936848998069763, 0.2175396829843521, 0.3156011700630188, 0.037631064653396606, -0.674460768699646, -0.010972325690090656, 0.46372634172439575, -0.005622792989015579, -0.08742163330316544, 0.4107286334037781, 0.4129238724708557, -0.029949655756354332, -0.47838282585144043, 0.16347752511501312, 1.0220469236373901, -0.1873437464237213, -0.02937057986855507, -0.07064017653465271, -0.3311727046966553, 0.6450239419937134, -0.2528000473976135, 0.31367963552474976, -0.2405340075492859, -0.023540068417787552, -0.0823076069355011, -0.19304370880126953, 0.30400434136390686, -0.03784888982772827, 0.1260887235403061, 0.14347077906131744, -0.04844484105706215, 0.23974035680294037, -0.05344696342945099, 0.30151692032814026, -0.43000224232673645, 0.03617454692721367, -0.3196429908275604, 0.057719193398952484, -0.40350693464279175, 0.37980353832244873, -0.2301449179649353, -0.09313266724348068, -0.1912856101989746, -0.34796226024627686, 0.04230073094367981, -0.028304703533649445, -0.21220986545085907, 0.08146699517965317, -0.03867746517062187, -0.3292747139930725, 0.1847103387117386, 0.19416895508766174, -0.32569801807403564, 0.015252728015184402, -0.4027330279350281, 0.36377426981925964, -0.4157678484916687, -0.23918908834457397, -0.040963124483823776, 0.22628778219223022, -0.04573698341846466, -0.11613710224628448, -0.21634042263031006, 0.2130534052848816, 0.0796322450041771, -0.0837162435054779, -0.23764625191688538, 0.24225056171417236, 0.05129612982273102, -0.29696378111839294, -0.01414673775434494, -0.17433324456214905, -0.050351306796073914, 0.044854048639535904, 0.051034051924943924, 0.24545909464359283, -0.35191839933395386, 0.1444891393184662, 0.11851459741592407, -0.009874977171421051, -0.0291459821164608, 0.48067137598991394, -0.16272541880607605, -0.03560763597488403, 0.42497316002845764, 0.3208532929420471, -0.14047026634216309, -0.1102028638124466, 0.23617258667945862, 0.17570815980434418, -0.5655743479728699, -0.019205786287784576, 0.049622129648923874, 0.3477783799171448, -0.33143869042396545, 0.3647032678127289, -0.008053179830312729, -0.03716486692428589, 0.2610063850879669, -0.3488052189350128, -0.30434393882751465, 0.19009052217006683, -0.20077890157699585, -0.019566308706998825, -0.08974006026983261, 0.07324983179569244, 0.21311426162719727, 0.2500169575214386, -0.16206002235412598, 0.18287350237369537, -0.38266628980636597, -0.08138324320316315, 0.031846996396780014, -0.20956683158874512, 0.16693255305290222, 0.1367017775774002, -0.04818908870220184, 0.40894174575805664, -0.3614230453968048, -0.05330055207014084, 0.05622902885079384, 0.2334890365600586, 0.0028218217194080353, -0.5594563484191895, 0.0116858696565032, -0.3333781361579895, 0.057341236621141434, 0.08777141571044922, -0.07992011308670044, -0.09255681186914444, 0.35509270429611206, -0.40070685744285583, 0.2268645465373993, -0.3272385001182556, -0.14979752898216248, 0.3073658049106598, 0.009152330458164215, 0.24778780341148376, 0.05829678848385811, 0.015166666358709335, 0.2577330470085144, -0.08794981986284256, -0.2046898901462555, 0.12415845692157745, 0.26558077335357666, -0.4043463170528412, 0.4346219301223755, -0.24354882538318634, 0.07897774875164032, 0.3027174472808838, 0.5052024126052856, 0.26995107531547546, -0.37903493642807007, 0.014876572415232658, 0.10236387699842453, 0.06201606243848801, -0.1726086139678955, -0.19240349531173706, 0.2382754385471344, 0.0892389565706253, -0.2946111559867859, 0.07929320633411407, -0.1671493500471115, -0.17532992362976074, 0.04359281435608864, -0.009872663766145706, 0.420468807220459, 0.10869356989860535, -0.048066869378089905, 0.14748679101467133, -0.46071210503578186, -0.19781307876110077, 0.3617161512374878, 0.22114340960979462, 0.2267799973487854, 0.011833470314741135, -0.3229351043701172, -0.11490713059902191, -0.3570268750190735, 0.1460941582918167, -0.0318157821893692, -0.5945746898651123, -0.16754834353923798, 0.19353723526000977, -0.0757032036781311, -0.00819406658411026, -0.20792555809020996, 0.4761498272418976, -0.18462061882019043, 0.15784217417240143, -0.39866748452186584, 0.5301423072814941, -0.09927982836961746, 0.20064248144626617, 0.11038169264793396, -0.2733631432056427, -0.013619046658277512, 0.1754082590341568, -0.025043580681085587, -0.34451228380203247, -0.12222690880298615, 0.06321650743484497, -0.22970230877399445, -0.44252312183380127, -0.05108727514743805, 0.25701943039894104, 0.1383095234632492, -0.34432944655418396, 0.1883244663476944, 0.4251839518547058, -0.12060412764549255, 0.05435118079185486, -0.0591430738568306, 0.22389544546604156, 0.10301581025123596, 0.17416317760944366, 0.22336836159229279, 0.05975092202425003, 0.1318792849779129, 0.0013030283153057098, 0.18884634971618652, 0.4055015444755554, 0.09507174789905548, 0.2971145808696747, -0.0026077544316649437, -0.13283565640449524, -0.09280605614185333, -0.35584473609924316, 0.45933130383491516, -0.34201541543006897, 0.542526125907898, -0.6039208173751831, -0.0829421728849411, -0.3007543981075287, -0.1312108039855957, -0.34234145283699036, 0.2663355767726898, -0.14304250478744507, -0.3519003987312317, -0.14502424001693726, -0.45420071482658386, 0.00044608116149902344, -0.6402647495269775, 0.506536602973938, 0.31121721863746643, 0.0665711835026741, -0.03472142666578293, -0.37843233346939087, -0.3789730370044708, 0.06661822646856308, -0.23367661237716675, 0.09821824729442596, -0.019722698256373405, 0.0406782403588295, -0.3979818522930145, 0.09267795830965042, 0.3422990143299103, -0.09140916168689728, 0.14863213896751404, -0.15462568402290344, -0.1590888500213623, 0.03981505334377289, -0.007163286209106445, 0.1618853211402893, 0.026856984943151474, -0.16178151965141296, 0.5573713183403015, -0.03206660598516464, -0.0942578986287117, -0.13727277517318726, -0.128086119890213, -0.31521573662757874, -0.5811501741409302, 0.43777817487716675, 0.42840009927749634, 0.2687893509864807, 0.13254296779632568, -0.26098573207855225, 0.04025857150554657, -0.19474051892757416, 0.09912518411874771, -0.06750225275754929, 0.12569597363471985, 0.31244465708732605, -0.09540127962827682, -0.09170205891132355, -0.34496086835861206, 0.0420122854411602, -0.10475128889083862, 0.17380045354366302, -0.09051696956157684, -0.3525160849094391, -0.08506828546524048, 0.07256268709897995, 0.2871416211128235, 0.12673522531986237, 0.18932291865348816, -0.089373379945755, -0.23776276409626007, -0.24628207087516785, 0.6569244861602783, -0.06607943773269653, -0.0052198003977537155, 0.18324829638004303, 0.44054022431373596, 0.10006654262542725, -0.25043171644210815, -0.40286487340927124, 0.11590459197759628, 0.42094430327415466, 0.00990266166627407, -0.19472047686576843, 0.2626707851886749, -0.21320116519927979, -0.2624386250972748, 0.13421215116977692, 0.19287443161010742, 0.22153416275978088, -0.03882719948887825, 0.4043900668621063, 0.06685687601566315 ]
https://github.com/huggingface/datasets/issues/6483
Iterable Dataset: rename column clashes with remove column
You can get the expected result by fixing typos in the snippet :) ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset.features) - COLUMNS_TO_KEEP) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ```
### Describe the bug Suppose I have a two iterable datasets, one with the features: * `{"audio", "text", "column_a"}` And the other with the features: * `{"audio", "sentence", "column_b"}` I want to combine both datasets using `interleave_datasets`, which requires me to unify the column names. I would typically do this by: 1. Renaming the common columns to the same name (e.g. `"text"` -> `"sentence"`) 2. Removing the unwanted columns (e.g. `"column_a"`, `"column_b"`) However, the process of renaming and removing columns in an iterable dataset doesn't work, since we need to preserve the original text column, meaning we can't combine the datasets. ### Steps to reproduce the bug ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ``` Traceback: ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[5], line 17 14 COLUMNS_TO_KEEP = {"audio", "sentence"} 15 dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) ---> 17 print(next(iter(dataset))) File ~/datasets/src/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/datasets/src/datasets/iterable_dataset.py:652, in MappedExamplesIterable.__iter__(self) 650 yield from ArrowExamplesIterable(self._iter_arrow, {}) 651 else: --> 652 yield from self._iter() File ~/datasets/src/datasets/iterable_dataset.py:729, in MappedExamplesIterable._iter(self) 727 if self.remove_columns: 728 for c in self.remove_columns: --> 729 del transformed_example[c] 730 yield key, transformed_example 731 current_idx += 1 KeyError: 'text' ``` => we see that `datasets` is looking for the column "text", even though we've renamed this to "sentence" and then removed the un-wanted "text" column from our dataset. ### Expected behavior Should be able to rename and remove columns from iterable dataset. ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: macOS-13.5.1-arm64-arm-64bit - Python version: 3.11.6 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.9.2
75
Iterable Dataset: rename column clashes with remove column ### Describe the bug Suppose I have a two iterable datasets, one with the features: * `{"audio", "text", "column_a"}` And the other with the features: * `{"audio", "sentence", "column_b"}` I want to combine both datasets using `interleave_datasets`, which requires me to unify the column names. I would typically do this by: 1. Renaming the common columns to the same name (e.g. `"text"` -> `"sentence"`) 2. Removing the unwanted columns (e.g. `"column_a"`, `"column_b"`) However, the process of renaming and removing columns in an iterable dataset doesn't work, since we need to preserve the original text column, meaning we can't combine the datasets. ### Steps to reproduce the bug ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ``` Traceback: ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[5], line 17 14 COLUMNS_TO_KEEP = {"audio", "sentence"} 15 dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) ---> 17 print(next(iter(dataset))) File ~/datasets/src/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/datasets/src/datasets/iterable_dataset.py:652, in MappedExamplesIterable.__iter__(self) 650 yield from ArrowExamplesIterable(self._iter_arrow, {}) 651 else: --> 652 yield from self._iter() File ~/datasets/src/datasets/iterable_dataset.py:729, in MappedExamplesIterable._iter(self) 727 if self.remove_columns: 728 for c in self.remove_columns: --> 729 del transformed_example[c] 730 yield key, transformed_example 731 current_idx += 1 KeyError: 'text' ``` => we see that `datasets` is looking for the column "text", even though we've renamed this to "sentence" and then removed the un-wanted "text" column from our dataset. ### Expected behavior Should be able to rename and remove columns from iterable dataset. ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: macOS-13.5.1-arm64-arm-64bit - Python version: 3.11.6 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.9.2 You can get the expected result by fixing typos in the snippet :) ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset.features) - COLUMNS_TO_KEEP) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ```
[ 0.14759640395641327, 0.2063913643360138, 0.013281583786010742, 0.04070223122835159, 0.21933528780937195, 0.34094274044036865, 0.47970402240753174, 0.06645648181438446, -0.09174072742462158, 0.19398123025894165, -0.1917894333600998, 0.302934855222702, 0.14437517523765564, -0.030581768602132797, -0.4889661371707916, -0.060557082295417786, 0.24286699295043945, 0.23223836719989777, -0.10293982923030853, 0.17563587427139282, -0.2672448456287384, 0.14978379011154175, -0.40453124046325684, -0.04936690628528595, 0.13076567649841309, 0.039459072053432465, -0.09246531873941422, -0.06323034316301346, 0.10187336057424545, -0.07379806041717529, 0.09739198535680771, 0.4130578637123108, -0.2355121374130249, 0.4530577063560486, -0.00011287652159808204, -0.1465548574924469, 0.11265689134597778, 0.055582381784915924, -0.38708141446113586, -0.2911533713340759, -0.30954036116600037, -0.19135256111621857, -0.1725928783416748, -0.17084917426109314, 0.13889256119728088, -0.2327931970357895, -0.434246301651001, -0.6392121911048889, -0.05011652410030365, 0.01987505704164505, 0.18834169209003448, 0.16117854416370392, 0.017523761838674545, 0.12886033952236176, 0.26566725969314575, -0.15149052441120148, -0.17397689819335938, -0.06726987659931183, -0.11337265372276306, -0.3597673773765564, 0.28591349720954895, 0.36511823534965515, -0.3311671316623688, -0.097211092710495, 0.07733075320720673, 0.061263732612133026, -0.27175092697143555, -0.26574209332466125, 0.40354326367378235, 0.2485688328742981, 0.41505593061447144, -0.39257097244262695, -0.2447129637002945, -0.20364251732826233, 0.12431177496910095, -0.33677318692207336, 0.22929221391677856, -0.09844464063644409, 0.2969183325767517, -0.01944594830274582, 0.01678345911204815, -0.18806931376457214, 0.04273538291454315, 0.01457357406616211, -0.10039263963699341, 0.010056756436824799, 0.05405007302761078, 0.27034327387809753, -0.03014945611357689, -0.21009287238121033, 0.2948128283023834, -0.1971108764410019, -0.09485748410224915, 0.14589892327785492, -0.6206298470497131, 0.025133468210697174, -0.10808006674051285, -0.24969983100891113, -0.05576244369149208, 0.034644246101379395, -0.025759149342775345, -0.20644420385360718, 0.42481568455696106, 0.12059749662876129, 0.18426762521266937, 0.21850056946277618, -0.05507447570562363, 0.07288085669279099, 0.19920355081558228, 0.1765298992395401, 0.08032159507274628, -0.12523865699768066, 0.4897219240665436, 0.03649783134460449, 0.11290545761585236, -0.227375328540802, 0.3267689347267151, -0.030783627182245255, -0.49853041768074036, 0.2951822280883789, -0.4123099148273468, -0.07329267263412476, -0.024521559476852417, -0.10739275068044662, 0.271246999502182, 0.3004772365093231, -0.13326597213745117, 0.3382393717765808, 0.010484600439667702, 0.03320252522826195, -0.11905672401189804, 0.07090642303228378, -0.1658199578523636, 0.022166427224874496, 0.13347016274929047, 0.03829537704586983, -0.004591486882418394, 0.18870539963245392, 0.09522578120231628, -0.002086058259010315, -0.18249070644378662, -0.09245297312736511, 0.1636972427368164, -0.08984467387199402, 0.1142975240945816, 0.13093411922454834, 0.06654786318540573, -0.4063955545425415, -0.0024338960647583008, -0.11873745173215866, 0.08716190606355667, -0.055515844374895096, -0.17365595698356628, 0.21406880021095276, -0.14063382148742676, 0.07936187088489532, 0.18923506140708923, 0.08090230077505112, 0.3453409671783447, -0.14805524051189423, 0.22462855279445648, -0.07374439388513565, 0.1444222629070282, -0.16461248695850372, 0.027311908081173897, 0.09701196849346161, -0.21197795867919922, 0.019529692828655243, 0.09349750727415085, 0.1329868882894516, 0.09802199900150299, 0.3010216951370239, 0.1382916420698166, -0.3997122645378113, -0.11406314373016357, -0.011472083628177643, 0.043045349419116974, -0.14766784012317657, -0.31038686633110046, 0.3655824065208435, -0.12366475909948349, 0.5040537118911743, 0.20973969995975494, -0.093833327293396, -0.11686564981937408, -0.14178554713726044, -0.010834798216819763, 0.18525202572345734, -0.16008280217647552, -0.09176215529441833, -0.1177646666765213, -0.08387058228254318, 0.15026457607746124, -0.30436521768569946, 0.02470412291586399, 0.24318435788154602, 0.019153587520122528, 0.05474767088890076, 0.3138989806175232, -0.1835481822490692, 0.31159359216690063, 0.10247962176799774, 0.24323111772537231, 0.32873964309692383, 0.16240771114826202, 0.005228135734796524, -0.517549455165863, 0.07987792789936066, 0.4254136383533478, -0.24530911445617676, 0.03595626354217529, -0.33912134170532227, -0.0787307471036911, -0.14152668416500092, -0.2530316114425659, 0.09298909455537796, 0.0934808999300003, 0.2637903690338135, -0.06495954096317291, -0.30135342478752136, -0.27516835927963257, 0.32633498311042786, -0.14647608995437622, 0.028103988617658615, -0.6666409969329834, 0.24093781411647797, 0.05648784339427948, -0.0652184709906578, 0.006298646330833435, 0.47713667154312134, 0.11466698348522186, 0.01975158601999283, -0.15869185328483582, 0.5362982749938965, -0.27480611205101013, 0.3036132752895355, -0.2171556055545807, 0.17296969890594482, -0.14879797399044037, -0.006032660603523254, -0.02080349065363407, -0.08178184926509857, 0.14806511998176575, 0.0339733362197876, 0.0007605254650115967, 0.21632367372512817, -0.3449254035949707, 0.6236697435379028, 0.1338360607624054, -0.027783343568444252, 0.15780521929264069, -0.22860188782215118, -0.37816154956817627, -0.39323219656944275, 0.07983507961034775, -0.3853796422481537, 0.14670397341251373, -0.2488241046667099, -0.30085018277168274, -0.008564934134483337, 0.2542053461074829, 0.2731252610683441, -0.2990764379501343, -0.10754821449518204, -0.15349093079566956, -0.06491637229919434, -0.14780989289283752, 0.13122989237308502, 0.44239872694015503, 0.02706024795770645, 0.0752430111169815, 0.046249352395534515, 0.1293465942144394, -0.15258657932281494, 0.16783364117145538, 0.36229145526885986, -0.00018816594092641026, 0.35473018884658813, 0.39218026399612427, 0.0950789824128151, -0.1834930181503296, -0.2490866631269455, 0.08060050010681152, 0.0933414027094841, -0.10204251110553741, 0.24367640912532806, -0.21570922434329987, -0.1842578947544098, -0.0492962971329689, -0.2396588772535324, -0.07062919437885284, -0.6337689161300659, -0.10711014270782471, 0.773909330368042, -0.20481723546981812, 0.25537967681884766, -0.19783639907836914, 0.04238945245742798, -0.1598164290189743, 0.010712813585996628, -0.13462449610233307, -0.3498004972934723, -0.07044094800949097, 0.11387899518013, -0.07107215374708176, -0.3144737780094147, 0.20198963582515717, 0.12145114690065384, -0.16158528625965118, -0.47475922107696533, -0.3016427159309387, 0.1845298707485199, -0.4931533932685852, 0.08462294936180115, 0.3108653724193573, -0.22604723274707794, 0.0383710041642189, -0.2522936761379242, 0.21280600130558014, 0.13030444085597992, -0.07718715816736221, 0.2003537267446518, 0.08214167505502701, -0.015572390519082546, -0.021255038678646088, -0.28791943192481995, 0.032432589679956436, -0.30723807215690613, 0.14307370781898499, -0.46399644017219543, -0.14023733139038086, 0.002605122048407793, -0.2072419971227646, -0.2950209081172943, 0.2781808376312256, -0.0050344318151474, -0.43242132663726807, -0.028572995215654373, -0.10825145244598389, -0.06533201783895493, -0.0013040043413639069, -0.044134046882390976, -0.018210725858807564, 0.2863258719444275, 0.1849832832813263, -0.25997716188430786, 0.2545088231563568, -0.2194167673587799, 0.16928619146347046, 0.05887850746512413, -0.009216396138072014, -0.07561460137367249, 0.2645586431026459, -0.03258829563856125, -0.23631834983825684, -0.17686624825000763, -0.08359365910291672, 0.326501727104187, 0.22396260499954224, 0.27893704175949097, 0.4414922297000885, 0.0003967694938182831, 0.3304293751716614, 0.31201499700546265, 0.19598844647407532, 0.3988057076931, 0.11293113231658936, 0.2393074482679367, -0.17021653056144714, -0.4129851758480072, 0.10483250766992569, -0.052443891763687134, -0.05828069895505905, 0.12836194038391113, -0.2967558801174164, -0.2667038142681122, -0.14271089434623718, 0.3999193608760834, 0.09093987196683884, -0.31540244817733765, -0.02236672304570675, -0.3823918104171753, 0.24503323435783386, 0.3597067594528198, -0.10120399296283722, -0.0008329693228006363, -0.27893900871276855, 0.004227504134178162, 0.027096666395664215, 0.023760586977005005, -0.10105087608098984, -0.1752520054578781, -0.2629465162754059, -0.3192732632160187, 0.3280577063560486, 0.12152012437582016, 0.6751456260681152, 0.178388774394989, -0.48421382904052734, -0.0927378237247467, 0.12017501890659332, 0.4292057752609253, -0.27439019083976746, -0.45541810989379883, 0.31797322630882263, 0.30935588479042053, -0.048142023384571075, -0.31942567229270935, -0.2967420816421509, 0.1482153683900833, 0.1638009399175644, 0.3010956645011902, -0.2827660143375397, -0.07232671231031418, 0.2821340262889862, 0.4417746663093567, -0.010005846619606018, -0.06864554435014725, -0.32171398401260376, -0.1261426955461502, -0.37473976612091064, 0.057354316115379333, -0.09262793511152267, 0.163427472114563, -0.33328917622566223, 0.25869008898735046, -0.04628467559814453, -0.3238152265548706, 0.3405646085739136, 0.2839794456958771, 0.025570373982191086, -0.031146718189120293, 0.41643375158309937, 0.011276669800281525, 0.2867976129055023, 0.05270916596055031, 0.37862101197242737, -0.1220092624425888, -0.3644711673259735, 0.023897698149085045, -0.30053699016571045, 0.4673961102962494, 0.1392005980014801, 0.0642198771238327, 0.4552615284919739, -0.24525552988052368, 0.06475653499364853, -0.012920618988573551, -0.16766194999217987, 0.40065592527389526, -0.054846230894327164, -0.42783480882644653, -0.37512537837028503, 0.15636853873729706, 0.2864414155483246, -0.27470898628234863, 0.3800131678581238, 0.4910377264022827, -0.31821054220199585, 0.384870707988739, -0.34731733798980713, 0.6657460331916809, 0.3420006036758423, -0.11341175436973572, 0.23629915714263916, -0.0424470454454422, 0.374869704246521, 0.02874419093132019, 0.3123716115951538, -0.19997523725032806, -0.43478745222091675, 0.03506028652191162, 0.12751086056232452, 0.24762314558029175, 0.07866662740707397, -0.03345837816596031, 0.624384880065918, -0.24026300013065338, 0.4686664342880249, -0.0781203955411911, -0.07693526148796082, -0.20139621198177338, -0.33713361620903015, 0.10231170058250427, 0.03314030542969704, 0.03592383861541748, -0.08880047500133514, 0.013912184163928032, 0.34487468004226685, 0.1502399742603302, -0.09769222140312195, -0.11612601578235626, 0.1211099848151207, 0.40704599022865295, 0.19923165440559387, -0.30008840560913086, -0.4898306727409363, -0.008884565904736519, -0.05112004652619362, 0.5022438764572144, -0.025568831712007523, 0.12232836335897446, 0.08037763833999634, 0.4813562333583832, 0.1621546894311905, -0.1080823615193367, 0.032570745795965195, 0.11734963208436966, 0.2116418480873108, -0.1705465018749237, -0.017155669629573822, 0.1456652730703354, -0.043158043175935745, -0.31977540254592896, -0.01189231127500534, 0.27966853976249695, -0.2767525613307953, -0.09457805752754211, 0.06272540241479874, 0.0900719165802002, -0.4346757233142853, 0.07364606857299805, -0.21704070270061493, -0.10172640532255173, 0.2627750337123871, -0.33059176802635193, -0.2703888416290283, -0.2794798016548157, 0.14446714520454407, 0.15641987323760986, -0.05079508572816849, 0.43716689944267273, -0.06618010997772217, -0.22995808720588684, -0.061049722135066986, -0.2915317714214325, -0.03413333743810654, -0.13784503936767578, 0.1666339635848999, -0.1862630546092987, 0.002544015645980835, 0.09341820329427719, -0.01592748984694481, -0.16118596494197845, 0.10992807149887085, 0.09578309953212738, -0.17702195048332214, -0.07435998320579529, 0.207096129655838, 0.2695873975753784, 0.2906995713710785, -0.1441938579082489, 0.10124129056930542, -0.47013816237449646, 0.05428978428244591, -0.24140147864818573, -0.10047546029090881, 0.08625849336385727, 0.33896708488464355, 0.4327845275402069, 0.18932944536209106, -0.07925368845462799, -0.19728000462055206, 0.2235935628414154, 0.060336947441101074, 0.37088456749916077, -0.16428253054618835, -0.26867103576660156, 0.11152643710374832, 0.15759918093681335, -0.014756269752979279, -0.2257610261440277, -0.08434747159481049, -0.07624204456806183, -0.24017423391342163, 0.42242300510406494, 0.2414865791797638, 0.05446675792336464, 0.1216450035572052, -0.5015928149223328, 0.10479240864515305, 0.13753561675548553, 0.12962809205055237, -0.026054784655570984, -0.0976894199848175, 0.07804621011018753, 0.22856177389621735, -0.004241739399731159, 0.0001931712031364441, -0.27479350566864014, -0.02680586278438568, 0.02207854390144348, 0.11655505746603012, -0.03964904695749283, -0.12955844402313232, -0.046648602932691574, 0.14402422308921814, 0.16534754633903503, 0.5476689338684082, -0.02835230715572834, -0.4748314917087555, 0.22328650951385498, 0.15768344700336456, -0.21356934309005737, -0.04799951985478401, -0.03328844532370567, -0.16968198120594025, 0.2953791916370392, 0.4130246341228485, 0.20205342769622803, -0.0501105971634388, -0.31973862648010254, 0.058475978672504425, 0.3040914237499237, -0.1573721468448639, 0.1315850466489792, 0.5237295627593994, 0.06689295172691345, 0.21183401346206665, 0.15970683097839355, 0.14698131382465363, -0.06626693159341812, 0.4078286290168762, -0.07012816518545151, 0.2795066237449646, 0.46567872166633606, 0.028564918786287308, 0.11325894296169281, -0.19812393188476562, -0.036309000104665756, -0.12619051337242126, -0.09392766654491425, 0.4287429749965668, 0.2661709785461426, -0.2418074905872345, 0.012306248769164085, -0.05183594301342964, -0.08691859990358353, 0.20957709848880768, -0.0825582817196846, -0.37615638971328735, -0.00933993048965931, -0.3381996750831604, -0.011382721364498138, -0.06811028718948364, 0.07817336171865463, 0.16279147565364838, 0.7782617807388306, -0.1167607307434082, 0.12304946780204773, -0.5961126685142517, 0.10378123074769974, 0.14120358228683472, 0.32389235496520996, -0.1364234983921051, -0.17601436376571655, 0.28758561611175537, -0.19083774089813232, 0.22530892491340637, 0.028608378022909164, 0.09300930798053741, -0.006471280008554459, 0.03908461332321167, -0.1751476377248764, -0.15908026695251465, -0.2818581759929657, 0.10732947289943695, 0.38095757365226746, -0.28945523500442505, -0.1664712131023407, 0.22006462514400482, 0.117243692278862, -0.10842292755842209, -0.012093592435121536, 0.39453446865081787, 0.3188636004924774, -0.511990487575531, 0.1944366693496704, -0.04934097081422806, 0.0074087753891944885, 0.19146130979061127, 0.0014574527740478516, -0.06889991462230682, -0.19655847549438477, 0.4493216574192047, 0.10498789697885513, 0.15003305673599243, 0.013472006656229496, 0.09773756563663483, 0.14668351411819458, 0.06179133802652359, 0.29587575793266296, -0.49106577038764954, -0.23292918503284454, -0.11170333623886108, -0.5160531401634216, 0.042047202587127686, -0.23658615350723267, -0.06534677743911743, -0.038382794708013535, 0.3240404427051544, 0.11761406064033508, 0.047296926379203796, 0.02826249599456787, -0.12837913632392883, -0.030603822320699692, 0.36217519640922546, -0.20984414219856262, -0.3124731779098511, 0.1618310660123825, -0.06648700684309006, 0.09328776597976685, -0.13204485177993774, 0.0665673241019249, 0.4131033420562744, 0.049992769956588745, -0.31150031089782715, 0.002777792513370514, 0.27384883165359497, -0.24615028500556946, 0.046525225043296814, 0.25102636218070984, 0.1361856311559677, -0.2025584876537323, -0.41221967339515686, -0.21963712573051453, -0.19816747307777405, -0.35429665446281433, 0.2582901418209076, -0.11048686504364014, 0.2332865595817566, -0.011263061314821243, 0.27306851744651794, 0.012875094078481197, 0.19803179800510406, 0.043829821050167084, 0.13253797590732574, -0.5397311449050903, 0.317361444234848, 0.09058745950460434, 0.5057495832443237, -0.17408902943134308, 0.4717957675457001, 0.16872970759868622, 0.604578971862793, -0.15589450299739838, -0.638427734375, 0.4399881958961487, -0.15045443177223206, -0.5582718849182129, -0.021508600562810898, 0.05423014611005783, 0.21890395879745483, -0.23891565203666687, -0.42088812589645386, 0.00485161691904068, 0.09083425253629684, -0.31860047578811646, 0.029189493507146835, 0.15054728090763092, -0.07486411929130554, 0.07867284119129181, -0.05453090742230415, 0.0329115055501461, 0.26019665598869324, -0.25484031438827515, 0.3422352075576782, 0.0987786054611206 ]
https://github.com/huggingface/datasets/issues/6483
Iterable Dataset: rename column clashes with remove column
Fixed code: ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") dataset_features = dataset.features.keys() # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ```
### Describe the bug Suppose I have a two iterable datasets, one with the features: * `{"audio", "text", "column_a"}` And the other with the features: * `{"audio", "sentence", "column_b"}` I want to combine both datasets using `interleave_datasets`, which requires me to unify the column names. I would typically do this by: 1. Renaming the common columns to the same name (e.g. `"text"` -> `"sentence"`) 2. Removing the unwanted columns (e.g. `"column_a"`, `"column_b"`) However, the process of renaming and removing columns in an iterable dataset doesn't work, since we need to preserve the original text column, meaning we can't combine the datasets. ### Steps to reproduce the bug ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ``` Traceback: ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[5], line 17 14 COLUMNS_TO_KEEP = {"audio", "sentence"} 15 dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) ---> 17 print(next(iter(dataset))) File ~/datasets/src/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/datasets/src/datasets/iterable_dataset.py:652, in MappedExamplesIterable.__iter__(self) 650 yield from ArrowExamplesIterable(self._iter_arrow, {}) 651 else: --> 652 yield from self._iter() File ~/datasets/src/datasets/iterable_dataset.py:729, in MappedExamplesIterable._iter(self) 727 if self.remove_columns: 728 for c in self.remove_columns: --> 729 del transformed_example[c] 730 yield key, transformed_example 731 current_idx += 1 KeyError: 'text' ``` => we see that `datasets` is looking for the column "text", even though we've renamed this to "sentence" and then removed the un-wanted "text" column from our dataset. ### Expected behavior Should be able to rename and remove columns from iterable dataset. ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: macOS-13.5.1-arm64-arm-64bit - Python version: 3.11.6 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.9.2
67
Iterable Dataset: rename column clashes with remove column ### Describe the bug Suppose I have a two iterable datasets, one with the features: * `{"audio", "text", "column_a"}` And the other with the features: * `{"audio", "sentence", "column_b"}` I want to combine both datasets using `interleave_datasets`, which requires me to unify the column names. I would typically do this by: 1. Renaming the common columns to the same name (e.g. `"text"` -> `"sentence"`) 2. Removing the unwanted columns (e.g. `"column_a"`, `"column_b"`) However, the process of renaming and removing columns in an iterable dataset doesn't work, since we need to preserve the original text column, meaning we can't combine the datasets. ### Steps to reproduce the bug ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ``` Traceback: ```python --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[5], line 17 14 COLUMNS_TO_KEEP = {"audio", "sentence"} 15 dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) ---> 17 print(next(iter(dataset))) File ~/datasets/src/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/datasets/src/datasets/iterable_dataset.py:652, in MappedExamplesIterable.__iter__(self) 650 yield from ArrowExamplesIterable(self._iter_arrow, {}) 651 else: --> 652 yield from self._iter() File ~/datasets/src/datasets/iterable_dataset.py:729, in MappedExamplesIterable._iter(self) 727 if self.remove_columns: 728 for c in self.remove_columns: --> 729 del transformed_example[c] 730 yield key, transformed_example 731 current_idx += 1 KeyError: 'text' ``` => we see that `datasets` is looking for the column "text", even though we've renamed this to "sentence" and then removed the un-wanted "text" column from our dataset. ### Expected behavior Should be able to rename and remove columns from iterable dataset. ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: macOS-13.5.1-arm64-arm-64bit - Python version: 3.11.6 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.9.2 Fixed code: ```python from datasets import load_dataset # load LS in streaming mode dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # check original features dataset_features = dataset.features.keys() print("Original features: ", dataset_features) # rename "text" -> "sentence" dataset = dataset.rename_column("text", "sentence") dataset_features = dataset.features.keys() # remove unwanted columns COLUMNS_TO_KEEP = {"audio", "sentence"} dataset = dataset.remove_columns(set(dataset_features - COLUMNS_TO_KEEP)) # stream first sample, should return "audio" and "sentence" columns print(next(iter(dataset))) ```
[ 0.14759640395641327, 0.2063913643360138, 0.013281583786010742, 0.04070223122835159, 0.21933528780937195, 0.34094274044036865, 0.47970402240753174, 0.06645648181438446, -0.09174072742462158, 0.19398123025894165, -0.1917894333600998, 0.302934855222702, 0.14437517523765564, -0.030581768602132797, -0.4889661371707916, -0.060557082295417786, 0.24286699295043945, 0.23223836719989777, -0.10293982923030853, 0.17563587427139282, -0.2672448456287384, 0.14978379011154175, -0.40453124046325684, -0.04936690628528595, 0.13076567649841309, 0.039459072053432465, -0.09246531873941422, -0.06323034316301346, 0.10187336057424545, -0.07379806041717529, 0.09739198535680771, 0.4130578637123108, -0.2355121374130249, 0.4530577063560486, -0.00011287652159808204, -0.1465548574924469, 0.11265689134597778, 0.055582381784915924, -0.38708141446113586, -0.2911533713340759, -0.30954036116600037, -0.19135256111621857, -0.1725928783416748, -0.17084917426109314, 0.13889256119728088, -0.2327931970357895, -0.434246301651001, -0.6392121911048889, -0.05011652410030365, 0.01987505704164505, 0.18834169209003448, 0.16117854416370392, 0.017523761838674545, 0.12886033952236176, 0.26566725969314575, -0.15149052441120148, -0.17397689819335938, -0.06726987659931183, -0.11337265372276306, -0.3597673773765564, 0.28591349720954895, 0.36511823534965515, -0.3311671316623688, -0.097211092710495, 0.07733075320720673, 0.061263732612133026, -0.27175092697143555, -0.26574209332466125, 0.40354326367378235, 0.2485688328742981, 0.41505593061447144, -0.39257097244262695, -0.2447129637002945, -0.20364251732826233, 0.12431177496910095, -0.33677318692207336, 0.22929221391677856, -0.09844464063644409, 0.2969183325767517, -0.01944594830274582, 0.01678345911204815, -0.18806931376457214, 0.04273538291454315, 0.01457357406616211, -0.10039263963699341, 0.010056756436824799, 0.05405007302761078, 0.27034327387809753, -0.03014945611357689, -0.21009287238121033, 0.2948128283023834, -0.1971108764410019, -0.09485748410224915, 0.14589892327785492, -0.6206298470497131, 0.025133468210697174, -0.10808006674051285, -0.24969983100891113, -0.05576244369149208, 0.034644246101379395, -0.025759149342775345, -0.20644420385360718, 0.42481568455696106, 0.12059749662876129, 0.18426762521266937, 0.21850056946277618, -0.05507447570562363, 0.07288085669279099, 0.19920355081558228, 0.1765298992395401, 0.08032159507274628, -0.12523865699768066, 0.4897219240665436, 0.03649783134460449, 0.11290545761585236, -0.227375328540802, 0.3267689347267151, -0.030783627182245255, -0.49853041768074036, 0.2951822280883789, -0.4123099148273468, -0.07329267263412476, -0.024521559476852417, -0.10739275068044662, 0.271246999502182, 0.3004772365093231, -0.13326597213745117, 0.3382393717765808, 0.010484600439667702, 0.03320252522826195, -0.11905672401189804, 0.07090642303228378, -0.1658199578523636, 0.022166427224874496, 0.13347016274929047, 0.03829537704586983, -0.004591486882418394, 0.18870539963245392, 0.09522578120231628, -0.002086058259010315, -0.18249070644378662, -0.09245297312736511, 0.1636972427368164, -0.08984467387199402, 0.1142975240945816, 0.13093411922454834, 0.06654786318540573, -0.4063955545425415, -0.0024338960647583008, -0.11873745173215866, 0.08716190606355667, -0.055515844374895096, -0.17365595698356628, 0.21406880021095276, -0.14063382148742676, 0.07936187088489532, 0.18923506140708923, 0.08090230077505112, 0.3453409671783447, -0.14805524051189423, 0.22462855279445648, -0.07374439388513565, 0.1444222629070282, -0.16461248695850372, 0.027311908081173897, 0.09701196849346161, -0.21197795867919922, 0.019529692828655243, 0.09349750727415085, 0.1329868882894516, 0.09802199900150299, 0.3010216951370239, 0.1382916420698166, -0.3997122645378113, -0.11406314373016357, -0.011472083628177643, 0.043045349419116974, -0.14766784012317657, -0.31038686633110046, 0.3655824065208435, -0.12366475909948349, 0.5040537118911743, 0.20973969995975494, -0.093833327293396, -0.11686564981937408, -0.14178554713726044, -0.010834798216819763, 0.18525202572345734, -0.16008280217647552, -0.09176215529441833, -0.1177646666765213, -0.08387058228254318, 0.15026457607746124, -0.30436521768569946, 0.02470412291586399, 0.24318435788154602, 0.019153587520122528, 0.05474767088890076, 0.3138989806175232, -0.1835481822490692, 0.31159359216690063, 0.10247962176799774, 0.24323111772537231, 0.32873964309692383, 0.16240771114826202, 0.005228135734796524, -0.517549455165863, 0.07987792789936066, 0.4254136383533478, -0.24530911445617676, 0.03595626354217529, -0.33912134170532227, -0.0787307471036911, -0.14152668416500092, -0.2530316114425659, 0.09298909455537796, 0.0934808999300003, 0.2637903690338135, -0.06495954096317291, -0.30135342478752136, -0.27516835927963257, 0.32633498311042786, -0.14647608995437622, 0.028103988617658615, -0.6666409969329834, 0.24093781411647797, 0.05648784339427948, -0.0652184709906578, 0.006298646330833435, 0.47713667154312134, 0.11466698348522186, 0.01975158601999283, -0.15869185328483582, 0.5362982749938965, -0.27480611205101013, 0.3036132752895355, -0.2171556055545807, 0.17296969890594482, -0.14879797399044037, -0.006032660603523254, -0.02080349065363407, -0.08178184926509857, 0.14806511998176575, 0.0339733362197876, 0.0007605254650115967, 0.21632367372512817, -0.3449254035949707, 0.6236697435379028, 0.1338360607624054, -0.027783343568444252, 0.15780521929264069, -0.22860188782215118, -0.37816154956817627, -0.39323219656944275, 0.07983507961034775, -0.3853796422481537, 0.14670397341251373, -0.2488241046667099, -0.30085018277168274, -0.008564934134483337, 0.2542053461074829, 0.2731252610683441, -0.2990764379501343, -0.10754821449518204, -0.15349093079566956, -0.06491637229919434, -0.14780989289283752, 0.13122989237308502, 0.44239872694015503, 0.02706024795770645, 0.0752430111169815, 0.046249352395534515, 0.1293465942144394, -0.15258657932281494, 0.16783364117145538, 0.36229145526885986, -0.00018816594092641026, 0.35473018884658813, 0.39218026399612427, 0.0950789824128151, -0.1834930181503296, -0.2490866631269455, 0.08060050010681152, 0.0933414027094841, -0.10204251110553741, 0.24367640912532806, -0.21570922434329987, -0.1842578947544098, -0.0492962971329689, -0.2396588772535324, -0.07062919437885284, -0.6337689161300659, -0.10711014270782471, 0.773909330368042, -0.20481723546981812, 0.25537967681884766, -0.19783639907836914, 0.04238945245742798, -0.1598164290189743, 0.010712813585996628, -0.13462449610233307, -0.3498004972934723, -0.07044094800949097, 0.11387899518013, -0.07107215374708176, -0.3144737780094147, 0.20198963582515717, 0.12145114690065384, -0.16158528625965118, -0.47475922107696533, -0.3016427159309387, 0.1845298707485199, -0.4931533932685852, 0.08462294936180115, 0.3108653724193573, -0.22604723274707794, 0.0383710041642189, -0.2522936761379242, 0.21280600130558014, 0.13030444085597992, -0.07718715816736221, 0.2003537267446518, 0.08214167505502701, -0.015572390519082546, -0.021255038678646088, -0.28791943192481995, 0.032432589679956436, -0.30723807215690613, 0.14307370781898499, -0.46399644017219543, -0.14023733139038086, 0.002605122048407793, -0.2072419971227646, -0.2950209081172943, 0.2781808376312256, -0.0050344318151474, -0.43242132663726807, -0.028572995215654373, -0.10825145244598389, -0.06533201783895493, -0.0013040043413639069, -0.044134046882390976, -0.018210725858807564, 0.2863258719444275, 0.1849832832813263, -0.25997716188430786, 0.2545088231563568, -0.2194167673587799, 0.16928619146347046, 0.05887850746512413, -0.009216396138072014, -0.07561460137367249, 0.2645586431026459, -0.03258829563856125, -0.23631834983825684, -0.17686624825000763, -0.08359365910291672, 0.326501727104187, 0.22396260499954224, 0.27893704175949097, 0.4414922297000885, 0.0003967694938182831, 0.3304293751716614, 0.31201499700546265, 0.19598844647407532, 0.3988057076931, 0.11293113231658936, 0.2393074482679367, -0.17021653056144714, -0.4129851758480072, 0.10483250766992569, -0.052443891763687134, -0.05828069895505905, 0.12836194038391113, -0.2967558801174164, -0.2667038142681122, -0.14271089434623718, 0.3999193608760834, 0.09093987196683884, -0.31540244817733765, -0.02236672304570675, -0.3823918104171753, 0.24503323435783386, 0.3597067594528198, -0.10120399296283722, -0.0008329693228006363, -0.27893900871276855, 0.004227504134178162, 0.027096666395664215, 0.023760586977005005, -0.10105087608098984, -0.1752520054578781, -0.2629465162754059, -0.3192732632160187, 0.3280577063560486, 0.12152012437582016, 0.6751456260681152, 0.178388774394989, -0.48421382904052734, -0.0927378237247467, 0.12017501890659332, 0.4292057752609253, -0.27439019083976746, -0.45541810989379883, 0.31797322630882263, 0.30935588479042053, -0.048142023384571075, -0.31942567229270935, -0.2967420816421509, 0.1482153683900833, 0.1638009399175644, 0.3010956645011902, -0.2827660143375397, -0.07232671231031418, 0.2821340262889862, 0.4417746663093567, -0.010005846619606018, -0.06864554435014725, -0.32171398401260376, -0.1261426955461502, -0.37473976612091064, 0.057354316115379333, -0.09262793511152267, 0.163427472114563, -0.33328917622566223, 0.25869008898735046, -0.04628467559814453, -0.3238152265548706, 0.3405646085739136, 0.2839794456958771, 0.025570373982191086, -0.031146718189120293, 0.41643375158309937, 0.011276669800281525, 0.2867976129055023, 0.05270916596055031, 0.37862101197242737, -0.1220092624425888, -0.3644711673259735, 0.023897698149085045, -0.30053699016571045, 0.4673961102962494, 0.1392005980014801, 0.0642198771238327, 0.4552615284919739, -0.24525552988052368, 0.06475653499364853, -0.012920618988573551, -0.16766194999217987, 0.40065592527389526, -0.054846230894327164, -0.42783480882644653, -0.37512537837028503, 0.15636853873729706, 0.2864414155483246, -0.27470898628234863, 0.3800131678581238, 0.4910377264022827, -0.31821054220199585, 0.384870707988739, -0.34731733798980713, 0.6657460331916809, 0.3420006036758423, -0.11341175436973572, 0.23629915714263916, -0.0424470454454422, 0.374869704246521, 0.02874419093132019, 0.3123716115951538, -0.19997523725032806, -0.43478745222091675, 0.03506028652191162, 0.12751086056232452, 0.24762314558029175, 0.07866662740707397, -0.03345837816596031, 0.624384880065918, -0.24026300013065338, 0.4686664342880249, -0.0781203955411911, -0.07693526148796082, -0.20139621198177338, -0.33713361620903015, 0.10231170058250427, 0.03314030542969704, 0.03592383861541748, -0.08880047500133514, 0.013912184163928032, 0.34487468004226685, 0.1502399742603302, -0.09769222140312195, -0.11612601578235626, 0.1211099848151207, 0.40704599022865295, 0.19923165440559387, -0.30008840560913086, -0.4898306727409363, -0.008884565904736519, -0.05112004652619362, 0.5022438764572144, -0.025568831712007523, 0.12232836335897446, 0.08037763833999634, 0.4813562333583832, 0.1621546894311905, -0.1080823615193367, 0.032570745795965195, 0.11734963208436966, 0.2116418480873108, -0.1705465018749237, -0.017155669629573822, 0.1456652730703354, -0.043158043175935745, -0.31977540254592896, -0.01189231127500534, 0.27966853976249695, -0.2767525613307953, -0.09457805752754211, 0.06272540241479874, 0.0900719165802002, -0.4346757233142853, 0.07364606857299805, -0.21704070270061493, -0.10172640532255173, 0.2627750337123871, -0.33059176802635193, -0.2703888416290283, -0.2794798016548157, 0.14446714520454407, 0.15641987323760986, -0.05079508572816849, 0.43716689944267273, -0.06618010997772217, -0.22995808720588684, -0.061049722135066986, -0.2915317714214325, -0.03413333743810654, -0.13784503936767578, 0.1666339635848999, -0.1862630546092987, 0.002544015645980835, 0.09341820329427719, -0.01592748984694481, -0.16118596494197845, 0.10992807149887085, 0.09578309953212738, -0.17702195048332214, -0.07435998320579529, 0.207096129655838, 0.2695873975753784, 0.2906995713710785, -0.1441938579082489, 0.10124129056930542, -0.47013816237449646, 0.05428978428244591, -0.24140147864818573, -0.10047546029090881, 0.08625849336385727, 0.33896708488464355, 0.4327845275402069, 0.18932944536209106, -0.07925368845462799, -0.19728000462055206, 0.2235935628414154, 0.060336947441101074, 0.37088456749916077, -0.16428253054618835, -0.26867103576660156, 0.11152643710374832, 0.15759918093681335, -0.014756269752979279, -0.2257610261440277, -0.08434747159481049, -0.07624204456806183, -0.24017423391342163, 0.42242300510406494, 0.2414865791797638, 0.05446675792336464, 0.1216450035572052, -0.5015928149223328, 0.10479240864515305, 0.13753561675548553, 0.12962809205055237, -0.026054784655570984, -0.0976894199848175, 0.07804621011018753, 0.22856177389621735, -0.004241739399731159, 0.0001931712031364441, -0.27479350566864014, -0.02680586278438568, 0.02207854390144348, 0.11655505746603012, -0.03964904695749283, -0.12955844402313232, -0.046648602932691574, 0.14402422308921814, 0.16534754633903503, 0.5476689338684082, -0.02835230715572834, -0.4748314917087555, 0.22328650951385498, 0.15768344700336456, -0.21356934309005737, -0.04799951985478401, -0.03328844532370567, -0.16968198120594025, 0.2953791916370392, 0.4130246341228485, 0.20205342769622803, -0.0501105971634388, -0.31973862648010254, 0.058475978672504425, 0.3040914237499237, -0.1573721468448639, 0.1315850466489792, 0.5237295627593994, 0.06689295172691345, 0.21183401346206665, 0.15970683097839355, 0.14698131382465363, -0.06626693159341812, 0.4078286290168762, -0.07012816518545151, 0.2795066237449646, 0.46567872166633606, 0.028564918786287308, 0.11325894296169281, -0.19812393188476562, -0.036309000104665756, -0.12619051337242126, -0.09392766654491425, 0.4287429749965668, 0.2661709785461426, -0.2418074905872345, 0.012306248769164085, -0.05183594301342964, -0.08691859990358353, 0.20957709848880768, -0.0825582817196846, -0.37615638971328735, -0.00933993048965931, -0.3381996750831604, -0.011382721364498138, -0.06811028718948364, 0.07817336171865463, 0.16279147565364838, 0.7782617807388306, -0.1167607307434082, 0.12304946780204773, -0.5961126685142517, 0.10378123074769974, 0.14120358228683472, 0.32389235496520996, -0.1364234983921051, -0.17601436376571655, 0.28758561611175537, -0.19083774089813232, 0.22530892491340637, 0.028608378022909164, 0.09300930798053741, -0.006471280008554459, 0.03908461332321167, -0.1751476377248764, -0.15908026695251465, -0.2818581759929657, 0.10732947289943695, 0.38095757365226746, -0.28945523500442505, -0.1664712131023407, 0.22006462514400482, 0.117243692278862, -0.10842292755842209, -0.012093592435121536, 0.39453446865081787, 0.3188636004924774, -0.511990487575531, 0.1944366693496704, -0.04934097081422806, 0.0074087753891944885, 0.19146130979061127, 0.0014574527740478516, -0.06889991462230682, -0.19655847549438477, 0.4493216574192047, 0.10498789697885513, 0.15003305673599243, 0.013472006656229496, 0.09773756563663483, 0.14668351411819458, 0.06179133802652359, 0.29587575793266296, -0.49106577038764954, -0.23292918503284454, -0.11170333623886108, -0.5160531401634216, 0.042047202587127686, -0.23658615350723267, -0.06534677743911743, -0.038382794708013535, 0.3240404427051544, 0.11761406064033508, 0.047296926379203796, 0.02826249599456787, -0.12837913632392883, -0.030603822320699692, 0.36217519640922546, -0.20984414219856262, -0.3124731779098511, 0.1618310660123825, -0.06648700684309006, 0.09328776597976685, -0.13204485177993774, 0.0665673241019249, 0.4131033420562744, 0.049992769956588745, -0.31150031089782715, 0.002777792513370514, 0.27384883165359497, -0.24615028500556946, 0.046525225043296814, 0.25102636218070984, 0.1361856311559677, -0.2025584876537323, -0.41221967339515686, -0.21963712573051453, -0.19816747307777405, -0.35429665446281433, 0.2582901418209076, -0.11048686504364014, 0.2332865595817566, -0.011263061314821243, 0.27306851744651794, 0.012875094078481197, 0.19803179800510406, 0.043829821050167084, 0.13253797590732574, -0.5397311449050903, 0.317361444234848, 0.09058745950460434, 0.5057495832443237, -0.17408902943134308, 0.4717957675457001, 0.16872970759868622, 0.604578971862793, -0.15589450299739838, -0.638427734375, 0.4399881958961487, -0.15045443177223206, -0.5582718849182129, -0.021508600562810898, 0.05423014611005783, 0.21890395879745483, -0.23891565203666687, -0.42088812589645386, 0.00485161691904068, 0.09083425253629684, -0.31860047578811646, 0.029189493507146835, 0.15054728090763092, -0.07486411929130554, 0.07867284119129181, -0.05453090742230415, 0.0329115055501461, 0.26019665598869324, -0.25484031438827515, 0.3422352075576782, 0.0987786054611206 ]
https://github.com/huggingface/datasets/issues/6484
[Feature Request] Dataset versioning
Hello @kenfus, this is meant to be possible to do yes. Let me ping @lhoestq or @mariosasko from the `datasets` team (`huggingface_hub` is only the underlying library to download files from the Hub but here it looks more like a `datasets` problem).
**Is your feature request related to a problem? Please describe.** I am working on a project, where I would like to test different preprocessing methods for my ML-data. Thus, I would like to work a lot with revisions and compare them. Currently, I was not able to make it work with the revision keyword because it was not redownloading the data, it was reading in some cached data, until I put `download_mode="force_redownload"`, even though the reversion was different. Of course, I may have done something wrong or missed a setting somewhere! **Describe the solution you'd like** The solution would allow me to easily work with revisions: - create a new dataset (by combining things, different preprocessing, ..) and give it a new revision (v.1.2.3), maybe like this: `dataset_audio.push_to_hub('kenfus/xy', revision='v1.0.2')` - then, get the current revision as follows: ``` dataset = load_dataset( 'kenfus/xy', revision='v1.0.2', ) ``` this downloads the new version and does not load in a different revision and all future map, filter, .. operations are done on this dataset and not loaded from cache produced from a different revision. - if I rerun the run, the caching should be smart enough in every step to not reuse a mapping operation on a different revision. **Describe alternatives you've considered** I created my own caching, putting `download_mode="force_redownload"` and `load_from_cache_file=False,` everywhere. **Additional context** Thanks a lot for your great work! Creating NLP datasets and training a model with them is really easy and straightforward with huggingface. This is the data loading in my script: ``` ## CREATE PATHS prepared_dataset_path = os.path.join( DATA_FOLDER, str(DATA_VERSION), "prepared_dataset" ) os.makedirs(os.path.join(DATA_FOLDER, str(DATA_VERSION)), exist_ok=True) ## LOAD DATASET if os.path.exists(prepared_dataset_path): print("Loading prepared dataset from disk...") dataset_prepared = load_from_disk(prepared_dataset_path) else: print("Loading dataset from HuggingFace Datasets...") dataset = load_dataset( PATH_TO_DATASET, revision=DATA_VERSION, download_mode="force_redownload" ) print("Preparing dataset...") dataset_prepared = dataset.map( prepare_dataset, remove_columns=["audio", "transcription"], num_proc=os.cpu_count(), load_from_cache_file=False, ) dataset_prepared.save_to_disk(prepared_dataset_path) del dataset if CHECK_DATASET: ## CHECK DATASET dataset_prepared = dataset_prepared.map( check_dimensions, num_proc=os.cpu_count(), load_from_cache_file=False ) dataset_filtered = dataset_prepared.filter( lambda example: not example["incorrect_dimension"], load_from_cache_file=False, ) for example in dataset_prepared.filter( lambda example: example["incorrect_dimension"], load_from_cache_file=False ): print(example["path"]) print( f"Number of examples with incorrect dimension: {len(dataset_prepared) - len(dataset_filtered)}" ) print("Number of examples train: ", len(dataset_filtered["train"])) print("Number of examples test: ", len(dataset_filtered["test"])) ```
42
[Feature Request] Dataset versioning **Is your feature request related to a problem? Please describe.** I am working on a project, where I would like to test different preprocessing methods for my ML-data. Thus, I would like to work a lot with revisions and compare them. Currently, I was not able to make it work with the revision keyword because it was not redownloading the data, it was reading in some cached data, until I put `download_mode="force_redownload"`, even though the reversion was different. Of course, I may have done something wrong or missed a setting somewhere! **Describe the solution you'd like** The solution would allow me to easily work with revisions: - create a new dataset (by combining things, different preprocessing, ..) and give it a new revision (v.1.2.3), maybe like this: `dataset_audio.push_to_hub('kenfus/xy', revision='v1.0.2')` - then, get the current revision as follows: ``` dataset = load_dataset( 'kenfus/xy', revision='v1.0.2', ) ``` this downloads the new version and does not load in a different revision and all future map, filter, .. operations are done on this dataset and not loaded from cache produced from a different revision. - if I rerun the run, the caching should be smart enough in every step to not reuse a mapping operation on a different revision. **Describe alternatives you've considered** I created my own caching, putting `download_mode="force_redownload"` and `load_from_cache_file=False,` everywhere. **Additional context** Thanks a lot for your great work! Creating NLP datasets and training a model with them is really easy and straightforward with huggingface. This is the data loading in my script: ``` ## CREATE PATHS prepared_dataset_path = os.path.join( DATA_FOLDER, str(DATA_VERSION), "prepared_dataset" ) os.makedirs(os.path.join(DATA_FOLDER, str(DATA_VERSION)), exist_ok=True) ## LOAD DATASET if os.path.exists(prepared_dataset_path): print("Loading prepared dataset from disk...") dataset_prepared = load_from_disk(prepared_dataset_path) else: print("Loading dataset from HuggingFace Datasets...") dataset = load_dataset( PATH_TO_DATASET, revision=DATA_VERSION, download_mode="force_redownload" ) print("Preparing dataset...") dataset_prepared = dataset.map( prepare_dataset, remove_columns=["audio", "transcription"], num_proc=os.cpu_count(), load_from_cache_file=False, ) dataset_prepared.save_to_disk(prepared_dataset_path) del dataset if CHECK_DATASET: ## CHECK DATASET dataset_prepared = dataset_prepared.map( check_dimensions, num_proc=os.cpu_count(), load_from_cache_file=False ) dataset_filtered = dataset_prepared.filter( lambda example: not example["incorrect_dimension"], load_from_cache_file=False, ) for example in dataset_prepared.filter( lambda example: example["incorrect_dimension"], load_from_cache_file=False ): print(example["path"]) print( f"Number of examples with incorrect dimension: {len(dataset_prepared) - len(dataset_filtered)}" ) print("Number of examples train: ", len(dataset_filtered["train"])) print("Number of examples test: ", len(dataset_filtered["test"])) ``` Hello @kenfus, this is meant to be possible to do yes. Let me ping @lhoestq or @mariosasko from the `datasets` team (`huggingface_hub` is only the underlying library to download files from the Hub but here it looks more like a `datasets` problem).
[ -0.2728325128555298, -0.24783597886562347, -0.002608122304081917, -0.0737680196762085, -0.22250716388225555, -0.015725702047348022, -0.057077664881944656, 0.34137144684791565, -0.17344817519187927, -0.031363531947135925, -0.15616731345653534, 0.23501448333263397, -0.11500310152769089, 0.3179987072944641, 0.017695581540465355, 0.08551698923110962, 0.2836679220199585, 0.24927009642124176, -0.03994322568178177, 0.05834730714559555, -0.3770224153995514, 0.021084362640976906, -0.08654657006263733, 0.03274349123239517, -0.22368550300598145, -0.10516432672739029, -0.15516333281993866, -0.05678088217973709, -0.18044769763946533, -0.4748750329017639, 0.3448273539543152, 0.4354030191898346, 0.2228977531194687, 0.6818737387657166, -0.00012008284102194011, -0.027761057019233704, 0.32319414615631104, -0.05849736928939819, -0.6495261192321777, -0.43116170167922974, 0.12097484618425369, -0.18896102905273438, 0.10328052192926407, -0.002605937421321869, -0.24334082007408142, -0.12603618204593658, 0.11668282002210617, -0.24423788487911224, 0.6784777641296387, -0.007581647951155901, 0.10937154293060303, 0.07933220267295837, -0.14446209371089935, 0.03846503794193268, 0.053195804357528687, 0.37553471326828003, -0.2111680805683136, 0.20244447886943817, 0.4018102288246155, -0.06821213662624359, -0.03205392509698868, 0.44820016622543335, -0.09272900223731995, -0.018969811499118805, 0.4356856942176819, -0.1143031194806099, 0.2782188653945923, -0.09964144229888916, -0.017873398959636688, 0.13922475278377533, 0.7784702777862549, -0.46928802132606506, -0.7360712885856628, -0.3302375078201294, 0.09153122454881668, -0.5646282434463501, 0.11174175143241882, -0.029409239068627357, -0.2500440776348114, 0.2542390823364258, -0.6616744995117188, -0.38072770833969116, -0.08341169357299805, 0.017833717167377472, 0.22054871916770935, 0.1359151303768158, -0.037467632442712784, 0.05396167188882828, 0.02184951677918434, -0.05378706753253937, 0.22942373156547546, -0.22865641117095947, -0.151996910572052, 0.3640158772468567, -0.12176038324832916, -0.41187769174575806, -0.05468983203172684, 0.09991040080785751, 0.4538428485393524, 0.13938815891742706, -0.06872086226940155, -0.10195142775774002, -0.4129613935947418, -0.04674256592988968, 0.1681407392024994, 0.3665007948875427, 0.3871521055698395, -0.20451822876930237, 0.23717474937438965, -0.006450116168707609, 0.00828450545668602, -0.005110025405883789, 0.16334271430969238, -0.06103643402457237, 0.10286302864551544, 0.308601975440979, 0.33527445793151855, -0.35320335626602173, 0.11919059604406357, -0.17054463922977448, -0.2193998396396637, -0.33577919006347656, -0.14095750451087952, 0.2795148491859436, 0.1314920336008072, 0.059370435774326324, 0.04028000682592392, 0.27325892448425293, -0.44582223892211914, -0.18474747240543365, -0.04632221907377243, -0.25490859150886536, -0.2701581120491028, 0.23285669088363647, 0.28434377908706665, -0.23456993699073792, 0.2603098750114441, -0.008386319503188133, -0.1898975819349289, -0.13835850358009338, -0.1406281739473343, -0.08011722564697266, 0.0012225881218910217, -0.14778897166252136, -0.3870096504688263, 0.12277371436357498, -0.0014526285231113434, -0.08604585379362106, -0.49213433265686035, 0.012346841394901276, -0.060000427067279816, -0.23270496726036072, 0.18624761700630188, 0.030365776270627975, -0.1538860946893692, 0.0011570192873477936, -0.27569931745529175, 0.534951388835907, -0.015309810638427734, -0.15562507510185242, 0.0842251107096672, 0.12617382407188416, -0.4702015817165375, -0.2231363207101822, 0.07444167137145996, 0.5304381847381592, -0.3351955711841583, -0.36405158042907715, 0.2189958095550537, -0.2478264570236206, -0.18968117237091064, 0.1912175863981247, -0.03077402338385582, 0.07091262936592102, 0.08186665922403336, -0.4724404811859131, 0.4036690890789032, -0.3135593831539154, -0.5806622505187988, 0.1731981486082077, -0.1217719316482544, 0.059068962931632996, 0.12335486710071564, 0.2450285255908966, 0.02119828388094902, -0.21160537004470825, 0.0350743904709816, 0.2714942693710327, 0.23076844215393066, -0.10353108495473862, -0.17085975408554077, -0.5892814993858337, -0.012278690934181213, -0.11054368317127228, -0.10654148459434509, 0.1820521503686905, -0.0314149409532547, -0.13742712140083313, 0.4293496012687683, -0.10189180076122284, 0.1435582935810089, 0.08928857743740082, 0.14389368891716003, 0.1261778473854065, -0.07271445542573929, -0.23070040345191956, -0.7074227333068848, 0.26198527216911316, -0.13712537288665771, -0.19404330849647522, 0.2318439930677414, -0.15266571938991547, -0.1330450177192688, 0.0171829704195261, -0.15727612376213074, -0.3991181552410126, 0.0020688213407993317, 0.08989924937486649, 0.3796292841434479, 0.1429072767496109, -0.24849745631217957, 0.22752277553081512, 0.26569056510925293, 0.11733803153038025, -0.1271228790283203, 0.1489335000514984, -0.039364174008369446, -0.18182015419006348, -0.10693870484828949, 0.31388530135154724, 0.3076039254665375, -0.030372554436326027, 0.08700387924909592, 0.331432044506073, -0.09925159066915512, 0.46458059549331665, -0.011603020131587982, 0.22847434878349304, 0.28488588333129883, 0.2583526074886322, 0.15972574055194855, -0.18290387094020844, -0.04143992438912392, 0.056416332721710205, -0.4912637174129486, 0.3805718421936035, 0.0918259248137474, 0.08546381443738937, -0.13659781217575073, -0.20094917714595795, 0.03810505568981171, -0.07665465027093887, -0.21394392848014832, -0.13751590251922607, 0.26883888244628906, 0.035650912672281265, 0.17463457584381104, -0.0782066062092781, 0.033545009791851044, -0.08801735192537308, 0.2544444799423218, -0.15625090897083282, 0.01773975044488907, -0.028861060738563538, -0.2028941810131073, -0.025398777797818184, 0.15041708946228027, 0.11047950387001038, 0.12542983889579773, 0.13649573922157288, 0.07887078821659088, 0.2654285132884979, -0.11025509238243103, 0.020784784108400345, 0.01703132688999176, 0.06253498047590256, 0.22969944775104523, 0.0077640339732170105, 0.1920631378889084, 0.02553538791835308, -0.1790412962436676, 0.2784920632839203, 0.18738125264644623, 0.008396337740123272, -0.06458893418312073, -0.020125342532992363, -0.2492379993200302, -0.15674003958702087, -0.34152111411094666, -0.1612270325422287, -0.28576990962028503, 0.15911981463432312, 0.07408316433429718, 0.5102293491363525, 0.2372123897075653, 0.37577009201049805, 0.09229722619056702, 0.44137877225875854, -0.24180172383785248, -0.18372616171836853, 0.05385899543762207, -0.2550230622291565, -0.11434615403413773, -0.06630901247262955, 0.27571162581443787, -0.25648269057273865, 0.48100778460502625, 0.08587481081485748, -0.15058550238609314, -0.5130938291549683, -0.22690409421920776, 0.1015269011259079, -0.04343351721763611, 0.43238723278045654, -0.06777141988277435, -0.1292404681444168, 0.14360694587230682, -0.0043791052885353565, 0.25266972184181213, -0.1765320748090744, -0.39682286977767944, -0.33493298292160034, 0.1995108425617218, 0.2893160581588745, -0.08616423606872559, -0.16332188248634338, -0.03654130548238754, -0.28109005093574524, 0.6208835244178772, 0.05419791862368584, 0.08451388031244278, 0.15407800674438477, 0.005403134040534496, -0.12821951508522034, 0.14481790363788605, 0.302203506231308, -0.18994282186031342, -0.06083812192082405, -0.12165035307407379, -0.015307256951928139, -0.06091669574379921, -0.11428645253181458, 0.07372071593999863, -0.12925459444522858, 0.44625651836395264, -0.4441794157028198, -0.4599723815917969, 0.07426781207323074, 0.31597721576690674, 0.23500190675258636, -0.06564641743898392, 0.5894107818603516, 0.25934743881225586, 0.07357417047023773, -0.011418860405683517, -0.47736653685569763, -0.05022881180047989, 0.014118852093815804, 0.24088090658187866, 0.41709887981414795, 0.671779990196228, -0.034165941178798676, 1.0345526933670044, 0.41986650228500366, -0.11091403663158417, 0.18726962804794312, 0.0912034884095192, 0.1637003868818283, -0.30628466606140137, -0.08790401369333267, -0.104896679520607, -0.3914971649646759, 0.06410779803991318, 0.3007669448852539, 0.18153521418571472, -0.12006526440382004, -0.2863491177558899, -0.3801323473453522, -0.1726631224155426, -0.19540809094905853, 0.03312959522008896, -0.2767418920993805, 0.2662242352962494, 0.058865826576948166, 0.15508857369422913, -0.32329240441322327, 0.01569058559834957, 0.15039704740047455, 0.11651011556386948, 0.3798515498638153, 0.12281250208616257, -0.4810214936733246, 0.14696304500102997, -0.6618129014968872, 0.3493281602859497, 0.024761822074651718, 0.22605864703655243, 0.034968990832567215, -0.07348112761974335, 0.029639266431331635, -0.20847049355506897, 0.6595993041992188, -0.10461913794279099, 0.13268551230430603, -0.12042276561260223, -0.41573256254196167, -0.2376999855041504, -0.13567952811717987, 0.0954529196023941, 0.3003538250923157, -0.12172317504882812, 0.7676376700401306, -0.3055252134799957, -0.31400352716445923, -0.16018377244472504, 0.10713983327150345, -0.19527702033519745, -0.13644514977931976, -0.12393105030059814, 0.2646673917770386, -0.3034891188144684, 0.03845947980880737, -0.40109774470329285, -0.1871410310268402, -0.05185603350400925, 0.3984929025173187, -0.15171606838703156, 0.14853504300117493, 0.13458873331546783, 0.10059474408626556, 0.1644693911075592, 0.16355538368225098, 0.22187542915344238, 0.3555678129196167, 0.3482429087162018, 0.056899696588516235, 0.32100802659988403, -0.11931033432483673, -0.1516609489917755, -0.19836735725402832, 0.10857801139354706, 0.2918173372745514, 0.39075469970703125, 0.19735585153102875, 0.27038130164146423, 0.16440047323703766, -0.32777929306030273, -0.845162570476532, -0.14572061598300934, 0.16401752829551697, 0.04611392691731453, -0.3905906081199646, -0.44757625460624695, 0.7491768598556519, 0.22752045094966888, -0.31596243381500244, 0.28458648920059204, 0.2615596652030945, -0.14591795206069946, 0.311251699924469, 0.20255084335803986, 1.0406557321548462, -0.0874943882226944, 0.2655434310436249, -0.10599879175424576, -0.4617651700973511, 0.5728248357772827, -0.2610049247741699, 0.2867441177368164, -0.2245662659406662, -0.14948581159114838, -0.10504020005464554, -0.09706659615039825, -0.005985938012599945, 0.03412318229675293, -0.17753733694553375, 0.5208487510681152, 0.07495999336242676, -0.05625622346997261, 0.05266987532377243, 0.1329551339149475, -0.08814974129199982, -0.21787990629673004, -0.19494010508060455, 0.04556170850992203, 0.07528463751077652, 0.3876969516277313, -0.24836933612823486, 0.005191003438085318, -0.12303367257118225, -0.08207102864980698, -0.2047521322965622, -0.22076737880706787, -0.19041785597801208, 0.09114361554384232, -0.05778751149773598, -0.4980563521385193, 0.20119184255599976, 0.18397241830825806, 0.4801099896430969, 0.076090008020401, -0.24624472856521606, -0.19845892488956451, -0.06860249489545822, 0.333072692155838, -0.17197802662849426, -0.18232296407222748, 0.42434972524642944, -0.1465689241886139, -0.17854097485542297, 0.06648892164230347, 0.06742429733276367, -0.3150961995124817, -0.23009110987186432, -0.18999920785427094, 0.19209633767604828, -0.18076437711715698, -0.029379745945334435, 0.2442324161529541, 0.03325757011771202, -0.13412608206272125, -0.01112934947013855, 0.05484461784362793, -0.10522118210792542, -0.02264079451560974, 0.04361891373991966, -0.126307874917984, -0.10397697985172272, 0.5482272505760193, 0.033733632415533066, -0.23012401163578033, 0.6669415235519409, -0.052512843161821365, -0.07883628457784653, -0.08214583992958069, -0.32318052649497986, 0.06599149107933044, -0.4033573567867279, 0.1361159235239029, -0.20887649059295654, -0.2061186581850052, 0.05495406314730644, 0.3140958547592163, 0.42441439628601074, -0.0069072917103767395, 0.09472928941249847, -0.10140234231948853, -0.24872028827667236, 0.1879100203514099, -0.25855541229248047, 0.3178732693195343, 0.14779892563819885, 0.11673218011856079, 0.10303956270217896, 0.09543519467115402, -0.2000945806503296, -0.06802245229482651, 0.026892414316534996, 0.3223678767681122, 0.041740190237760544, -0.02756369858980179, -0.18884845077991486, -0.07155926525592804, -0.11436260491609573, 0.02976212650537491, -0.454650342464447, -0.06181333586573601, -0.21119700372219086, 0.1740526407957077, -0.14649638533592224, 0.01213262602686882, -0.04565827175974846, -0.02699313685297966, 0.09507547318935394, -0.13931672275066376, -0.005671534687280655, 0.21845638751983643, 0.06536474078893661, 0.1383887231349945, 0.35991063714027405, 0.17714691162109375, -0.22274592518806458, 0.1641259640455246, 0.14295653998851776, -0.15223664045333862, 0.05009393021464348, 0.14278624951839447, -0.16795378923416138, 0.07267709076404572, -0.45437905192375183, 0.1880548894405365, 0.27611416578292847, 0.07794450223445892, 0.05312085896730423, -0.008196726441383362, -0.006108906120061874, 0.4421164393424988, 0.4588989019393921, 0.1786322295665741, -0.0004487816186156124, -0.049981437623500824, 0.5852944254875183, 0.062055349349975586, -0.13419711589813232, -0.1588507741689682, 0.3525199592113495, -0.2637135982513428, 0.09688347578048706, 0.19476759433746338, 0.13296182453632355, 0.2695537507534027, 0.16709396243095398, 0.07783687859773636, 0.20798279345035553, -0.3619875907897949, 0.24936868250370026, 0.16799218952655792, 0.260263592004776, 0.051002394407987595, 0.4123953580856323, 0.3025645315647125, 0.15530341863632202, 0.027689211070537567, 0.11835256218910217, 0.029744476079940796, 0.1705072522163391, 0.1917940378189087, 0.21357038617134094, -0.12284357845783234, 0.09977047145366669, 0.18237605690956116, 0.1118728443980217, 0.31170594692230225, -0.06408371031284332, 0.11793509125709534, -0.021396659314632416, -0.14745838940143585, -0.3212708532810211, 0.2513269782066345, -0.04100232571363449, -0.43036165833473206, -0.20025476813316345, -0.20649215579032898, 0.08596530556678772, 0.16008107364177704, -0.3513670861721039, -0.12229922413825989, 0.16674911975860596, -0.023016981780529022, 0.11274825036525726, -0.02299133501946926, -0.06674308329820633, 0.030119819566607475, 0.48328495025634766, -0.26581618189811707, 0.19065894186496735, 0.09814094752073288, 0.15709169209003448, 0.24971382319927216, 0.42046770453453064, 0.13021133840084076, 0.08044721186161041, -0.2696262001991272, 0.15235666930675507, -0.13834430277347565, 0.20802715420722961, 0.04336214065551758, 0.27664288878440857, 0.12418569624423981, -0.007248327136039734, 0.3912274241447449, 0.019108327105641365, 0.08320796489715576, 0.10608763992786407, -0.04670104756951332, -0.04968952015042305, -0.621367335319519, 0.11296366900205612, 0.0037571489810943604, -0.2502267360687256, 0.11724050343036652, 0.25420117378234863, 0.01989269256591797, 0.34724298119544983, 0.1690426468849182, 0.08425398170948029, 0.09059949964284897, 0.12471535056829453, 0.06793387979269028, 0.09208093583583832, 0.34354367852211, 0.5266796350479126, -0.04900899529457092, -0.031986214220523834, -0.017871342599391937, -0.5537123680114746, -0.30443593859672546, 0.07413363456726074, -0.012753676623106003, -0.07353725284337997, 0.0080153439193964, 0.16063310205936432, 0.21342824399471283, -0.09515510499477386, -0.25404831767082214, -0.11114414781332016, 0.12225176393985748, -0.11237384378910065, -0.13529463112354279, 0.1391320824623108, 0.06499923020601273, 0.07728862017393112, -0.35726627707481384, 0.03379916772246361, 0.24770745635032654, -0.1399035006761551, 0.004573732614517212, 0.054916419088840485, 0.04107224568724632, 0.17407944798469543, 0.15803919732570648, 0.18610048294067383, 0.1981290727853775, 0.054962679743766785, -0.307395339012146, -0.3759545683860779, 0.0318346805870533, -0.32311978936195374, -0.15880268812179565, -0.17304536700248718, 0.4299747943878174, -0.5295618176460266, 0.03262220695614815, -0.1283103972673416, 0.40376320481300354, 0.04008261859416962, -0.17675542831420898, -0.2378043234348297, -0.2041310966014862, -0.07515251636505127, -0.38421347737312317, 0.34549304842948914, 0.6352311968803406, -0.07232800126075745, 0.3034830689430237, -0.4578649401664734, -0.007069316692650318, 0.3927344083786011, -0.4573076665401459, -0.09361527860164642, 0.05019707977771759, 0.2657508850097656, 0.292980819940567, -0.17301830649375916, -0.4720241129398346, 0.10634229332208633, 0.29815900325775146, -0.02379690483212471, -0.07025899738073349, 0.4166690409183502, -0.07647325098514557, -0.2987791895866394, -0.1291504204273224, 0.5410032272338867, -0.06086510419845581, -0.2277882844209671, 0.09873746335506439, -0.33742499351501465 ]
https://github.com/huggingface/datasets/issues/6478
How to load data from lakefs
You can create a `pandas` DataFrame following [this](https://lakefs.io/data-version-control/dvc-using-python/) tutorial, and then convert this DataFrame to a `Dataset` with `datasets.Dataset.from_pandas`. For larger datasets (to memory map them), you can use `Dataset.from_generator` with a generator function that reads lakeFS files with `s3fs`.
My dataset is stored on the company's lakefs server. How can I write code to load the dataset? It would be great if I could provide code examples or provide some references
40
How to load data from lakefs My dataset is stored on the company's lakefs server. How can I write code to load the dataset? It would be great if I could provide code examples or provide some references You can create a `pandas` DataFrame following [this](https://lakefs.io/data-version-control/dvc-using-python/) tutorial, and then convert this DataFrame to a `Dataset` with `datasets.Dataset.from_pandas`. For larger datasets (to memory map them), you can use `Dataset.from_generator` with a generator function that reads lakeFS files with `s3fs`.
[ 0.02660747990012169, -0.14837081730365753, -0.03026333451271057, 0.4822254180908203, -0.07394744455814362, 0.07551727443933487, 0.08751225471496582, 0.09296497702598572, 0.4828345775604248, -0.1932596117258072, -0.2740992307662964, 0.447836697101593, -0.0011052833870053291, 0.3326752781867981, 0.055226948112249374, 0.08103049546480179, 0.14121602475643158, 0.20448248088359833, -0.20612967014312744, 0.01735837757587433, -0.02616497129201889, 0.031358636915683746, 0.11419880390167236, -0.09734298288822174, -0.013220816850662231, 0.11253602802753448, -0.32209694385528564, 0.5346415638923645, 0.02705756574869156, -0.2169901728630066, 0.13381493091583252, 0.3284159004688263, 0.38934454321861267, 0.34741517901420593, -0.00011218520376132801, -0.24435822665691376, 0.1289655864238739, -0.10411734879016876, -0.03689425438642502, -0.05058199167251587, 0.008051838725805283, -0.16512218117713928, 0.516937255859375, -0.26563698053359985, -0.12692618370056152, 0.19386093318462372, -0.07745657116174698, -0.37404075264930725, 0.7187259793281555, 0.1569431573152542, 0.16561853885650635, -0.15623922646045685, -0.08020944148302078, 0.33925050497055054, -0.25490543246269226, 0.026586800813674927, 0.06409228593111038, 0.4269333481788635, 0.6863616704940796, 0.03918551653623581, 0.021172814071178436, 0.05330652371048927, -0.4098055064678192, 0.17335174977779388, 0.3286699950695038, -0.07013358175754547, -0.32742375135421753, -0.24684464931488037, 0.12426017969846725, 0.21902364492416382, 0.9632967710494995, -0.12925565242767334, -0.23240743577480316, -0.09960322827100754, 0.03010573238134384, 0.16719962656497955, 0.3097044825553894, -0.025462718680500984, 0.013715162873268127, 0.14864501357078552, -0.3706536591053009, -0.5128805637359619, -0.2197972983121872, -0.004561908543109894, -0.047466591000556946, 0.21596211194992065, -0.27571821212768555, 0.18493854999542236, -0.018304143100976944, -0.25451213121414185, 0.19813759624958038, -0.08284668624401093, -0.07281440496444702, 0.35388240218162537, -0.0961921215057373, -0.12602950632572174, -0.04836040735244751, 0.1290920376777649, 0.02124711498618126, -0.04013419151306152, 0.11606065928936005, 0.03923362120985985, -0.4371274709701538, 0.15031637251377106, 0.2616075873374939, -0.2607652544975281, -0.13688772916793823, -0.03906041011214256, -0.11041669547557831, -0.29745692014694214, -0.2902202606201172, -0.17999008297920227, -0.43779343366622925, -0.07628067582845688, -0.19185933470726013, -0.28690558671951294, 0.05032525211572647, -0.4425216019153595, 0.35482272505760193, 0.004319434519857168, 0.20871859788894653, -0.015648696571588516, 0.17984941601753235, 0.2102116048336029, -0.16124363243579865, 0.2167847752571106, 0.0172109454870224, 0.007256846874952316, -0.13666555285453796, -0.1862746924161911, 0.03598396107554436, -0.04174184426665306, 0.14143338799476624, 0.20801162719726562, 0.11921775341033936, -0.5359262824058533, 0.2311994880437851, 0.11161524802446365, -0.2779834270477295, -0.08282817900180817, -0.007355429232120514, -0.15465977787971497, -0.15086090564727783, 0.11102871596813202, 0.17998425662517548, -0.08469425141811371, 0.13037940859794617, -0.18672829866409302, -0.19435858726501465, 0.24319007992744446, -0.5346943140029907, -0.1832951158285141, -0.4139176607131958, 0.09752222150564194, -0.23653560876846313, -0.12292461097240448, -0.5013758540153503, 0.43146103620529175, -0.34434229135513306, -0.015308467671275139, -0.0752711221575737, -0.011884976178407669, -0.11840757727622986, -0.3182929456233978, 0.28934359550476074, 0.4497116208076477, -0.7215152382850647, 0.17723698914051056, -0.16408398747444153, -0.19454129040241241, 0.022363580763339996, -0.21316927671432495, -0.05238613858819008, 0.017184488475322723, 0.04628004878759384, 0.14270013570785522, 0.5109882950782776, 0.021439041942358017, -0.000343911349773407, 0.504029393196106, -0.031846899539232254, -0.18052396178245544, -0.18737545609474182, 0.38472670316696167, 0.17200882732868195, 0.18222931027412415, -0.2280435562133789, 0.44172924757003784, -0.05329390615224838, -0.09047573804855347, 0.02107154205441475, -0.1809834986925125, -0.26905131340026855, 0.23871465027332306, -0.20803211629390717, 0.18572255969047546, 0.35787689685821533, -0.036030471324920654, 0.04818128049373627, -0.0337802954018116, -0.07651490718126297, 0.35753941535949707, 0.18054315447807312, 0.7635023593902588, -0.08228505402803421, 0.08042535930871964, -0.1893121898174286, 0.2839621305465698, 0.5229237079620361, -0.3951146602630615, 0.2935567796230316, 0.26589322090148926, -0.016846701502799988, -0.02301308512687683, -0.029765401035547256, 0.22496148943901062, 0.07343116402626038, -0.09463183581829071, 0.01175633817911148, -0.06052517890930176, -0.2620611786842346, -0.03461097180843353, -0.05420123040676117, -0.002846845891326666, -0.1897927075624466, 0.3786751329898834, 0.11183009296655655, -0.017833732068538666, 0.08785958588123322, -0.050233952701091766, 0.10585266351699829, 0.07518955320119858, -0.04432116821408272, 0.26859724521636963, 0.11945020407438278, 0.5297743082046509, 0.4505650997161865, 0.28921079635620117, -0.21832817792892456, -0.04637705534696579, 0.4168030023574829, -0.20454920828342438, 0.14378443360328674, 0.035289667546749115, -0.09905452281236649, 0.40368199348449707, -0.32999151945114136, 0.05538072809576988, -0.09799936413764954, 0.0858013778924942, 0.24141690135002136, -0.004922948777675629, 0.15928427875041962, 0.06101514399051666, 0.08132413029670715, 0.12280775606632233, 0.439255028963089, -0.03694107383489609, -0.5593659281730652, -0.08676128834486008, 0.0005113817751407623, -0.3302875757217407, -0.0746956393122673, 0.16112124919891357, -0.13569894433021545, -0.13087347149848938, 0.2676186263561249, 0.0008708275854587555, 0.18335703015327454, 0.18114259839057922, -0.06383444368839264, -0.13798488676548004, 0.14707182347774506, -0.020680144429206848, 0.11173474043607712, -0.0240953266620636, -0.060687605291604996, -0.2574947774410248, -0.12030946463346481, 0.08465182781219482, -0.07167311012744904, -0.20273496210575104, -0.06827253848314285, -0.02078288607299328, -0.37906986474990845, 0.26567307114601135, 0.0009561143815517426, -0.2780921459197998, -0.19529388844966888, 0.1071058139204979, -0.27044230699539185, -0.08496183902025223, -0.2502365708351135, 0.3554576635360718, 0.27432307600975037, -0.3531095087528229, -0.17460426688194275, 0.19021591544151306, 0.09165896475315094, 0.07952530682086945, -0.07720081508159637, -0.10471425950527191, -0.3352373540401459, 0.12090981006622314, 0.25848308205604553, 0.05383337661623955, 0.3113667070865631, -0.15126444399356842, 0.353915810585022, -0.3424217104911804, -0.14331065118312836, -0.0068252719938755035, -0.19578540325164795, 0.34577676653862, -0.09272164106369019, 0.4251164197921753, -0.2300460785627365, 0.11366984248161316, -0.08977434784173965, -0.005060408264398575, 0.04622170329093933, -0.0066559892147779465, 0.01712026633322239, 0.12010397762060165, -0.15832069516181946, -0.07045849412679672, -0.2681640386581421, -0.09281544387340546, 0.14987176656723022, 0.18377003073692322, 0.13244616985321045, -0.33514004945755005, 0.157811239361763, 0.46463438868522644, 0.21166697144508362, 0.17969177663326263, -0.13305503129959106, -0.8403649926185608, 0.23266758024692535, -0.0670897513628006, -0.19003993272781372, 0.4470580518245697, 0.06515608727931976, 0.21494457125663757, -0.25822675228118896, -0.5147879123687744, -0.03044666349887848, 0.2989758551120758, -0.20664997398853302, -0.12152868509292603, 0.19677232205867767, -0.02372650057077408, 0.07658105343580246, 0.15581472218036652, -0.07315593957901001, 0.12195783853530884, -0.057727910578250885, 0.07337521016597748, 0.012256361544132233, 0.37717369198799133, 0.686748743057251, -0.28979751467704773, 0.5753836035728455, -0.16425544023513794, -0.010340195149183273, 0.4042666256427765, -0.16810064017772675, 0.22246651351451874, 0.09953280538320541, 0.02014264278113842, -0.02743869088590145, 0.02673952281475067, -0.10417889803647995, 0.30854833126068115, 0.37249457836151123, 0.07288528233766556, -0.1975940316915512, 0.07763028144836426, -0.5304539203643799, 0.11487884819507599, 0.25154152512550354, -0.5219694375991821, -0.07767533510923386, -0.2613159716129303, -0.17321571707725525, -0.15994466841220856, -0.14266636967658997, -0.40654686093330383, 0.20800213515758514, 0.5160674452781677, 0.05602257326245308, 0.15523897111415863, -0.1427873969078064, -0.558966338634491, 0.4086002707481384, -0.19787153601646423, -0.24186193943023682, -0.10773448646068573, 0.237897127866745, 0.0908810943365097, -0.0906982421875, 0.24775300920009613, -0.010436084121465683, -0.02880369871854782, 0.22411273419857025, -0.37132975459098816, -0.38488414883613586, 0.1354883760213852, -0.2277882993221283, 0.1949189305305481, -0.19652681052684784, 0.2774934768676758, -0.012466579675674438, -0.12296236306428909, -0.44625863432884216, 0.16997464001178741, -0.40312495827674866, -0.24607649445533752, -0.11462953686714172, -0.1451265811920166, -0.27389955520629883, -0.22338518500328064, -0.19246193766593933, 0.07096263766288757, -0.15051382780075073, 0.14511583745479584, 0.0764462798833847, 0.03028392419219017, 0.27520492672920227, 0.3902066648006439, 0.21164581179618835, 0.33230751752853394, 0.019781727343797684, 0.4341289699077606, 0.08216835558414459, -0.14400868117809296, 0.4943172335624695, 0.0339922234416008, 0.2940020263195038, -0.11421551555395126, 0.07484433054924011, 0.34040379524230957, -0.27837201952934265, 0.10970360040664673, -0.058175601065158844, 0.079411581158638, 0.0037914812564849854, -0.46891987323760986, 0.22569869458675385, -0.08459075540304184, 0.17469827830791473, -0.13418817520141602, -0.7250000834465027, 0.6259875893592834, 0.050901662558317184, -0.1303861141204834, 0.386643648147583, 0.14856018126010895, -0.1492498219013214, 0.2531539797782898, 0.357832133769989, 0.4608922600746155, -0.5639252066612244, 0.040771789848804474, 0.34361860156059265, 0.021136507391929626, 0.4806257486343384, -0.12411369383335114, -0.6117470264434814, -0.2882614731788635, 0.09493806958198547, -0.2545470595359802, 0.04245324060320854, -0.03366928547620773, 0.40436476469039917, -0.14065761864185333, 0.28166463971138, -0.11340504884719849, -0.4529610276222229, 0.12050768733024597, 0.3007346987724304, 0.16779553890228271, -0.18851327896118164, -0.4945385456085205, 0.22140267491340637, -0.19616936147212982, -0.1194654256105423, -0.10142285376787186, -0.09447900950908661, 0.02765093371272087, -0.018273916095495224, -0.025130383670330048, -0.019122302532196045, 0.21866343915462494, -0.023991413414478302, -0.035599324852228165, 0.17415855824947357, 0.2181667685508728, 0.31271958351135254, 0.021110404282808304, 0.010942641645669937, -0.25246119499206543, -0.07627628743648529, 0.11723621189594269, -0.07459650188684464, -0.2057866007089615, 0.08883393555879593, 0.08336519449949265, -0.032357264310121536, -0.045581795275211334, 0.19480741024017334, -0.04932026565074921, -0.2778276801109314, 0.02207028865814209, 0.0486624538898468, 0.2534054219722748, -0.16811180114746094, -0.37067118287086487, -0.05366767942905426, -0.058800213038921356, 0.2173454612493515, 0.06663931906223297, 0.4600015878677368, 0.048056311905384064, -0.06054093688726425, 0.045186735689640045, 0.11080193519592285, -0.005373768508434296, 0.09606622159481049, -0.2517245411872864, 0.176153302192688, 0.247584268450737, 0.11790461838245392, 0.12812389433383942, 0.0062092021107673645, 0.032456859946250916, 0.02435990795493126, 0.17518240213394165, -0.2616226077079773, 0.010338828898966312, -0.1099686548113823, 0.060069531202316284, 0.00033305585384368896, 0.13227570056915283, -0.11958061903715134, 0.10170911252498627, -0.462059885263443, -0.37574055790901184, 0.27133411169052124, -0.22091875970363617, 0.1269206404685974, 0.166612446308136, -0.0859738290309906, -0.10311484336853027, 0.03963780030608177, -0.23474477231502533, 0.24838198721408844, -0.18476726114749908, 0.06296366453170776, 0.2030704915523529, 0.2129306197166443, -0.23236435651779175, 0.02226186916232109, 0.09919746220111847, -0.1890522837638855, 0.03277033194899559, -0.1418548971414566, -0.09227843582630157, 0.165996715426445, -0.07377823442220688, -0.37691229581832886, -0.38554275035858154, -0.38785457611083984, -0.2377108633518219, -0.16129615902900696, -0.20419500768184662, -0.03692248836159706, 0.010571368038654327, 0.07021806389093399, 0.2761572599411011, 0.006875678896903992, -0.5917274355888367, 0.09539148956537247, 0.24757371842861176, 0.2610246539115906, -0.2521045506000519, 0.10612804442644119, 0.0520678386092186, -0.1436144858598709, -0.4881899654865265, 0.2243550717830658, 0.3037194013595581, -0.1800471544265747, 0.3510277271270752, 0.16219395399093628, 0.30654671788215637, 0.27441343665122986, 0.34517961740493774, 0.2474488615989685, -0.067143514752388, 0.24757517874240875, 0.30161720514297485, 0.14846880733966827, 0.16974028944969177, 0.07852984964847565, -0.05856704339385033, -0.10433066636323929, -0.10715118050575256, 0.21060577034950256, -0.12189823389053345, 0.19969305396080017, -0.36517488956451416, -0.1347443163394928, 0.2919366955757141, 0.29894089698791504, -0.14149942994117737, -0.052949052304029465, -0.16683225333690643, 0.07311973720788956, 0.1408841460943222, 0.25654155015945435, -0.12320999056100845, 0.26871955394744873, 0.09095248579978943, -0.04306389391422272, -0.23331105709075928, 0.03853699937462807, 0.25718215107917786, -0.5840742588043213, 0.12189771234989166, -0.040006160736083984, -0.017313577234745026, 0.2174261212348938, -0.15478874742984772, -0.11274393647909164, -0.2369653582572937, -0.3203206956386566, -0.09327594935894012, 0.3021838963031769, -0.11241770535707474, -0.178745299577713, 0.1607082188129425, -0.10103586316108704, 0.1542484611272812, 0.19546034932136536, -0.08001640439033508, -0.3816532492637634, 0.03847300633788109, 0.20230162143707275, 0.00673568993806839, -0.21132615208625793, -0.14932841062545776, 0.45591530203819275, -0.18518885970115662, -0.12381304800510406, 0.2932026982307434, -0.06105458736419678, 0.09303614497184753, 0.34664565324783325, -0.30304110050201416, 0.2081594318151474, -0.006259232759475708, -0.09068159759044647, 0.1106623187661171, -0.00011514313519001007, -0.18732476234436035, 0.12929025292396545, 0.06527213752269745, -0.1678103506565094, 0.12552237510681152, 0.2930690050125122, 0.1643102914094925, 0.030697274953126907, 0.05446765199303627, -0.1057729721069336, 0.5314924716949463, -0.31964656710624695, -0.13926279544830322, 0.1817164570093155, -0.02349252626299858, -0.11370214819908142, 0.10049758106470108, -0.5315238833427429, 0.05117683485150337, 0.19260410964488983, 0.1613917499780655, 0.11102094501256943, 0.2020561546087265, 0.03033709153532982, 0.049215152859687805, 0.3669235110282898, 0.3805110454559326, 0.36560729146003723, -0.16672736406326294, -0.24416665732860565, -0.751731276512146, -0.05871240049600601, 0.17528961598873138, -0.37747758626937866, 0.17560367286205292, -0.0299789160490036, 0.1404229700565338, 0.1285790205001831, -0.13070954382419586, 0.1416928917169571, -0.03553512319922447, -0.11398951709270477, 0.0967579334974289, -0.5360913872718811, -0.14995087683200836, 0.2603501081466675, -0.2293335646390915, -0.04268703609704971, 0.2636047899723053, -0.036676064133644104, 0.01249726489186287, -0.16353905200958252, -0.03808458521962166, 0.08187367022037506, 0.32144695520401, 0.0618622787296772, -0.14751064777374268, 0.39211010932922363, -0.10495765507221222, 0.12451835721731186, -0.06837570667266846, -0.12062731385231018, 0.08923806250095367, -0.07914552837610245, -0.22423508763313293, 0.39394834637641907, -0.3230098783969879, 0.2930546998977661, -0.16144463419914246, -0.10637614130973816, -0.3217620849609375, -0.16361288726329803, -0.3110450208187103, -0.23099011182785034, -0.1858867108821869, 0.18739956617355347, 0.05028148368000984, 0.527519166469574, -0.03316836804151535, 0.21852178871631622, -0.03337903320789337, 0.2569664716720581, 0.3013048470020294, -0.6920924186706543, -0.021948643028736115, 0.12428133934736252, -0.1848965585231781, 0.11565105617046356, 0.2345162183046341, -0.3966881036758423, 0.2857666313648224, 0.40386393666267395, -0.16716518998146057, -0.07596920430660248, 0.22326286137104034, 0.14812719821929932, 0.023935798555612564, -0.19295364618301392, 0.20828546583652496, 0.07373277842998505, 0.09997515380382538, -0.0695752426981926, -0.08776205778121948 ]
https://github.com/huggingface/datasets/issues/6478
How to load data from lakefs
@mariosasko hello, This can achieve and https://huggingface.co/datasets Does the same effect apply to the dataset? For example, downloading while using
My dataset is stored on the company's lakefs server. How can I write code to load the dataset? It would be great if I could provide code examples or provide some references
20
How to load data from lakefs My dataset is stored on the company's lakefs server. How can I write code to load the dataset? It would be great if I could provide code examples or provide some references @mariosasko hello, This can achieve and https://huggingface.co/datasets Does the same effect apply to the dataset? For example, downloading while using
[ -0.09849412739276886, -0.08236898481845856, -0.06874360144138336, 0.47989392280578613, -0.06994622945785522, 0.12994644045829773, -0.031182777136564255, 0.0508263036608696, 0.6055765151977539, -0.1214132159948349, -0.35074540972709656, 0.2735242545604706, 0.12763118743896484, 0.35848966240882874, 0.1702461987733841, 0.018691465258598328, 0.006129123270511627, 0.10909401625394821, -0.3577820062637329, 0.052142225205898285, 0.1171606183052063, 0.003851659595966339, 0.052072346210479736, -0.04813934862613678, 0.11030196398496628, -0.017137644812464714, -0.13399097323417664, 0.4342461824417114, -0.1065107062458992, -0.09423983842134476, 0.09299574792385101, 0.4076679050922394, 0.23275931179523468, 0.17668531835079193, -0.0001104541152017191, -0.17028160393238068, 0.24150896072387695, -0.09057734906673431, -0.026105530560016632, -0.05562348663806915, -0.0853460282087326, -0.024136390537023544, 0.47162941098213196, -0.3231619894504547, -0.15821826457977295, 0.2584220767021179, -0.06878144294023514, -0.393313467502594, 0.6600611209869385, 0.008796066977083683, 0.1893310397863388, -0.1197115033864975, 0.0017764866352081299, 0.3196304738521576, -0.28773191571235657, -0.02664458006620407, 0.08477331697940826, 0.32954463362693787, 0.5674682855606079, 0.15890301764011383, -0.09985142201185226, -0.02076488547027111, -0.20068536698818207, 0.24807493388652802, 0.12183178216218948, 0.01071749534457922, -0.279433012008667, -0.2090255171060562, 0.11618494987487793, 0.21658581495285034, 1.0154366493225098, -0.06824567168951035, -0.1092110201716423, 0.0011363252997398376, 0.007166214752942324, 0.21319477260112762, 0.43671876192092896, 0.06333296746015549, -0.11320392787456512, 0.2550378143787384, -0.43404605984687805, -0.5034943222999573, -0.2019730508327484, 0.12258099019527435, 0.08585213124752045, 0.06552976369857788, -0.2752971947193146, 0.19946101307868958, -0.08072030544281006, -0.19849087297916412, 0.0174508485943079, -0.22160916030406952, -0.07086579501628876, 0.31495800614356995, -0.16366411745548248, -0.07663370668888092, -0.09642631560564041, 0.4326041042804718, 0.2025182843208313, -0.01008685678243637, 0.18248507380485535, 0.1408480852842331, -0.5111044049263, 0.13563480973243713, 0.2547862231731415, -0.23751838505268097, -0.02961481362581253, -0.22618862986564636, -0.08731748163700104, -0.1604911834001541, -0.37117770314216614, -0.237953782081604, -0.28975000977516174, 0.13733412325382233, -0.2703680992126465, -0.28273656964302063, 0.09427675604820251, -0.4512823820114136, 0.2592100501060486, -0.1118527352809906, 0.28584030270576477, -0.1076083779335022, 0.19402992725372314, 0.2211819887161255, -0.13310456275939941, 0.018994491547346115, 0.009664885699748993, -0.040827251970767975, -0.1439279168844223, -0.3029620051383972, -0.006219447590410709, -0.15645232796669006, 0.10244356095790863, 0.16000938415527344, 0.16957899928092957, -0.4522569179534912, 0.2319021373987198, 0.15675176680088043, -0.28970831632614136, -0.13687416911125183, 0.08997754007577896, -0.2423998862504959, -0.25875169038772583, 0.07817122340202332, 0.20628851652145386, -0.09832224994897842, 0.006251420825719833, -0.07952788472175598, -0.08564870059490204, 0.3010368049144745, -0.49276918172836304, -0.04973779618740082, -0.1557876318693161, 0.14628303050994873, -0.2905958294868469, -0.13355404138565063, -0.5406702756881714, 0.5353726148605347, -0.4803116023540497, -0.028384685516357422, -0.0712435320019722, 0.12594516575336456, -0.29538777470588684, -0.20102599263191223, 0.24649441242218018, 0.3957592248916626, -0.6126325130462646, 0.03608733415603638, -0.1570514440536499, -0.48547855019569397, 0.016811639070510864, -0.20692776143550873, -0.1474808156490326, 0.2611461877822876, -0.17817652225494385, 0.3281887173652649, 0.607718825340271, 0.13656850159168243, -0.20645803213119507, 0.44601312279701233, -0.14403140544891357, -0.11915519088506699, -0.11082089692354202, 0.351543664932251, 0.2685073912143707, 0.24619534611701965, -0.15985526144504547, 0.5543556809425354, 0.04431520402431488, -0.08234228193759918, -0.022839825600385666, -0.27326297760009766, -0.2820851802825928, 0.25210195779800415, -0.3555089831352234, 0.23552206158638, 0.40332865715026855, -0.0032892231829464436, 0.209379643201828, 0.041038867086172104, -0.07302720844745636, 0.2620629072189331, 0.02553417906165123, 0.7069585919380188, -0.13938391208648682, 0.0874977558851242, -0.33064109086990356, 0.23154354095458984, 0.4602166414260864, -0.5176219940185547, 0.3025498390197754, 0.1744270771741867, 0.012516262009739876, -0.009321974590420723, -0.195128932595253, 0.24406498670578003, 0.08056209236383438, -0.03310985118150711, 0.03305549547076225, 0.06067242845892906, -0.25637149810791016, 0.08039116859436035, -0.11376233398914337, 0.020663760602474213, -0.19710637629032135, 0.41305607557296753, 0.17955346405506134, 0.06498150527477264, -0.0010355040431022644, -0.2664460241794586, 0.11336170881986618, -0.006439329124987125, -0.0877101793885231, 0.22233527898788452, 0.19333980977535248, 0.5177814960479736, 0.5101284384727478, 0.17834191024303436, -0.21351967751979828, -0.04273853451013565, 0.39471012353897095, -0.11628188192844391, 0.19424521923065186, -0.06697104126214981, -0.15676867961883545, 0.33307769894599915, -0.26292794942855835, 0.09777694940567017, -0.061989352107048035, -0.06725433468818665, 0.16098298132419586, -0.12248757481575012, 0.1306113600730896, 0.1489686667919159, 0.2556104362010956, 0.1539412885904312, 0.44030290842056274, -0.07614465802907944, -0.552430272102356, -0.019997641444206238, 0.01742086559534073, -0.24000011384487152, -0.02749653160572052, 0.17469564080238342, -0.17703098058700562, -0.16158711910247803, 0.12001879513263702, -0.07495374977588654, 0.29425862431526184, 0.21526232361793518, 0.09035635739564896, 0.06584946066141129, 0.3390548825263977, -0.1134265810251236, 0.04104417562484741, -0.029924042522907257, -0.16765357553958893, -0.062002263963222504, -0.1006663367152214, 0.0009427843615412712, -0.22985967993736267, -0.07036352157592773, 0.0029988959431648254, -0.09080244600772858, -0.4115162193775177, 0.12114989012479782, -0.02167760580778122, -0.23954802751541138, -0.3132081627845764, 0.24189594388008118, -0.3422149121761322, -0.08391621708869934, -0.19520266354084015, 0.4730759859085083, 0.19704796373844147, -0.29161304235458374, -0.21040429174900055, 0.2016846239566803, 0.03542276471853256, 0.01059650257229805, -0.14711953699588776, 0.012215109542012215, -0.23738330602645874, 0.11792536079883575, 0.32553595304489136, 0.1236041784286499, 0.3527989089488983, -0.11142998933792114, 0.28493422269821167, -0.3586912751197815, -0.21277856826782227, 0.038521476089954376, 0.06007835268974304, 0.285874605178833, -0.26354390382766724, 0.44213932752609253, -0.15470382571220398, 0.12668582797050476, -0.0393214225769043, -0.20166228711605072, -0.12258033454418182, -0.15957100689411163, 0.11418960243463516, 0.3372440040111542, -0.1532205045223236, -0.1777189075946808, -0.20918290317058563, -0.07506968080997467, 0.18204808235168457, 0.1843443512916565, 0.1212034821510315, -0.3360432982444763, -0.009943637065589428, 0.4291940927505493, -0.012707101181149483, 0.13073401153087616, -0.2550230026245117, -0.8732182383537292, 0.17219266295433044, -0.07277648150920868, -0.2562354803085327, 0.4863259494304657, 0.093040831387043, 0.0822966918349266, -0.10103343427181244, -0.5485876202583313, -0.03554949164390564, 0.2617837190628052, -0.02362925559282303, -0.30275818705558777, 0.1920248568058014, -0.12413682043552399, -0.04710045084357262, 0.11597670614719391, -0.08831723034381866, 0.12172740697860718, 0.06926407665014267, 0.056036584079265594, 0.038196757435798645, 0.3984367549419403, 0.5328975915908813, -0.3063446879386902, 0.5469104051589966, -0.2539387345314026, 0.15997634828090668, 0.4112634062767029, -0.10432405024766922, 0.20437829196453094, -0.027997784316539764, 0.15828058123588562, -0.0319027304649353, 0.10934151709079742, -0.04715339094400406, 0.2609401345252991, 0.4439271092414856, 0.0839402824640274, -0.2712715268135071, -0.08462464064359665, -0.45535808801651, 0.06580524146556854, 0.14833934605121613, -0.20364123582839966, -0.09511169046163559, -0.11937913298606873, -0.11468775570392609, 0.0229303240776062, -0.19893959164619446, -0.37155523896217346, 0.30704790353775024, 0.4046812355518341, 0.06824292242527008, -0.028657007962465286, 0.04505519941449165, -0.48540353775024414, 0.3818143606185913, -0.16287685930728912, -0.30126693844795227, -0.16518627107143402, 0.21442964673042297, 0.2503979802131653, 0.04688825085759163, 0.34843167662620544, 0.08552758395671844, 0.1709156334400177, 0.02912406623363495, -0.3541545569896698, -0.14877763390541077, 0.2154417186975479, -0.22542282938957214, 0.10077539831399918, -0.15407031774520874, 0.3232652544975281, -0.03499090299010277, -0.07494980096817017, -0.3746510148048401, 0.21562878787517548, -0.33488407731056213, -0.37362128496170044, -0.13380709290504456, -0.20443439483642578, -0.314103901386261, -0.185724139213562, -0.23968368768692017, -0.0137720862403512, -0.14035721123218536, 0.10522684454917908, -0.0019930191338062286, 0.0533481165766716, 0.09840172529220581, 0.20249485969543457, 0.22403591871261597, 0.26582249999046326, 0.03524621203541756, 0.5194970369338989, 0.011921223253011703, -0.14282383024692535, 0.5075382590293884, 0.08292195200920105, 0.2956704795360565, -0.1580505669116974, 0.01876073330640793, 0.14114171266555786, -0.1434875726699829, 0.1194373369216919, 0.10315066576004028, 0.0524781197309494, -0.018434390425682068, -0.36615827679634094, 0.33697637915611267, -0.20139095187187195, 0.2380899339914322, -0.12243745476007462, -0.6754069328308105, 0.6718107461929321, -0.03780670464038849, -0.12532086670398712, 0.4448174834251404, 0.12678013741970062, -0.23707976937294006, 0.06498830020427704, 0.08636098355054855, 0.5093772411346436, -0.4524163007736206, -0.04150090739130974, 0.18723487854003906, 0.05093452334403992, 0.40207287669181824, -0.18688617646694183, -0.4635399580001831, -0.18185825645923615, -0.00217392947524786, -0.27875906229019165, 0.002411212772130966, 0.09325908124446869, 0.4769858121871948, -0.11579316854476929, 0.19828197360038757, -0.14674031734466553, -0.289215087890625, 0.11675678938627243, 0.39354658126831055, 0.15146587789058685, -0.15445633232593536, -0.47625067830085754, 0.21083910763263702, -0.23583154380321503, 0.10434314608573914, -0.12261872738599777, -0.13404734432697296, 0.14876319468021393, -0.0367916002869606, 0.029192477464675903, 0.04745514690876007, 0.07452432811260223, 0.07653789222240448, -0.11601419746875763, 0.1706613451242447, 0.1879974603652954, 0.21342019736766815, -0.11382821202278137, -0.0026392266154289246, -0.2585252523422241, -0.031643111258745193, -0.0152931809425354, -0.020769676193594933, -0.24304869771003723, 0.10307151824235916, -0.05051115155220032, -0.04070204868912697, -0.20650425553321838, 0.0714338943362236, -0.01577186770737171, -0.2725868225097656, -0.00911027193069458, 0.057060375809669495, 0.2513028383255005, -0.2148849219083786, -0.4427718222141266, 0.005282826721668243, -0.03190608322620392, 0.22551558911800385, 0.0673922598361969, 0.46504348516464233, -0.0563354454934597, -0.06447280198335648, 0.3019932806491852, 0.05990661680698395, 0.014365102164447308, 0.23315829038619995, -0.2305355966091156, 0.11083771288394928, 0.2548413872718811, 0.015579145401716232, 0.06807462126016617, -0.04101487621665001, 0.12365341931581497, 0.05016754940152168, 0.10824688524007797, -0.322308748960495, 0.08831796050071716, 0.2508470416069031, -0.09333512932062149, 0.01744575798511505, -0.08641545474529266, -0.12293239682912827, -0.02234838344156742, -0.5543196201324463, -0.34222331643104553, 0.2635727524757385, -0.21370775997638702, 0.07092254608869553, 0.25060826539993286, -0.04521341249346733, 0.10240775346755981, 0.009945170022547245, -0.23961874842643738, 0.27662333846092224, -0.019186517223715782, 0.009521180763840675, 0.3808853328227997, 0.18947270512580872, -0.16597503423690796, 0.027135159820318222, 0.15132901072502136, -0.10645182430744171, -0.07425710558891296, -0.17951127886772156, -0.04960491880774498, 0.18197378516197205, -0.10007931292057037, -0.30380499362945557, -0.47634953260421753, -0.4514853358268738, -0.14357955753803253, 0.016448974609375, -0.13854442536830902, -0.16152915358543396, 0.009383067488670349, -0.09480251371860504, 0.30538737773895264, 0.1340472400188446, -0.6653406023979187, 0.1270383596420288, 0.17017735540866852, 0.2833598852157593, -0.26461368799209595, -0.048253484070301056, -0.004661282524466515, -0.04595930874347687, -0.39701464772224426, 0.10610783100128174, 0.4934843182563782, -0.10051698237657547, 0.2594190537929535, 0.15701265633106232, 0.36220619082450867, 0.11225137859582901, 0.34988605976104736, 0.30899733304977417, -0.08949427306652069, 0.14294014871120453, 0.15281888842582703, 0.19351936876773834, 0.1304354965686798, 0.1096729263663292, 0.16342005133628845, -0.15935349464416504, -0.13712547719478607, 0.18405850231647491, -0.12737245857715607, 0.3666914999485016, -0.3305850625038147, -0.18007513880729675, 0.33380505442619324, 0.3029758930206299, -0.09221740067005157, -0.06524008512496948, -0.2459290474653244, 0.11848388612270355, 0.11722610145807266, 0.34887945652008057, -0.18888506293296814, 0.3355291485786438, 0.06485876441001892, 0.003624921664595604, -0.1778930127620697, 0.04473091661930084, 0.17715393006801605, -0.6773390173912048, 0.08037975430488586, 0.15715391933918, -0.07397405803203583, 0.19422954320907593, -0.12565240263938904, -0.25593429803848267, -0.11344563215970993, -0.3302924633026123, -0.002090172842144966, 0.23585252463817596, -0.07424630224704742, -0.05595387518405914, 0.18810848891735077, -0.18296286463737488, 0.17185980081558228, 0.27986839413642883, -0.12650945782661438, -0.29806798696517944, 0.06927309185266495, 0.15153324604034424, -0.019258707761764526, -0.34358251094818115, -0.15800458192825317, 0.504326581954956, -0.25304123759269714, -0.14952553808689117, 0.3793451189994812, -0.03437866270542145, 0.2544723153114319, 0.37355729937553406, -0.15557655692100525, -0.03380783274769783, -0.10351115465164185, 0.011861810460686684, 0.07383077591657639, -0.005195813253521919, -0.1584419310092926, -0.03350066766142845, 0.09628836065530777, 0.10595204681158066, 0.02482076734304428, 0.3491246700286865, 0.16841435432434082, 0.026045359671115875, 0.1280439794063568, 0.004719357937574387, 0.41692593693733215, -0.442315012216568, -0.16738459467887878, 0.08894744515419006, 0.06629768759012222, -0.16634054481983185, -0.09940776973962784, -0.3871374726295471, -0.04865983501076698, 0.14801795780658722, -0.006059241481125355, 0.09282655268907547, 0.17096693813800812, 0.03697696700692177, -0.04551338776946068, 0.3932272493839264, 0.3050524890422821, 0.35698428750038147, -0.31369346380233765, -0.30637824535369873, -0.6760792136192322, -0.1002323254942894, 0.23589788377285004, -0.3164118826389313, 0.11380724608898163, -0.007019049488008022, 0.045702941715717316, 0.3317875266075134, 0.032819539308547974, 0.07068320363759995, 0.10012227296829224, -0.20669561624526978, 0.10377544164657593, -0.46980398893356323, -0.07867246866226196, 0.2970513105392456, -0.22515909373760223, -0.21620559692382812, 0.35970574617385864, -0.08726803958415985, 0.00012433528900146484, -0.12905487418174744, 0.08691059052944183, -0.09414052963256836, 0.27555519342422485, 0.04427472501993179, -0.12037938833236694, 0.5066604614257812, -0.05990458279848099, 0.15367785096168518, 0.027155563235282898, -0.23436152935028076, 0.008724666200578213, -0.021787278354167938, -0.26116305589675903, 0.2834523916244507, -0.2104116827249527, 0.2275811731815338, -0.03712132200598717, -0.21176964044570923, -0.3084160089492798, -0.1040525957942009, -0.26968950033187866, -0.2908076345920563, -0.17473569512367249, 0.1649727076292038, 0.0470389723777771, 0.4598766565322876, -0.017769314348697662, 0.011779846623539925, -0.045228343456983566, 0.28807058930397034, 0.3278696537017822, -0.36118754744529724, 0.02803722396492958, 0.08001156151294708, -0.10229650139808655, 0.15041954815387726, 0.17942140996456146, -0.5552321672439575, 0.3331693708896637, 0.5635507702827454, -0.2686229348182678, -0.0051165297627449036, 0.37408316135406494, 0.09920771420001984, 0.005270116031169891, -0.11171002686023712, 0.17637574672698975, 0.16297796368598938, 0.044073037803173065, -0.11636334657669067, -0.07614661753177643 ]
https://github.com/huggingface/datasets/issues/6475
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed
~~You will see this error if the cache dir filepath contains relative `..` paths. Use `os.path.realpath(_CACHE_DIR)` before passing it to the `load_dataset` function.~~
### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0
23
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed ### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0 ~~You will see this error if the cache dir filepath contains relative `..` paths. Use `os.path.realpath(_CACHE_DIR)` before passing it to the `load_dataset` function.~~
[ -0.10396318137645721, -0.1658564954996109, -0.06416884064674377, 0.3617137670516968, 0.045910730957984924, -0.1833963394165039, -0.012238878756761551, 0.26278215646743774, -0.2864784300327301, -0.08144982159137726, -0.02400197833776474, 0.0840771496295929, -0.14902691543102264, 0.1495058536529541, -0.03063856065273285, -0.03984741121530533, 0.0771910548210144, 0.12992259860038757, 0.2934598922729492, 0.16215330362319946, -0.4650859832763672, 0.35488027334213257, -0.2558758854866028, 0.10274055600166321, -0.06378618627786636, 0.1223767027258873, -0.3196195960044861, 0.5092806220054626, -0.28727012872695923, -0.3582841157913208, 0.4790029525756836, -0.30870354175567627, 0.36739757657051086, 0.1376122534275055, -0.00011523867578944191, 0.05485638976097107, 0.46044373512268066, -0.053147390484809875, 0.1673220545053482, 0.0958859995007515, 0.09431613236665726, -0.3622174561023712, -0.1488802433013916, -0.3601912558078766, 0.04446486383676529, -0.19450753927230835, -0.11527718603610992, -0.4744306206703186, 0.3433225452899933, 0.34332796931266785, 0.17225056886672974, 0.23018306493759155, 0.3630772829055786, 0.22018302977085114, 0.6044424772262573, -0.4517322778701782, -0.11601124703884125, 0.1880270540714264, 0.09052082151174545, -0.19645997881889343, 0.12938793003559113, 0.09616880118846893, -0.16839519143104553, -0.07067321240901947, -0.15562501549720764, -0.09010029584169388, 0.14442545175552368, -0.3717038035392761, -0.04261757433414459, 0.067752905189991, -0.03524560481309891, -0.05534256994724274, -0.16399887204170227, 0.26411646604537964, 0.030805695801973343, -0.5285080671310425, 0.2086520791053772, 0.35857439041137695, -0.0847676694393158, -0.05767494812607765, -0.04259467497467995, 0.09457999467849731, -0.0017680823802947998, 0.10504259169101715, -0.12069675326347351, 0.19219088554382324, -0.0820118635892868, 0.18123333156108856, 0.04026917368173599, 0.003902548924088478, 0.21010437607765198, 0.22022745013237, -0.32798096537590027, 0.10570291429758072, -0.4765613079071045, 0.04070339351892471, -0.08174420148134232, 0.28546828031539917, -0.044916849583387375, -0.050283730030059814, -0.08062916994094849, -0.0865580216050148, -0.14981800317764282, -0.11620870977640152, -0.05401568487286568, 0.4200056791305542, 0.0047071874141693115, -0.38476327061653137, 0.24009813368320465, 0.18792808055877686, 0.16747629642486572, 0.054135218262672424, -0.39239582419395447, -0.4642088711261749, -0.048038382083177567, -0.04021858051419258, 0.32786017656326294, -0.37214094400405884, -0.5733500719070435, 0.14143170416355133, -0.5692523121833801, 0.20278558135032654, 0.06204264983534813, 0.2793368101119995, -0.34032508730888367, -0.13716629147529602, 0.29225385189056396, 0.1804284006357193, -0.165046826004982, 0.03734845295548439, -0.008327510207891464, 0.21995852887630463, -0.19099698960781097, -0.10635039955377579, 0.08154016733169556, -0.36832407116889954, 0.5237658023834229, 0.22890357673168182, -0.017118431627750397, 0.05429517477750778, 0.10540474951267242, -0.22765959799289703, -0.3076716363430023, 0.28638675808906555, -0.1566094160079956, -0.007442089729011059, 0.13802756369113922, 0.062122322618961334, 0.012379884719848633, 0.25426024198532104, -0.1505430042743683, -0.20728950202465057, -0.2037099301815033, 0.16265088319778442, -0.10137004405260086, 0.1700955331325531, 0.3873383104801178, 0.024755358695983887, 0.2557815909385681, -0.19022274017333984, 0.024442583322525024, -0.17892122268676758, -0.49436888098716736, -0.16883385181427002, 0.3723070025444031, 0.008580997586250305, -0.09290443360805511, 0.045592911541461945, -0.29972293972969055, -0.09407852590084076, 0.3640092611312866, 0.10164648294448853, -0.06267382204532623, -0.010548621416091919, -0.46043023467063904, 0.08122338354587555, -0.19129881262779236, -0.34107106924057007, -0.32865041494369507, 0.4735720157623291, -0.1620633602142334, 0.33762502670288086, 0.01470162719488144, -0.009244699962437153, -0.2239348292350769, -0.35918083786964417, 0.4350607395172119, 0.17353065311908722, -0.0058902557939291, -0.13615484535694122, -0.48548388481140137, -0.4237338900566101, 0.3071894645690918, 0.33309096097946167, 0.16834299266338348, -0.19748345017433167, 0.1543683260679245, 0.5204558372497559, 0.1619521975517273, 0.09422635287046432, 0.0824144259095192, 0.19880864024162292, -0.245722696185112, -0.2646991014480591, -0.07643380761146545, 0.04763974994421005, -0.1596105694770813, 0.2700636386871338, -0.28090742230415344, 0.15925690531730652, -0.06307756900787354, 0.1164504885673523, -0.2511117458343506, 0.18181106448173523, -0.09474271535873413, -0.2472255825996399, 0.1807108074426651, 0.068353071808815, -0.23802818357944489, -0.08220233023166656, 0.16630326211452484, 0.41525545716285706, 0.06355112791061401, -0.08599527925252914, -0.10765910148620605, 0.014787474647164345, -0.3218420445919037, -0.10912773013114929, 0.10928100347518921, 0.21685755252838135, 0.22975510358810425, 0.013429281301796436, -0.17475131154060364, 0.28259509801864624, 0.15150736272335052, -0.21642975509166718, -0.02172110229730606, -0.12831290066242218, 0.3187291622161865, -0.3926483690738678, 0.28817808628082275, 0.4494491517543793, 0.06076633185148239, -0.023594167083501816, 0.28204065561294556, 0.20420968532562256, -0.20786608755588531, -0.05499560385942459, -0.011961229145526886, -0.0222882479429245, 0.15183529257774353, -0.1312483847141266, -0.20130003988742828, -0.01967892050743103, 0.5470788478851318, 0.2590557336807251, -0.07472953200340271, 0.16692420840263367, -0.10432539880275726, -0.1967262625694275, 0.18989036977291107, 0.01880810409784317, -0.030384831130504608, 0.08124957233667374, -0.22530221939086914, -0.16734877228736877, 0.30194711685180664, -0.4550797641277313, 0.5055994987487793, 0.006160619203001261, -0.18173639476299286, 0.20135441422462463, -0.2803895175457001, -0.13446475565433502, 0.23612672090530396, 0.027283646166324615, 0.1782967746257782, 0.29030248522758484, 0.08071767538785934, 0.13685756921768188, -0.40517011284828186, -0.23393835127353668, -0.057251378893852234, 0.06609947979450226, -0.24410852789878845, -0.23566119372844696, -0.09920857101678848, -0.001776285469532013, 0.1236765906214714, -0.40121564269065857, -0.19181270897388458, 0.03832131624221802, -0.014187291264533997, 0.09390968084335327, 0.1081240326166153, 0.007352706976234913, -0.28722625970840454, 0.050189509987831116, 0.22673721611499786, -0.0701567754149437, -0.01220107451081276, 0.11828882992267609, -0.3647078573703766, 0.044692378491163254, 0.1680942177772522, -0.10000324994325638, 0.1386716514825821, 0.038295574486255646, -0.028410546481609344, -0.12430635839700699, -0.33586063981056213, -0.04494093358516693, -0.184409961104393, 0.675073504447937, 0.08657554537057877, 0.044727977365255356, -0.2883932590484619, -0.39848989248275757, 0.20048770308494568, 0.2731606960296631, -0.1155707836151123, 0.1409587264060974, 0.0858575776219368, 0.07656078785657883, -0.17892161011695862, -0.044758595526218414, -0.07274269312620163, -0.3597073554992676, 0.01941404864192009, -0.03579612076282501, -0.11587226390838623, 0.13168883323669434, -0.18240635097026825, 0.17288416624069214, 0.5054889917373657, 0.02528655156493187, -0.2901579737663269, -0.3475990295410156, 0.1905186027288437, -0.06264864653348923, -0.2594660520553589, -0.05778328329324722, -0.0026705749332904816, 0.09334969520568848, 0.2697675824165344, -0.42312484979629517, -0.04174503684043884, -0.014795919880270958, 0.14797621965408325, -0.17382241785526276, -0.3538969159126282, 0.2849053740501404, 0.2340078055858612, -0.03137299045920372, -0.09749604016542435, -0.2075367569923401, -0.07764723151922226, -0.008408699184656143, 0.4140312373638153, 0.002065306529402733, 0.20911955833435059, -0.017816372215747833, 0.04531519487500191, 0.15128271281719208, 0.2853335738182068, 0.7059415578842163, 0.15238270163536072, 0.1911250203847885, 0.12037934362888336, -0.2509270906448364, 0.1740177571773529, -0.20073163509368896, -0.014154101721942425, 0.33949872851371765, -0.06420644372701645, -0.00702819786965847, -0.2144095003604889, -0.08470308780670166, -0.21895474195480347, -0.062671959400177, 0.013783234171569347, -0.1984517127275467, 0.34522363543510437, -0.20986807346343994, -0.08896081149578094, 0.36883628368377686, -0.026597287505865097, 0.21737021207809448, 0.17576996982097626, -0.1267344355583191, -0.1552066057920456, -0.19829697906970978, -0.21983826160430908, -0.4107115566730499, 0.2797967195510864, 0.13473951816558838, 0.6053631901741028, 0.024261970072984695, -0.04728056117892265, -0.009520165622234344, -0.3188266456127167, 0.44892358779907227, -0.11870791763067245, 0.11287638545036316, 0.12380711734294891, -0.012164819985628128, -0.5684407949447632, -0.29695290327072144, -0.06092183664441109, 0.2707672417163849, 0.049191784113645554, 0.4614696800708771, -0.1427006721496582, 0.2389986664056778, 0.315900981426239, 0.13029681146144867, -0.09473742544651031, -0.08245020359754562, -0.4103216230869293, -0.6870731115341187, -0.1309131234884262, 0.038848500698804855, -0.09975145757198334, 0.4027709364891052, -0.15969029068946838, -0.09481701999902725, -0.08056039363145828, 0.19697529077529907, -0.06398084759712219, -0.06338833272457123, 0.0739927664399147, 0.0868270993232727, 0.2531450092792511, -0.09419143199920654, 0.2027396261692047, -0.05720166862010956, 0.31642061471939087, 0.13974978029727936, -0.25895535945892334, 0.04596645012497902, 0.08078401535749435, 0.08692130446434021, 0.2498498111963272, -0.22185015678405762, -0.20216262340545654, 0.042904794216156006, 0.0741298571228981, -0.0531868077814579, 0.25452932715415955, 0.8272789120674133, -0.27019721269607544, -0.3177138864994049, -0.05536390841007233, 0.3019482493400574, -0.035790666937828064, -0.031045030802488327, -0.1361473947763443, -0.4344770908355713, -0.19778074324131012, 0.4961393475532532, 0.22306165099143982, 0.9382805824279785, 0.06029851734638214, 0.07747390866279602, 0.36871129274368286, 0.06222014129161835, 0.261342853307724, -0.436367392539978, 0.11314044892787933, -0.03354635834693909, -0.4514071047306061, 0.13319513201713562, 0.11602902412414551, 0.1124788299202919, -0.12724338471889496, -0.3201117217540741, -0.004287440329790115, 0.17103101313114166, -0.1982191652059555, 0.20202995836734772, -0.11692741513252258, -0.03284744173288345, -0.1594519019126892, -0.30887824296951294, 0.10638882219791412, 0.018059711903333664, 0.2763407528400421, -0.32945775985717773, 0.07050231099128723, 0.08831067383289337, -0.2714240550994873, -0.33382681012153625, 0.3557634949684143, -0.2556294798851013, 0.2920178771018982, -0.6306742429733276, 0.15711453557014465, -0.11657126247882843, 0.21915215253829956, 0.3410787582397461, 0.3689152002334595, -0.16857074201107025, 0.15864132344722748, 0.29903677105903625, -0.11008032411336899, 0.23795278370380402, -0.17699816823005676, -0.06213122606277466, -0.29552531242370605, -0.18054336309432983, -0.006072007119655609, -0.29743215441703796, 0.08405224978923798, -0.018683001399040222, 0.0911019891500473, -0.01000211387872696, 0.005315215792506933, -0.06519843637943268, -0.004380226135253906, 0.3272298276424408, -0.21076896786689758, 0.13338255882263184, 0.007430829107761383, -0.1289440095424652, 0.2952834963798523, -0.3113306760787964, -0.39142927527427673, -0.05662054196000099, 0.41349461674690247, -0.019437439739704132, 0.2364853322505951, 0.3887900710105896, 0.008746769279241562, 0.12820586562156677, -0.06725127249956131, -0.05177865922451019, -0.3094165623188019, -0.17839114367961884, 0.06226048246026039, 0.40574753284454346, -0.021263964474201202, -0.04132126271724701, 0.6821672916412354, 0.5023379921913147, -0.05805019289255142, 0.2842259705066681, -0.5085428357124329, -0.053661465644836426, 0.41216886043548584, 0.039025746285915375, 0.235213503241539, 0.11354953795671463, 0.15442945063114166, 0.1110527366399765, -0.01907435990869999, -0.24681416153907776, 0.021809792146086693, -0.153691366314888, 0.10439179092645645, -0.08066314458847046, 0.07095588743686676, 0.3835847079753876, 0.3150915205478668, 0.18962092697620392, 0.1593913435935974, 0.012683290056884289, -0.13242052495479584, -0.20616857707500458, 0.15075919032096863, 0.12781068682670593, -0.25666311383247375, 0.1267160028219223, -0.2540701627731323, 0.0822921171784401, -0.033575452864170074, -0.02667447179555893, 0.13791200518608093, 0.0697200745344162, -0.10875383764505386, 0.08206716924905777, 0.12426124513149261, -0.04286176711320877, 0.3303702175617218, -0.03857188671827316, 0.3692846894264221, 0.23078685998916626, 0.219427227973938, 0.01910974271595478, -0.11759467422962189, 0.6458368301391602, -0.23686110973358154, -0.04535818099975586, 0.12787358462810516, 0.03256795555353165, -0.17061109840869904, -0.05049710348248482, -0.0771624818444252, 0.18255779147148132, 0.5723705887794495, -0.20992954075336456, -0.14079710841178894, 0.15141195058822632, 0.194304421544075, -0.3506428599357605, 0.0013894770527258515, 0.025028983131051064, -0.45401936769485474, -0.2719036042690277, 0.06966239213943481, 0.12043818831443787, -0.022400878369808197, 0.07968534529209137, -0.12065999954938889, 0.2021828293800354, 0.07756482064723969, -0.10862641036510468, 0.3175910413265228, -0.1361135095357895, 0.20454400777816772, 0.04626336693763733, -0.3149254322052002, 0.37645089626312256, 0.2715967893600464, 0.14238962531089783, -0.1644340604543686, 0.11133373528718948, 0.570709764957428, -0.161426842212677, -0.40532830357551575, -0.050516340881586075, 0.460482656955719, 0.052108071744441986, -0.0041686370968818665, -0.012508861720561981, 0.46504542231559753, -0.15834172070026398, -0.09814237803220749, -0.400020956993103, 0.40834593772888184, -0.11230169981718063, -0.2506638467311859, 0.20403268933296204, -0.0223197303712368, -0.32103824615478516, 0.19936393201351166, -0.00882018730044365, 0.2969422936439514, -0.1414569467306137, 0.30034640431404114, -0.34923744201660156, -0.2137998640537262, -0.24988865852355957, 0.3892728388309479, -0.24792155623435974, -0.3205779790878296, 0.3538101315498352, 0.27754461765289307, -0.14086118340492249, -0.12944549322128296, 0.27486395835876465, 0.2537926137447357, 0.28803426027297974, -0.4131760597229004, -0.15939603745937347, 0.25405043363571167, 0.2008870393037796, -0.23630540072917938, 0.1896883249282837, 0.5250464677810669, 0.46516165137290955, 0.25976452231407166, 0.1164189875125885, -0.2230025678873062, 0.3714628517627716, -0.11950945854187012, -0.2746327817440033, -0.03436828404664993, 0.11163027584552765, 0.0272496547549963, 0.006951227784156799, -0.05608365684747696, -0.07173549383878708, -0.41343042254447937, 0.15677982568740845, -0.02207026258111, -0.05299657583236694, 0.042912665754556656, 0.004690198693424463, 0.07002294808626175, 0.03816083073616028, 0.3015451729297638, 0.41265085339546204, 0.29615840315818787, -0.27783313393592834, -0.6142833232879639, -0.609196662902832, 0.21157948672771454, -0.03502114489674568, 0.13998739421367645, 0.06432487070560455, -0.1356162130832672, -0.019466541707515717, 0.09293445944786072, -0.15853892266750336, -0.3117798864841461, 0.24147766828536987, 0.07942589372396469, -0.2589091360569, 0.24800267815589905, 0.4954819083213806, 0.058294542133808136, -0.13152071833610535, -0.4492769241333008, 0.15586937963962555, 0.024809330701828003, 0.07500588893890381, -0.15926514565944672, -0.3705042898654938, 0.009272489696741104, -0.46183785796165466, 0.8872697353363037, 0.09777717292308807, 0.16251987218856812, -0.1749747097492218, -0.22559593617916107, -0.2874727249145508, -0.11634852737188339, 0.013107637874782085, 0.012100376188755035, 0.19317810237407684, 0.2746496796607971, -0.03941042721271515, 0.4162321388721466, -0.30120113492012024, 0.21877819299697876, 0.022692278027534485, -0.10465989261865616, -0.28682202100753784, -0.04481813311576843, -0.15804550051689148, -0.10041826963424683, -0.3055849075317383, 0.31130552291870117, -0.004229240119457245, 0.23836414515972137, -0.32406821846961975, -0.38642624020576477, 0.3152194619178772, -0.246345654129982, -0.0803663432598114, 0.21592918038368225, 0.301235556602478, -0.34466224908828735, -0.11868561059236526, 0.27865153551101685, 0.07851838320493698, 0.28991949558258057, 0.3873494863510132, -0.3197360932826996, 0.22576572000980377, -0.0417034737765789, -0.18798695504665375, -0.0010480470955371857, 0.23499229550361633, 0.04246830567717552, -0.2748907506465912, 0.275691956281662, -0.13954386115074158 ]
https://github.com/huggingface/datasets/issues/6475
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed
Based on the StackOverflow answer, this causes the error to go away: ```diff diff --git a/table.py b/table.py --- a/table.py +++ b/table.py (date 1701824849806) @@ -47,7 +47,7 @@ def _memory_mapped_record_batch_reader_from_file(filename: str) -> pa.RecordBatchStreamReader: - memory_mapped_stream = pa.memory_map(filename) + memory_mapped_stream = pa.memory_map(filename, "r+") return pa.ipc.open_stream(memory_mapped_stream) ``` But now loading the dataset goes very, very slowly, which is unexpected.
### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0
56
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed ### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0 Based on the StackOverflow answer, this causes the error to go away: ```diff diff --git a/table.py b/table.py --- a/table.py +++ b/table.py (date 1701824849806) @@ -47,7 +47,7 @@ def _memory_mapped_record_batch_reader_from_file(filename: str) -> pa.RecordBatchStreamReader: - memory_mapped_stream = pa.memory_map(filename) + memory_mapped_stream = pa.memory_map(filename, "r+") return pa.ipc.open_stream(memory_mapped_stream) ``` But now loading the dataset goes very, very slowly, which is unexpected.
[ -0.10396318137645721, -0.1658564954996109, -0.06416884064674377, 0.3617137670516968, 0.045910730957984924, -0.1833963394165039, -0.012238878756761551, 0.26278215646743774, -0.2864784300327301, -0.08144982159137726, -0.02400197833776474, 0.0840771496295929, -0.14902691543102264, 0.1495058536529541, -0.03063856065273285, -0.03984741121530533, 0.0771910548210144, 0.12992259860038757, 0.2934598922729492, 0.16215330362319946, -0.4650859832763672, 0.35488027334213257, -0.2558758854866028, 0.10274055600166321, -0.06378618627786636, 0.1223767027258873, -0.3196195960044861, 0.5092806220054626, -0.28727012872695923, -0.3582841157913208, 0.4790029525756836, -0.30870354175567627, 0.36739757657051086, 0.1376122534275055, -0.00011523867578944191, 0.05485638976097107, 0.46044373512268066, -0.053147390484809875, 0.1673220545053482, 0.0958859995007515, 0.09431613236665726, -0.3622174561023712, -0.1488802433013916, -0.3601912558078766, 0.04446486383676529, -0.19450753927230835, -0.11527718603610992, -0.4744306206703186, 0.3433225452899933, 0.34332796931266785, 0.17225056886672974, 0.23018306493759155, 0.3630772829055786, 0.22018302977085114, 0.6044424772262573, -0.4517322778701782, -0.11601124703884125, 0.1880270540714264, 0.09052082151174545, -0.19645997881889343, 0.12938793003559113, 0.09616880118846893, -0.16839519143104553, -0.07067321240901947, -0.15562501549720764, -0.09010029584169388, 0.14442545175552368, -0.3717038035392761, -0.04261757433414459, 0.067752905189991, -0.03524560481309891, -0.05534256994724274, -0.16399887204170227, 0.26411646604537964, 0.030805695801973343, -0.5285080671310425, 0.2086520791053772, 0.35857439041137695, -0.0847676694393158, -0.05767494812607765, -0.04259467497467995, 0.09457999467849731, -0.0017680823802947998, 0.10504259169101715, -0.12069675326347351, 0.19219088554382324, -0.0820118635892868, 0.18123333156108856, 0.04026917368173599, 0.003902548924088478, 0.21010437607765198, 0.22022745013237, -0.32798096537590027, 0.10570291429758072, -0.4765613079071045, 0.04070339351892471, -0.08174420148134232, 0.28546828031539917, -0.044916849583387375, -0.050283730030059814, -0.08062916994094849, -0.0865580216050148, -0.14981800317764282, -0.11620870977640152, -0.05401568487286568, 0.4200056791305542, 0.0047071874141693115, -0.38476327061653137, 0.24009813368320465, 0.18792808055877686, 0.16747629642486572, 0.054135218262672424, -0.39239582419395447, -0.4642088711261749, -0.048038382083177567, -0.04021858051419258, 0.32786017656326294, -0.37214094400405884, -0.5733500719070435, 0.14143170416355133, -0.5692523121833801, 0.20278558135032654, 0.06204264983534813, 0.2793368101119995, -0.34032508730888367, -0.13716629147529602, 0.29225385189056396, 0.1804284006357193, -0.165046826004982, 0.03734845295548439, -0.008327510207891464, 0.21995852887630463, -0.19099698960781097, -0.10635039955377579, 0.08154016733169556, -0.36832407116889954, 0.5237658023834229, 0.22890357673168182, -0.017118431627750397, 0.05429517477750778, 0.10540474951267242, -0.22765959799289703, -0.3076716363430023, 0.28638675808906555, -0.1566094160079956, -0.007442089729011059, 0.13802756369113922, 0.062122322618961334, 0.012379884719848633, 0.25426024198532104, -0.1505430042743683, -0.20728950202465057, -0.2037099301815033, 0.16265088319778442, -0.10137004405260086, 0.1700955331325531, 0.3873383104801178, 0.024755358695983887, 0.2557815909385681, -0.19022274017333984, 0.024442583322525024, -0.17892122268676758, -0.49436888098716736, -0.16883385181427002, 0.3723070025444031, 0.008580997586250305, -0.09290443360805511, 0.045592911541461945, -0.29972293972969055, -0.09407852590084076, 0.3640092611312866, 0.10164648294448853, -0.06267382204532623, -0.010548621416091919, -0.46043023467063904, 0.08122338354587555, -0.19129881262779236, -0.34107106924057007, -0.32865041494369507, 0.4735720157623291, -0.1620633602142334, 0.33762502670288086, 0.01470162719488144, -0.009244699962437153, -0.2239348292350769, -0.35918083786964417, 0.4350607395172119, 0.17353065311908722, -0.0058902557939291, -0.13615484535694122, -0.48548388481140137, -0.4237338900566101, 0.3071894645690918, 0.33309096097946167, 0.16834299266338348, -0.19748345017433167, 0.1543683260679245, 0.5204558372497559, 0.1619521975517273, 0.09422635287046432, 0.0824144259095192, 0.19880864024162292, -0.245722696185112, -0.2646991014480591, -0.07643380761146545, 0.04763974994421005, -0.1596105694770813, 0.2700636386871338, -0.28090742230415344, 0.15925690531730652, -0.06307756900787354, 0.1164504885673523, -0.2511117458343506, 0.18181106448173523, -0.09474271535873413, -0.2472255825996399, 0.1807108074426651, 0.068353071808815, -0.23802818357944489, -0.08220233023166656, 0.16630326211452484, 0.41525545716285706, 0.06355112791061401, -0.08599527925252914, -0.10765910148620605, 0.014787474647164345, -0.3218420445919037, -0.10912773013114929, 0.10928100347518921, 0.21685755252838135, 0.22975510358810425, 0.013429281301796436, -0.17475131154060364, 0.28259509801864624, 0.15150736272335052, -0.21642975509166718, -0.02172110229730606, -0.12831290066242218, 0.3187291622161865, -0.3926483690738678, 0.28817808628082275, 0.4494491517543793, 0.06076633185148239, -0.023594167083501816, 0.28204065561294556, 0.20420968532562256, -0.20786608755588531, -0.05499560385942459, -0.011961229145526886, -0.0222882479429245, 0.15183529257774353, -0.1312483847141266, -0.20130003988742828, -0.01967892050743103, 0.5470788478851318, 0.2590557336807251, -0.07472953200340271, 0.16692420840263367, -0.10432539880275726, -0.1967262625694275, 0.18989036977291107, 0.01880810409784317, -0.030384831130504608, 0.08124957233667374, -0.22530221939086914, -0.16734877228736877, 0.30194711685180664, -0.4550797641277313, 0.5055994987487793, 0.006160619203001261, -0.18173639476299286, 0.20135441422462463, -0.2803895175457001, -0.13446475565433502, 0.23612672090530396, 0.027283646166324615, 0.1782967746257782, 0.29030248522758484, 0.08071767538785934, 0.13685756921768188, -0.40517011284828186, -0.23393835127353668, -0.057251378893852234, 0.06609947979450226, -0.24410852789878845, -0.23566119372844696, -0.09920857101678848, -0.001776285469532013, 0.1236765906214714, -0.40121564269065857, -0.19181270897388458, 0.03832131624221802, -0.014187291264533997, 0.09390968084335327, 0.1081240326166153, 0.007352706976234913, -0.28722625970840454, 0.050189509987831116, 0.22673721611499786, -0.0701567754149437, -0.01220107451081276, 0.11828882992267609, -0.3647078573703766, 0.044692378491163254, 0.1680942177772522, -0.10000324994325638, 0.1386716514825821, 0.038295574486255646, -0.028410546481609344, -0.12430635839700699, -0.33586063981056213, -0.04494093358516693, -0.184409961104393, 0.675073504447937, 0.08657554537057877, 0.044727977365255356, -0.2883932590484619, -0.39848989248275757, 0.20048770308494568, 0.2731606960296631, -0.1155707836151123, 0.1409587264060974, 0.0858575776219368, 0.07656078785657883, -0.17892161011695862, -0.044758595526218414, -0.07274269312620163, -0.3597073554992676, 0.01941404864192009, -0.03579612076282501, -0.11587226390838623, 0.13168883323669434, -0.18240635097026825, 0.17288416624069214, 0.5054889917373657, 0.02528655156493187, -0.2901579737663269, -0.3475990295410156, 0.1905186027288437, -0.06264864653348923, -0.2594660520553589, -0.05778328329324722, -0.0026705749332904816, 0.09334969520568848, 0.2697675824165344, -0.42312484979629517, -0.04174503684043884, -0.014795919880270958, 0.14797621965408325, -0.17382241785526276, -0.3538969159126282, 0.2849053740501404, 0.2340078055858612, -0.03137299045920372, -0.09749604016542435, -0.2075367569923401, -0.07764723151922226, -0.008408699184656143, 0.4140312373638153, 0.002065306529402733, 0.20911955833435059, -0.017816372215747833, 0.04531519487500191, 0.15128271281719208, 0.2853335738182068, 0.7059415578842163, 0.15238270163536072, 0.1911250203847885, 0.12037934362888336, -0.2509270906448364, 0.1740177571773529, -0.20073163509368896, -0.014154101721942425, 0.33949872851371765, -0.06420644372701645, -0.00702819786965847, -0.2144095003604889, -0.08470308780670166, -0.21895474195480347, -0.062671959400177, 0.013783234171569347, -0.1984517127275467, 0.34522363543510437, -0.20986807346343994, -0.08896081149578094, 0.36883628368377686, -0.026597287505865097, 0.21737021207809448, 0.17576996982097626, -0.1267344355583191, -0.1552066057920456, -0.19829697906970978, -0.21983826160430908, -0.4107115566730499, 0.2797967195510864, 0.13473951816558838, 0.6053631901741028, 0.024261970072984695, -0.04728056117892265, -0.009520165622234344, -0.3188266456127167, 0.44892358779907227, -0.11870791763067245, 0.11287638545036316, 0.12380711734294891, -0.012164819985628128, -0.5684407949447632, -0.29695290327072144, -0.06092183664441109, 0.2707672417163849, 0.049191784113645554, 0.4614696800708771, -0.1427006721496582, 0.2389986664056778, 0.315900981426239, 0.13029681146144867, -0.09473742544651031, -0.08245020359754562, -0.4103216230869293, -0.6870731115341187, -0.1309131234884262, 0.038848500698804855, -0.09975145757198334, 0.4027709364891052, -0.15969029068946838, -0.09481701999902725, -0.08056039363145828, 0.19697529077529907, -0.06398084759712219, -0.06338833272457123, 0.0739927664399147, 0.0868270993232727, 0.2531450092792511, -0.09419143199920654, 0.2027396261692047, -0.05720166862010956, 0.31642061471939087, 0.13974978029727936, -0.25895535945892334, 0.04596645012497902, 0.08078401535749435, 0.08692130446434021, 0.2498498111963272, -0.22185015678405762, -0.20216262340545654, 0.042904794216156006, 0.0741298571228981, -0.0531868077814579, 0.25452932715415955, 0.8272789120674133, -0.27019721269607544, -0.3177138864994049, -0.05536390841007233, 0.3019482493400574, -0.035790666937828064, -0.031045030802488327, -0.1361473947763443, -0.4344770908355713, -0.19778074324131012, 0.4961393475532532, 0.22306165099143982, 0.9382805824279785, 0.06029851734638214, 0.07747390866279602, 0.36871129274368286, 0.06222014129161835, 0.261342853307724, -0.436367392539978, 0.11314044892787933, -0.03354635834693909, -0.4514071047306061, 0.13319513201713562, 0.11602902412414551, 0.1124788299202919, -0.12724338471889496, -0.3201117217540741, -0.004287440329790115, 0.17103101313114166, -0.1982191652059555, 0.20202995836734772, -0.11692741513252258, -0.03284744173288345, -0.1594519019126892, -0.30887824296951294, 0.10638882219791412, 0.018059711903333664, 0.2763407528400421, -0.32945775985717773, 0.07050231099128723, 0.08831067383289337, -0.2714240550994873, -0.33382681012153625, 0.3557634949684143, -0.2556294798851013, 0.2920178771018982, -0.6306742429733276, 0.15711453557014465, -0.11657126247882843, 0.21915215253829956, 0.3410787582397461, 0.3689152002334595, -0.16857074201107025, 0.15864132344722748, 0.29903677105903625, -0.11008032411336899, 0.23795278370380402, -0.17699816823005676, -0.06213122606277466, -0.29552531242370605, -0.18054336309432983, -0.006072007119655609, -0.29743215441703796, 0.08405224978923798, -0.018683001399040222, 0.0911019891500473, -0.01000211387872696, 0.005315215792506933, -0.06519843637943268, -0.004380226135253906, 0.3272298276424408, -0.21076896786689758, 0.13338255882263184, 0.007430829107761383, -0.1289440095424652, 0.2952834963798523, -0.3113306760787964, -0.39142927527427673, -0.05662054196000099, 0.41349461674690247, -0.019437439739704132, 0.2364853322505951, 0.3887900710105896, 0.008746769279241562, 0.12820586562156677, -0.06725127249956131, -0.05177865922451019, -0.3094165623188019, -0.17839114367961884, 0.06226048246026039, 0.40574753284454346, -0.021263964474201202, -0.04132126271724701, 0.6821672916412354, 0.5023379921913147, -0.05805019289255142, 0.2842259705066681, -0.5085428357124329, -0.053661465644836426, 0.41216886043548584, 0.039025746285915375, 0.235213503241539, 0.11354953795671463, 0.15442945063114166, 0.1110527366399765, -0.01907435990869999, -0.24681416153907776, 0.021809792146086693, -0.153691366314888, 0.10439179092645645, -0.08066314458847046, 0.07095588743686676, 0.3835847079753876, 0.3150915205478668, 0.18962092697620392, 0.1593913435935974, 0.012683290056884289, -0.13242052495479584, -0.20616857707500458, 0.15075919032096863, 0.12781068682670593, -0.25666311383247375, 0.1267160028219223, -0.2540701627731323, 0.0822921171784401, -0.033575452864170074, -0.02667447179555893, 0.13791200518608093, 0.0697200745344162, -0.10875383764505386, 0.08206716924905777, 0.12426124513149261, -0.04286176711320877, 0.3303702175617218, -0.03857188671827316, 0.3692846894264221, 0.23078685998916626, 0.219427227973938, 0.01910974271595478, -0.11759467422962189, 0.6458368301391602, -0.23686110973358154, -0.04535818099975586, 0.12787358462810516, 0.03256795555353165, -0.17061109840869904, -0.05049710348248482, -0.0771624818444252, 0.18255779147148132, 0.5723705887794495, -0.20992954075336456, -0.14079710841178894, 0.15141195058822632, 0.194304421544075, -0.3506428599357605, 0.0013894770527258515, 0.025028983131051064, -0.45401936769485474, -0.2719036042690277, 0.06966239213943481, 0.12043818831443787, -0.022400878369808197, 0.07968534529209137, -0.12065999954938889, 0.2021828293800354, 0.07756482064723969, -0.10862641036510468, 0.3175910413265228, -0.1361135095357895, 0.20454400777816772, 0.04626336693763733, -0.3149254322052002, 0.37645089626312256, 0.2715967893600464, 0.14238962531089783, -0.1644340604543686, 0.11133373528718948, 0.570709764957428, -0.161426842212677, -0.40532830357551575, -0.050516340881586075, 0.460482656955719, 0.052108071744441986, -0.0041686370968818665, -0.012508861720561981, 0.46504542231559753, -0.15834172070026398, -0.09814237803220749, -0.400020956993103, 0.40834593772888184, -0.11230169981718063, -0.2506638467311859, 0.20403268933296204, -0.0223197303712368, -0.32103824615478516, 0.19936393201351166, -0.00882018730044365, 0.2969422936439514, -0.1414569467306137, 0.30034640431404114, -0.34923744201660156, -0.2137998640537262, -0.24988865852355957, 0.3892728388309479, -0.24792155623435974, -0.3205779790878296, 0.3538101315498352, 0.27754461765289307, -0.14086118340492249, -0.12944549322128296, 0.27486395835876465, 0.2537926137447357, 0.28803426027297974, -0.4131760597229004, -0.15939603745937347, 0.25405043363571167, 0.2008870393037796, -0.23630540072917938, 0.1896883249282837, 0.5250464677810669, 0.46516165137290955, 0.25976452231407166, 0.1164189875125885, -0.2230025678873062, 0.3714628517627716, -0.11950945854187012, -0.2746327817440033, -0.03436828404664993, 0.11163027584552765, 0.0272496547549963, 0.006951227784156799, -0.05608365684747696, -0.07173549383878708, -0.41343042254447937, 0.15677982568740845, -0.02207026258111, -0.05299657583236694, 0.042912665754556656, 0.004690198693424463, 0.07002294808626175, 0.03816083073616028, 0.3015451729297638, 0.41265085339546204, 0.29615840315818787, -0.27783313393592834, -0.6142833232879639, -0.609196662902832, 0.21157948672771454, -0.03502114489674568, 0.13998739421367645, 0.06432487070560455, -0.1356162130832672, -0.019466541707515717, 0.09293445944786072, -0.15853892266750336, -0.3117798864841461, 0.24147766828536987, 0.07942589372396469, -0.2589091360569, 0.24800267815589905, 0.4954819083213806, 0.058294542133808136, -0.13152071833610535, -0.4492769241333008, 0.15586937963962555, 0.024809330701828003, 0.07500588893890381, -0.15926514565944672, -0.3705042898654938, 0.009272489696741104, -0.46183785796165466, 0.8872697353363037, 0.09777717292308807, 0.16251987218856812, -0.1749747097492218, -0.22559593617916107, -0.2874727249145508, -0.11634852737188339, 0.013107637874782085, 0.012100376188755035, 0.19317810237407684, 0.2746496796607971, -0.03941042721271515, 0.4162321388721466, -0.30120113492012024, 0.21877819299697876, 0.022692278027534485, -0.10465989261865616, -0.28682202100753784, -0.04481813311576843, -0.15804550051689148, -0.10041826963424683, -0.3055849075317383, 0.31130552291870117, -0.004229240119457245, 0.23836414515972137, -0.32406821846961975, -0.38642624020576477, 0.3152194619178772, -0.246345654129982, -0.0803663432598114, 0.21592918038368225, 0.301235556602478, -0.34466224908828735, -0.11868561059236526, 0.27865153551101685, 0.07851838320493698, 0.28991949558258057, 0.3873494863510132, -0.3197360932826996, 0.22576572000980377, -0.0417034737765789, -0.18798695504665375, -0.0010480470955371857, 0.23499229550361633, 0.04246830567717552, -0.2748907506465912, 0.275691956281662, -0.13954386115074158 ]
https://github.com/huggingface/datasets/issues/6475
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed
I don't really comprehend what it is that `datasets` gave me when it downloaded the laion2B-en dataset, because nothing can seemingly read these 1024 .arrow files it is retrieving. Not `polars`, not `pyarrow`, it's not an `ipc` file, it's not a `parquet` file...
### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0
43
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed ### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0 I don't really comprehend what it is that `datasets` gave me when it downloaded the laion2B-en dataset, because nothing can seemingly read these 1024 .arrow files it is retrieving. Not `polars`, not `pyarrow`, it's not an `ipc` file, it's not a `parquet` file...
[ -0.10396318137645721, -0.1658564954996109, -0.06416884064674377, 0.3617137670516968, 0.045910730957984924, -0.1833963394165039, -0.012238878756761551, 0.26278215646743774, -0.2864784300327301, -0.08144982159137726, -0.02400197833776474, 0.0840771496295929, -0.14902691543102264, 0.1495058536529541, -0.03063856065273285, -0.03984741121530533, 0.0771910548210144, 0.12992259860038757, 0.2934598922729492, 0.16215330362319946, -0.4650859832763672, 0.35488027334213257, -0.2558758854866028, 0.10274055600166321, -0.06378618627786636, 0.1223767027258873, -0.3196195960044861, 0.5092806220054626, -0.28727012872695923, -0.3582841157913208, 0.4790029525756836, -0.30870354175567627, 0.36739757657051086, 0.1376122534275055, -0.00011523867578944191, 0.05485638976097107, 0.46044373512268066, -0.053147390484809875, 0.1673220545053482, 0.0958859995007515, 0.09431613236665726, -0.3622174561023712, -0.1488802433013916, -0.3601912558078766, 0.04446486383676529, -0.19450753927230835, -0.11527718603610992, -0.4744306206703186, 0.3433225452899933, 0.34332796931266785, 0.17225056886672974, 0.23018306493759155, 0.3630772829055786, 0.22018302977085114, 0.6044424772262573, -0.4517322778701782, -0.11601124703884125, 0.1880270540714264, 0.09052082151174545, -0.19645997881889343, 0.12938793003559113, 0.09616880118846893, -0.16839519143104553, -0.07067321240901947, -0.15562501549720764, -0.09010029584169388, 0.14442545175552368, -0.3717038035392761, -0.04261757433414459, 0.067752905189991, -0.03524560481309891, -0.05534256994724274, -0.16399887204170227, 0.26411646604537964, 0.030805695801973343, -0.5285080671310425, 0.2086520791053772, 0.35857439041137695, -0.0847676694393158, -0.05767494812607765, -0.04259467497467995, 0.09457999467849731, -0.0017680823802947998, 0.10504259169101715, -0.12069675326347351, 0.19219088554382324, -0.0820118635892868, 0.18123333156108856, 0.04026917368173599, 0.003902548924088478, 0.21010437607765198, 0.22022745013237, -0.32798096537590027, 0.10570291429758072, -0.4765613079071045, 0.04070339351892471, -0.08174420148134232, 0.28546828031539917, -0.044916849583387375, -0.050283730030059814, -0.08062916994094849, -0.0865580216050148, -0.14981800317764282, -0.11620870977640152, -0.05401568487286568, 0.4200056791305542, 0.0047071874141693115, -0.38476327061653137, 0.24009813368320465, 0.18792808055877686, 0.16747629642486572, 0.054135218262672424, -0.39239582419395447, -0.4642088711261749, -0.048038382083177567, -0.04021858051419258, 0.32786017656326294, -0.37214094400405884, -0.5733500719070435, 0.14143170416355133, -0.5692523121833801, 0.20278558135032654, 0.06204264983534813, 0.2793368101119995, -0.34032508730888367, -0.13716629147529602, 0.29225385189056396, 0.1804284006357193, -0.165046826004982, 0.03734845295548439, -0.008327510207891464, 0.21995852887630463, -0.19099698960781097, -0.10635039955377579, 0.08154016733169556, -0.36832407116889954, 0.5237658023834229, 0.22890357673168182, -0.017118431627750397, 0.05429517477750778, 0.10540474951267242, -0.22765959799289703, -0.3076716363430023, 0.28638675808906555, -0.1566094160079956, -0.007442089729011059, 0.13802756369113922, 0.062122322618961334, 0.012379884719848633, 0.25426024198532104, -0.1505430042743683, -0.20728950202465057, -0.2037099301815033, 0.16265088319778442, -0.10137004405260086, 0.1700955331325531, 0.3873383104801178, 0.024755358695983887, 0.2557815909385681, -0.19022274017333984, 0.024442583322525024, -0.17892122268676758, -0.49436888098716736, -0.16883385181427002, 0.3723070025444031, 0.008580997586250305, -0.09290443360805511, 0.045592911541461945, -0.29972293972969055, -0.09407852590084076, 0.3640092611312866, 0.10164648294448853, -0.06267382204532623, -0.010548621416091919, -0.46043023467063904, 0.08122338354587555, -0.19129881262779236, -0.34107106924057007, -0.32865041494369507, 0.4735720157623291, -0.1620633602142334, 0.33762502670288086, 0.01470162719488144, -0.009244699962437153, -0.2239348292350769, -0.35918083786964417, 0.4350607395172119, 0.17353065311908722, -0.0058902557939291, -0.13615484535694122, -0.48548388481140137, -0.4237338900566101, 0.3071894645690918, 0.33309096097946167, 0.16834299266338348, -0.19748345017433167, 0.1543683260679245, 0.5204558372497559, 0.1619521975517273, 0.09422635287046432, 0.0824144259095192, 0.19880864024162292, -0.245722696185112, -0.2646991014480591, -0.07643380761146545, 0.04763974994421005, -0.1596105694770813, 0.2700636386871338, -0.28090742230415344, 0.15925690531730652, -0.06307756900787354, 0.1164504885673523, -0.2511117458343506, 0.18181106448173523, -0.09474271535873413, -0.2472255825996399, 0.1807108074426651, 0.068353071808815, -0.23802818357944489, -0.08220233023166656, 0.16630326211452484, 0.41525545716285706, 0.06355112791061401, -0.08599527925252914, -0.10765910148620605, 0.014787474647164345, -0.3218420445919037, -0.10912773013114929, 0.10928100347518921, 0.21685755252838135, 0.22975510358810425, 0.013429281301796436, -0.17475131154060364, 0.28259509801864624, 0.15150736272335052, -0.21642975509166718, -0.02172110229730606, -0.12831290066242218, 0.3187291622161865, -0.3926483690738678, 0.28817808628082275, 0.4494491517543793, 0.06076633185148239, -0.023594167083501816, 0.28204065561294556, 0.20420968532562256, -0.20786608755588531, -0.05499560385942459, -0.011961229145526886, -0.0222882479429245, 0.15183529257774353, -0.1312483847141266, -0.20130003988742828, -0.01967892050743103, 0.5470788478851318, 0.2590557336807251, -0.07472953200340271, 0.16692420840263367, -0.10432539880275726, -0.1967262625694275, 0.18989036977291107, 0.01880810409784317, -0.030384831130504608, 0.08124957233667374, -0.22530221939086914, -0.16734877228736877, 0.30194711685180664, -0.4550797641277313, 0.5055994987487793, 0.006160619203001261, -0.18173639476299286, 0.20135441422462463, -0.2803895175457001, -0.13446475565433502, 0.23612672090530396, 0.027283646166324615, 0.1782967746257782, 0.29030248522758484, 0.08071767538785934, 0.13685756921768188, -0.40517011284828186, -0.23393835127353668, -0.057251378893852234, 0.06609947979450226, -0.24410852789878845, -0.23566119372844696, -0.09920857101678848, -0.001776285469532013, 0.1236765906214714, -0.40121564269065857, -0.19181270897388458, 0.03832131624221802, -0.014187291264533997, 0.09390968084335327, 0.1081240326166153, 0.007352706976234913, -0.28722625970840454, 0.050189509987831116, 0.22673721611499786, -0.0701567754149437, -0.01220107451081276, 0.11828882992267609, -0.3647078573703766, 0.044692378491163254, 0.1680942177772522, -0.10000324994325638, 0.1386716514825821, 0.038295574486255646, -0.028410546481609344, -0.12430635839700699, -0.33586063981056213, -0.04494093358516693, -0.184409961104393, 0.675073504447937, 0.08657554537057877, 0.044727977365255356, -0.2883932590484619, -0.39848989248275757, 0.20048770308494568, 0.2731606960296631, -0.1155707836151123, 0.1409587264060974, 0.0858575776219368, 0.07656078785657883, -0.17892161011695862, -0.044758595526218414, -0.07274269312620163, -0.3597073554992676, 0.01941404864192009, -0.03579612076282501, -0.11587226390838623, 0.13168883323669434, -0.18240635097026825, 0.17288416624069214, 0.5054889917373657, 0.02528655156493187, -0.2901579737663269, -0.3475990295410156, 0.1905186027288437, -0.06264864653348923, -0.2594660520553589, -0.05778328329324722, -0.0026705749332904816, 0.09334969520568848, 0.2697675824165344, -0.42312484979629517, -0.04174503684043884, -0.014795919880270958, 0.14797621965408325, -0.17382241785526276, -0.3538969159126282, 0.2849053740501404, 0.2340078055858612, -0.03137299045920372, -0.09749604016542435, -0.2075367569923401, -0.07764723151922226, -0.008408699184656143, 0.4140312373638153, 0.002065306529402733, 0.20911955833435059, -0.017816372215747833, 0.04531519487500191, 0.15128271281719208, 0.2853335738182068, 0.7059415578842163, 0.15238270163536072, 0.1911250203847885, 0.12037934362888336, -0.2509270906448364, 0.1740177571773529, -0.20073163509368896, -0.014154101721942425, 0.33949872851371765, -0.06420644372701645, -0.00702819786965847, -0.2144095003604889, -0.08470308780670166, -0.21895474195480347, -0.062671959400177, 0.013783234171569347, -0.1984517127275467, 0.34522363543510437, -0.20986807346343994, -0.08896081149578094, 0.36883628368377686, -0.026597287505865097, 0.21737021207809448, 0.17576996982097626, -0.1267344355583191, -0.1552066057920456, -0.19829697906970978, -0.21983826160430908, -0.4107115566730499, 0.2797967195510864, 0.13473951816558838, 0.6053631901741028, 0.024261970072984695, -0.04728056117892265, -0.009520165622234344, -0.3188266456127167, 0.44892358779907227, -0.11870791763067245, 0.11287638545036316, 0.12380711734294891, -0.012164819985628128, -0.5684407949447632, -0.29695290327072144, -0.06092183664441109, 0.2707672417163849, 0.049191784113645554, 0.4614696800708771, -0.1427006721496582, 0.2389986664056778, 0.315900981426239, 0.13029681146144867, -0.09473742544651031, -0.08245020359754562, -0.4103216230869293, -0.6870731115341187, -0.1309131234884262, 0.038848500698804855, -0.09975145757198334, 0.4027709364891052, -0.15969029068946838, -0.09481701999902725, -0.08056039363145828, 0.19697529077529907, -0.06398084759712219, -0.06338833272457123, 0.0739927664399147, 0.0868270993232727, 0.2531450092792511, -0.09419143199920654, 0.2027396261692047, -0.05720166862010956, 0.31642061471939087, 0.13974978029727936, -0.25895535945892334, 0.04596645012497902, 0.08078401535749435, 0.08692130446434021, 0.2498498111963272, -0.22185015678405762, -0.20216262340545654, 0.042904794216156006, 0.0741298571228981, -0.0531868077814579, 0.25452932715415955, 0.8272789120674133, -0.27019721269607544, -0.3177138864994049, -0.05536390841007233, 0.3019482493400574, -0.035790666937828064, -0.031045030802488327, -0.1361473947763443, -0.4344770908355713, -0.19778074324131012, 0.4961393475532532, 0.22306165099143982, 0.9382805824279785, 0.06029851734638214, 0.07747390866279602, 0.36871129274368286, 0.06222014129161835, 0.261342853307724, -0.436367392539978, 0.11314044892787933, -0.03354635834693909, -0.4514071047306061, 0.13319513201713562, 0.11602902412414551, 0.1124788299202919, -0.12724338471889496, -0.3201117217540741, -0.004287440329790115, 0.17103101313114166, -0.1982191652059555, 0.20202995836734772, -0.11692741513252258, -0.03284744173288345, -0.1594519019126892, -0.30887824296951294, 0.10638882219791412, 0.018059711903333664, 0.2763407528400421, -0.32945775985717773, 0.07050231099128723, 0.08831067383289337, -0.2714240550994873, -0.33382681012153625, 0.3557634949684143, -0.2556294798851013, 0.2920178771018982, -0.6306742429733276, 0.15711453557014465, -0.11657126247882843, 0.21915215253829956, 0.3410787582397461, 0.3689152002334595, -0.16857074201107025, 0.15864132344722748, 0.29903677105903625, -0.11008032411336899, 0.23795278370380402, -0.17699816823005676, -0.06213122606277466, -0.29552531242370605, -0.18054336309432983, -0.006072007119655609, -0.29743215441703796, 0.08405224978923798, -0.018683001399040222, 0.0911019891500473, -0.01000211387872696, 0.005315215792506933, -0.06519843637943268, -0.004380226135253906, 0.3272298276424408, -0.21076896786689758, 0.13338255882263184, 0.007430829107761383, -0.1289440095424652, 0.2952834963798523, -0.3113306760787964, -0.39142927527427673, -0.05662054196000099, 0.41349461674690247, -0.019437439739704132, 0.2364853322505951, 0.3887900710105896, 0.008746769279241562, 0.12820586562156677, -0.06725127249956131, -0.05177865922451019, -0.3094165623188019, -0.17839114367961884, 0.06226048246026039, 0.40574753284454346, -0.021263964474201202, -0.04132126271724701, 0.6821672916412354, 0.5023379921913147, -0.05805019289255142, 0.2842259705066681, -0.5085428357124329, -0.053661465644836426, 0.41216886043548584, 0.039025746285915375, 0.235213503241539, 0.11354953795671463, 0.15442945063114166, 0.1110527366399765, -0.01907435990869999, -0.24681416153907776, 0.021809792146086693, -0.153691366314888, 0.10439179092645645, -0.08066314458847046, 0.07095588743686676, 0.3835847079753876, 0.3150915205478668, 0.18962092697620392, 0.1593913435935974, 0.012683290056884289, -0.13242052495479584, -0.20616857707500458, 0.15075919032096863, 0.12781068682670593, -0.25666311383247375, 0.1267160028219223, -0.2540701627731323, 0.0822921171784401, -0.033575452864170074, -0.02667447179555893, 0.13791200518608093, 0.0697200745344162, -0.10875383764505386, 0.08206716924905777, 0.12426124513149261, -0.04286176711320877, 0.3303702175617218, -0.03857188671827316, 0.3692846894264221, 0.23078685998916626, 0.219427227973938, 0.01910974271595478, -0.11759467422962189, 0.6458368301391602, -0.23686110973358154, -0.04535818099975586, 0.12787358462810516, 0.03256795555353165, -0.17061109840869904, -0.05049710348248482, -0.0771624818444252, 0.18255779147148132, 0.5723705887794495, -0.20992954075336456, -0.14079710841178894, 0.15141195058822632, 0.194304421544075, -0.3506428599357605, 0.0013894770527258515, 0.025028983131051064, -0.45401936769485474, -0.2719036042690277, 0.06966239213943481, 0.12043818831443787, -0.022400878369808197, 0.07968534529209137, -0.12065999954938889, 0.2021828293800354, 0.07756482064723969, -0.10862641036510468, 0.3175910413265228, -0.1361135095357895, 0.20454400777816772, 0.04626336693763733, -0.3149254322052002, 0.37645089626312256, 0.2715967893600464, 0.14238962531089783, -0.1644340604543686, 0.11133373528718948, 0.570709764957428, -0.161426842212677, -0.40532830357551575, -0.050516340881586075, 0.460482656955719, 0.052108071744441986, -0.0041686370968818665, -0.012508861720561981, 0.46504542231559753, -0.15834172070026398, -0.09814237803220749, -0.400020956993103, 0.40834593772888184, -0.11230169981718063, -0.2506638467311859, 0.20403268933296204, -0.0223197303712368, -0.32103824615478516, 0.19936393201351166, -0.00882018730044365, 0.2969422936439514, -0.1414569467306137, 0.30034640431404114, -0.34923744201660156, -0.2137998640537262, -0.24988865852355957, 0.3892728388309479, -0.24792155623435974, -0.3205779790878296, 0.3538101315498352, 0.27754461765289307, -0.14086118340492249, -0.12944549322128296, 0.27486395835876465, 0.2537926137447357, 0.28803426027297974, -0.4131760597229004, -0.15939603745937347, 0.25405043363571167, 0.2008870393037796, -0.23630540072917938, 0.1896883249282837, 0.5250464677810669, 0.46516165137290955, 0.25976452231407166, 0.1164189875125885, -0.2230025678873062, 0.3714628517627716, -0.11950945854187012, -0.2746327817440033, -0.03436828404664993, 0.11163027584552765, 0.0272496547549963, 0.006951227784156799, -0.05608365684747696, -0.07173549383878708, -0.41343042254447937, 0.15677982568740845, -0.02207026258111, -0.05299657583236694, 0.042912665754556656, 0.004690198693424463, 0.07002294808626175, 0.03816083073616028, 0.3015451729297638, 0.41265085339546204, 0.29615840315818787, -0.27783313393592834, -0.6142833232879639, -0.609196662902832, 0.21157948672771454, -0.03502114489674568, 0.13998739421367645, 0.06432487070560455, -0.1356162130832672, -0.019466541707515717, 0.09293445944786072, -0.15853892266750336, -0.3117798864841461, 0.24147766828536987, 0.07942589372396469, -0.2589091360569, 0.24800267815589905, 0.4954819083213806, 0.058294542133808136, -0.13152071833610535, -0.4492769241333008, 0.15586937963962555, 0.024809330701828003, 0.07500588893890381, -0.15926514565944672, -0.3705042898654938, 0.009272489696741104, -0.46183785796165466, 0.8872697353363037, 0.09777717292308807, 0.16251987218856812, -0.1749747097492218, -0.22559593617916107, -0.2874727249145508, -0.11634852737188339, 0.013107637874782085, 0.012100376188755035, 0.19317810237407684, 0.2746496796607971, -0.03941042721271515, 0.4162321388721466, -0.30120113492012024, 0.21877819299697876, 0.022692278027534485, -0.10465989261865616, -0.28682202100753784, -0.04481813311576843, -0.15804550051689148, -0.10041826963424683, -0.3055849075317383, 0.31130552291870117, -0.004229240119457245, 0.23836414515972137, -0.32406821846961975, -0.38642624020576477, 0.3152194619178772, -0.246345654129982, -0.0803663432598114, 0.21592918038368225, 0.301235556602478, -0.34466224908828735, -0.11868561059236526, 0.27865153551101685, 0.07851838320493698, 0.28991949558258057, 0.3873494863510132, -0.3197360932826996, 0.22576572000980377, -0.0417034737765789, -0.18798695504665375, -0.0010480470955371857, 0.23499229550361633, 0.04246830567717552, -0.2748907506465912, 0.275691956281662, -0.13954386115074158 ]
https://github.com/huggingface/datasets/issues/6475
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed
Hi! Instead of generating one (potentially large) Arrow file, we shard the generated data into 500 MB shards because memory-mapping large Arrow files can be problematic on some systems. Maybe deleting the dataset's cache and increasing the shard size (controlled with the `datasets.config.MAX_SHARD_SIZE` variable; e.g. to "4GB") can fix the issue for you. > I don't really comprehend what it is that `datasets` gave me when it downloaded the laion2B-en dataset, because nothing can seemingly read these 1024 .arrow files it is retrieving. Not `polars`, not `pyarrow`, it's not an `ipc` file, it's not a `parquet` file... Our `.arrow` files are in the [Arrow streaming format](https://arrow.apache.org/docs/python/ipc.html#using-streams). To load them as a `polars` DataFrame, do the following: ```python df = pl.from_arrow(Dataset.from_from(path_to_arrow_file).data.table) ``` We plan to switch to the IPC version eventually.
### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0
130
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed ### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0 Hi! Instead of generating one (potentially large) Arrow file, we shard the generated data into 500 MB shards because memory-mapping large Arrow files can be problematic on some systems. Maybe deleting the dataset's cache and increasing the shard size (controlled with the `datasets.config.MAX_SHARD_SIZE` variable; e.g. to "4GB") can fix the issue for you. > I don't really comprehend what it is that `datasets` gave me when it downloaded the laion2B-en dataset, because nothing can seemingly read these 1024 .arrow files it is retrieving. Not `polars`, not `pyarrow`, it's not an `ipc` file, it's not a `parquet` file... Our `.arrow` files are in the [Arrow streaming format](https://arrow.apache.org/docs/python/ipc.html#using-streams). To load them as a `polars` DataFrame, do the following: ```python df = pl.from_arrow(Dataset.from_from(path_to_arrow_file).data.table) ``` We plan to switch to the IPC version eventually.
[ -0.10396318137645721, -0.1658564954996109, -0.06416884064674377, 0.3617137670516968, 0.045910730957984924, -0.1833963394165039, -0.012238878756761551, 0.26278215646743774, -0.2864784300327301, -0.08144982159137726, -0.02400197833776474, 0.0840771496295929, -0.14902691543102264, 0.1495058536529541, -0.03063856065273285, -0.03984741121530533, 0.0771910548210144, 0.12992259860038757, 0.2934598922729492, 0.16215330362319946, -0.4650859832763672, 0.35488027334213257, -0.2558758854866028, 0.10274055600166321, -0.06378618627786636, 0.1223767027258873, -0.3196195960044861, 0.5092806220054626, -0.28727012872695923, -0.3582841157913208, 0.4790029525756836, -0.30870354175567627, 0.36739757657051086, 0.1376122534275055, -0.00011523867578944191, 0.05485638976097107, 0.46044373512268066, -0.053147390484809875, 0.1673220545053482, 0.0958859995007515, 0.09431613236665726, -0.3622174561023712, -0.1488802433013916, -0.3601912558078766, 0.04446486383676529, -0.19450753927230835, -0.11527718603610992, -0.4744306206703186, 0.3433225452899933, 0.34332796931266785, 0.17225056886672974, 0.23018306493759155, 0.3630772829055786, 0.22018302977085114, 0.6044424772262573, -0.4517322778701782, -0.11601124703884125, 0.1880270540714264, 0.09052082151174545, -0.19645997881889343, 0.12938793003559113, 0.09616880118846893, -0.16839519143104553, -0.07067321240901947, -0.15562501549720764, -0.09010029584169388, 0.14442545175552368, -0.3717038035392761, -0.04261757433414459, 0.067752905189991, -0.03524560481309891, -0.05534256994724274, -0.16399887204170227, 0.26411646604537964, 0.030805695801973343, -0.5285080671310425, 0.2086520791053772, 0.35857439041137695, -0.0847676694393158, -0.05767494812607765, -0.04259467497467995, 0.09457999467849731, -0.0017680823802947998, 0.10504259169101715, -0.12069675326347351, 0.19219088554382324, -0.0820118635892868, 0.18123333156108856, 0.04026917368173599, 0.003902548924088478, 0.21010437607765198, 0.22022745013237, -0.32798096537590027, 0.10570291429758072, -0.4765613079071045, 0.04070339351892471, -0.08174420148134232, 0.28546828031539917, -0.044916849583387375, -0.050283730030059814, -0.08062916994094849, -0.0865580216050148, -0.14981800317764282, -0.11620870977640152, -0.05401568487286568, 0.4200056791305542, 0.0047071874141693115, -0.38476327061653137, 0.24009813368320465, 0.18792808055877686, 0.16747629642486572, 0.054135218262672424, -0.39239582419395447, -0.4642088711261749, -0.048038382083177567, -0.04021858051419258, 0.32786017656326294, -0.37214094400405884, -0.5733500719070435, 0.14143170416355133, -0.5692523121833801, 0.20278558135032654, 0.06204264983534813, 0.2793368101119995, -0.34032508730888367, -0.13716629147529602, 0.29225385189056396, 0.1804284006357193, -0.165046826004982, 0.03734845295548439, -0.008327510207891464, 0.21995852887630463, -0.19099698960781097, -0.10635039955377579, 0.08154016733169556, -0.36832407116889954, 0.5237658023834229, 0.22890357673168182, -0.017118431627750397, 0.05429517477750778, 0.10540474951267242, -0.22765959799289703, -0.3076716363430023, 0.28638675808906555, -0.1566094160079956, -0.007442089729011059, 0.13802756369113922, 0.062122322618961334, 0.012379884719848633, 0.25426024198532104, -0.1505430042743683, -0.20728950202465057, -0.2037099301815033, 0.16265088319778442, -0.10137004405260086, 0.1700955331325531, 0.3873383104801178, 0.024755358695983887, 0.2557815909385681, -0.19022274017333984, 0.024442583322525024, -0.17892122268676758, -0.49436888098716736, -0.16883385181427002, 0.3723070025444031, 0.008580997586250305, -0.09290443360805511, 0.045592911541461945, -0.29972293972969055, -0.09407852590084076, 0.3640092611312866, 0.10164648294448853, -0.06267382204532623, -0.010548621416091919, -0.46043023467063904, 0.08122338354587555, -0.19129881262779236, -0.34107106924057007, -0.32865041494369507, 0.4735720157623291, -0.1620633602142334, 0.33762502670288086, 0.01470162719488144, -0.009244699962437153, -0.2239348292350769, -0.35918083786964417, 0.4350607395172119, 0.17353065311908722, -0.0058902557939291, -0.13615484535694122, -0.48548388481140137, -0.4237338900566101, 0.3071894645690918, 0.33309096097946167, 0.16834299266338348, -0.19748345017433167, 0.1543683260679245, 0.5204558372497559, 0.1619521975517273, 0.09422635287046432, 0.0824144259095192, 0.19880864024162292, -0.245722696185112, -0.2646991014480591, -0.07643380761146545, 0.04763974994421005, -0.1596105694770813, 0.2700636386871338, -0.28090742230415344, 0.15925690531730652, -0.06307756900787354, 0.1164504885673523, -0.2511117458343506, 0.18181106448173523, -0.09474271535873413, -0.2472255825996399, 0.1807108074426651, 0.068353071808815, -0.23802818357944489, -0.08220233023166656, 0.16630326211452484, 0.41525545716285706, 0.06355112791061401, -0.08599527925252914, -0.10765910148620605, 0.014787474647164345, -0.3218420445919037, -0.10912773013114929, 0.10928100347518921, 0.21685755252838135, 0.22975510358810425, 0.013429281301796436, -0.17475131154060364, 0.28259509801864624, 0.15150736272335052, -0.21642975509166718, -0.02172110229730606, -0.12831290066242218, 0.3187291622161865, -0.3926483690738678, 0.28817808628082275, 0.4494491517543793, 0.06076633185148239, -0.023594167083501816, 0.28204065561294556, 0.20420968532562256, -0.20786608755588531, -0.05499560385942459, -0.011961229145526886, -0.0222882479429245, 0.15183529257774353, -0.1312483847141266, -0.20130003988742828, -0.01967892050743103, 0.5470788478851318, 0.2590557336807251, -0.07472953200340271, 0.16692420840263367, -0.10432539880275726, -0.1967262625694275, 0.18989036977291107, 0.01880810409784317, -0.030384831130504608, 0.08124957233667374, -0.22530221939086914, -0.16734877228736877, 0.30194711685180664, -0.4550797641277313, 0.5055994987487793, 0.006160619203001261, -0.18173639476299286, 0.20135441422462463, -0.2803895175457001, -0.13446475565433502, 0.23612672090530396, 0.027283646166324615, 0.1782967746257782, 0.29030248522758484, 0.08071767538785934, 0.13685756921768188, -0.40517011284828186, -0.23393835127353668, -0.057251378893852234, 0.06609947979450226, -0.24410852789878845, -0.23566119372844696, -0.09920857101678848, -0.001776285469532013, 0.1236765906214714, -0.40121564269065857, -0.19181270897388458, 0.03832131624221802, -0.014187291264533997, 0.09390968084335327, 0.1081240326166153, 0.007352706976234913, -0.28722625970840454, 0.050189509987831116, 0.22673721611499786, -0.0701567754149437, -0.01220107451081276, 0.11828882992267609, -0.3647078573703766, 0.044692378491163254, 0.1680942177772522, -0.10000324994325638, 0.1386716514825821, 0.038295574486255646, -0.028410546481609344, -0.12430635839700699, -0.33586063981056213, -0.04494093358516693, -0.184409961104393, 0.675073504447937, 0.08657554537057877, 0.044727977365255356, -0.2883932590484619, -0.39848989248275757, 0.20048770308494568, 0.2731606960296631, -0.1155707836151123, 0.1409587264060974, 0.0858575776219368, 0.07656078785657883, -0.17892161011695862, -0.044758595526218414, -0.07274269312620163, -0.3597073554992676, 0.01941404864192009, -0.03579612076282501, -0.11587226390838623, 0.13168883323669434, -0.18240635097026825, 0.17288416624069214, 0.5054889917373657, 0.02528655156493187, -0.2901579737663269, -0.3475990295410156, 0.1905186027288437, -0.06264864653348923, -0.2594660520553589, -0.05778328329324722, -0.0026705749332904816, 0.09334969520568848, 0.2697675824165344, -0.42312484979629517, -0.04174503684043884, -0.014795919880270958, 0.14797621965408325, -0.17382241785526276, -0.3538969159126282, 0.2849053740501404, 0.2340078055858612, -0.03137299045920372, -0.09749604016542435, -0.2075367569923401, -0.07764723151922226, -0.008408699184656143, 0.4140312373638153, 0.002065306529402733, 0.20911955833435059, -0.017816372215747833, 0.04531519487500191, 0.15128271281719208, 0.2853335738182068, 0.7059415578842163, 0.15238270163536072, 0.1911250203847885, 0.12037934362888336, -0.2509270906448364, 0.1740177571773529, -0.20073163509368896, -0.014154101721942425, 0.33949872851371765, -0.06420644372701645, -0.00702819786965847, -0.2144095003604889, -0.08470308780670166, -0.21895474195480347, -0.062671959400177, 0.013783234171569347, -0.1984517127275467, 0.34522363543510437, -0.20986807346343994, -0.08896081149578094, 0.36883628368377686, -0.026597287505865097, 0.21737021207809448, 0.17576996982097626, -0.1267344355583191, -0.1552066057920456, -0.19829697906970978, -0.21983826160430908, -0.4107115566730499, 0.2797967195510864, 0.13473951816558838, 0.6053631901741028, 0.024261970072984695, -0.04728056117892265, -0.009520165622234344, -0.3188266456127167, 0.44892358779907227, -0.11870791763067245, 0.11287638545036316, 0.12380711734294891, -0.012164819985628128, -0.5684407949447632, -0.29695290327072144, -0.06092183664441109, 0.2707672417163849, 0.049191784113645554, 0.4614696800708771, -0.1427006721496582, 0.2389986664056778, 0.315900981426239, 0.13029681146144867, -0.09473742544651031, -0.08245020359754562, -0.4103216230869293, -0.6870731115341187, -0.1309131234884262, 0.038848500698804855, -0.09975145757198334, 0.4027709364891052, -0.15969029068946838, -0.09481701999902725, -0.08056039363145828, 0.19697529077529907, -0.06398084759712219, -0.06338833272457123, 0.0739927664399147, 0.0868270993232727, 0.2531450092792511, -0.09419143199920654, 0.2027396261692047, -0.05720166862010956, 0.31642061471939087, 0.13974978029727936, -0.25895535945892334, 0.04596645012497902, 0.08078401535749435, 0.08692130446434021, 0.2498498111963272, -0.22185015678405762, -0.20216262340545654, 0.042904794216156006, 0.0741298571228981, -0.0531868077814579, 0.25452932715415955, 0.8272789120674133, -0.27019721269607544, -0.3177138864994049, -0.05536390841007233, 0.3019482493400574, -0.035790666937828064, -0.031045030802488327, -0.1361473947763443, -0.4344770908355713, -0.19778074324131012, 0.4961393475532532, 0.22306165099143982, 0.9382805824279785, 0.06029851734638214, 0.07747390866279602, 0.36871129274368286, 0.06222014129161835, 0.261342853307724, -0.436367392539978, 0.11314044892787933, -0.03354635834693909, -0.4514071047306061, 0.13319513201713562, 0.11602902412414551, 0.1124788299202919, -0.12724338471889496, -0.3201117217540741, -0.004287440329790115, 0.17103101313114166, -0.1982191652059555, 0.20202995836734772, -0.11692741513252258, -0.03284744173288345, -0.1594519019126892, -0.30887824296951294, 0.10638882219791412, 0.018059711903333664, 0.2763407528400421, -0.32945775985717773, 0.07050231099128723, 0.08831067383289337, -0.2714240550994873, -0.33382681012153625, 0.3557634949684143, -0.2556294798851013, 0.2920178771018982, -0.6306742429733276, 0.15711453557014465, -0.11657126247882843, 0.21915215253829956, 0.3410787582397461, 0.3689152002334595, -0.16857074201107025, 0.15864132344722748, 0.29903677105903625, -0.11008032411336899, 0.23795278370380402, -0.17699816823005676, -0.06213122606277466, -0.29552531242370605, -0.18054336309432983, -0.006072007119655609, -0.29743215441703796, 0.08405224978923798, -0.018683001399040222, 0.0911019891500473, -0.01000211387872696, 0.005315215792506933, -0.06519843637943268, -0.004380226135253906, 0.3272298276424408, -0.21076896786689758, 0.13338255882263184, 0.007430829107761383, -0.1289440095424652, 0.2952834963798523, -0.3113306760787964, -0.39142927527427673, -0.05662054196000099, 0.41349461674690247, -0.019437439739704132, 0.2364853322505951, 0.3887900710105896, 0.008746769279241562, 0.12820586562156677, -0.06725127249956131, -0.05177865922451019, -0.3094165623188019, -0.17839114367961884, 0.06226048246026039, 0.40574753284454346, -0.021263964474201202, -0.04132126271724701, 0.6821672916412354, 0.5023379921913147, -0.05805019289255142, 0.2842259705066681, -0.5085428357124329, -0.053661465644836426, 0.41216886043548584, 0.039025746285915375, 0.235213503241539, 0.11354953795671463, 0.15442945063114166, 0.1110527366399765, -0.01907435990869999, -0.24681416153907776, 0.021809792146086693, -0.153691366314888, 0.10439179092645645, -0.08066314458847046, 0.07095588743686676, 0.3835847079753876, 0.3150915205478668, 0.18962092697620392, 0.1593913435935974, 0.012683290056884289, -0.13242052495479584, -0.20616857707500458, 0.15075919032096863, 0.12781068682670593, -0.25666311383247375, 0.1267160028219223, -0.2540701627731323, 0.0822921171784401, -0.033575452864170074, -0.02667447179555893, 0.13791200518608093, 0.0697200745344162, -0.10875383764505386, 0.08206716924905777, 0.12426124513149261, -0.04286176711320877, 0.3303702175617218, -0.03857188671827316, 0.3692846894264221, 0.23078685998916626, 0.219427227973938, 0.01910974271595478, -0.11759467422962189, 0.6458368301391602, -0.23686110973358154, -0.04535818099975586, 0.12787358462810516, 0.03256795555353165, -0.17061109840869904, -0.05049710348248482, -0.0771624818444252, 0.18255779147148132, 0.5723705887794495, -0.20992954075336456, -0.14079710841178894, 0.15141195058822632, 0.194304421544075, -0.3506428599357605, 0.0013894770527258515, 0.025028983131051064, -0.45401936769485474, -0.2719036042690277, 0.06966239213943481, 0.12043818831443787, -0.022400878369808197, 0.07968534529209137, -0.12065999954938889, 0.2021828293800354, 0.07756482064723969, -0.10862641036510468, 0.3175910413265228, -0.1361135095357895, 0.20454400777816772, 0.04626336693763733, -0.3149254322052002, 0.37645089626312256, 0.2715967893600464, 0.14238962531089783, -0.1644340604543686, 0.11133373528718948, 0.570709764957428, -0.161426842212677, -0.40532830357551575, -0.050516340881586075, 0.460482656955719, 0.052108071744441986, -0.0041686370968818665, -0.012508861720561981, 0.46504542231559753, -0.15834172070026398, -0.09814237803220749, -0.400020956993103, 0.40834593772888184, -0.11230169981718063, -0.2506638467311859, 0.20403268933296204, -0.0223197303712368, -0.32103824615478516, 0.19936393201351166, -0.00882018730044365, 0.2969422936439514, -0.1414569467306137, 0.30034640431404114, -0.34923744201660156, -0.2137998640537262, -0.24988865852355957, 0.3892728388309479, -0.24792155623435974, -0.3205779790878296, 0.3538101315498352, 0.27754461765289307, -0.14086118340492249, -0.12944549322128296, 0.27486395835876465, 0.2537926137447357, 0.28803426027297974, -0.4131760597229004, -0.15939603745937347, 0.25405043363571167, 0.2008870393037796, -0.23630540072917938, 0.1896883249282837, 0.5250464677810669, 0.46516165137290955, 0.25976452231407166, 0.1164189875125885, -0.2230025678873062, 0.3714628517627716, -0.11950945854187012, -0.2746327817440033, -0.03436828404664993, 0.11163027584552765, 0.0272496547549963, 0.006951227784156799, -0.05608365684747696, -0.07173549383878708, -0.41343042254447937, 0.15677982568740845, -0.02207026258111, -0.05299657583236694, 0.042912665754556656, 0.004690198693424463, 0.07002294808626175, 0.03816083073616028, 0.3015451729297638, 0.41265085339546204, 0.29615840315818787, -0.27783313393592834, -0.6142833232879639, -0.609196662902832, 0.21157948672771454, -0.03502114489674568, 0.13998739421367645, 0.06432487070560455, -0.1356162130832672, -0.019466541707515717, 0.09293445944786072, -0.15853892266750336, -0.3117798864841461, 0.24147766828536987, 0.07942589372396469, -0.2589091360569, 0.24800267815589905, 0.4954819083213806, 0.058294542133808136, -0.13152071833610535, -0.4492769241333008, 0.15586937963962555, 0.024809330701828003, 0.07500588893890381, -0.15926514565944672, -0.3705042898654938, 0.009272489696741104, -0.46183785796165466, 0.8872697353363037, 0.09777717292308807, 0.16251987218856812, -0.1749747097492218, -0.22559593617916107, -0.2874727249145508, -0.11634852737188339, 0.013107637874782085, 0.012100376188755035, 0.19317810237407684, 0.2746496796607971, -0.03941042721271515, 0.4162321388721466, -0.30120113492012024, 0.21877819299697876, 0.022692278027534485, -0.10465989261865616, -0.28682202100753784, -0.04481813311576843, -0.15804550051689148, -0.10041826963424683, -0.3055849075317383, 0.31130552291870117, -0.004229240119457245, 0.23836414515972137, -0.32406821846961975, -0.38642624020576477, 0.3152194619178772, -0.246345654129982, -0.0803663432598114, 0.21592918038368225, 0.301235556602478, -0.34466224908828735, -0.11868561059236526, 0.27865153551101685, 0.07851838320493698, 0.28991949558258057, 0.3873494863510132, -0.3197360932826996, 0.22576572000980377, -0.0417034737765789, -0.18798695504665375, -0.0010480470955371857, 0.23499229550361633, 0.04246830567717552, -0.2748907506465912, 0.275691956281662, -0.13954386115074158 ]
https://github.com/huggingface/datasets/issues/6475
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed
Hmm, I have a feeling this works fine on Linux, and is a real bug for however `datasets` is doing the sharding on Windows. I will follow up, but I think this is a real bug.
### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0
36
laion2B-en failed to load on Windows with PrefetchVirtualMemory failed ### Describe the bug I have downloaded laion2B-en, and I'm receiving the following error trying to load it: ``` Resolving data files: 100%|██████████| 128/128 [00:00<00:00, 1173.79it/s] Traceback (most recent call last): File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 31, in <module> count = compute_frequencies() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Art-Workspace\src\artworkspace\tokeneval\compute_frequencies.py", line 17, in compute_frequencies laion2b_dataset = load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\load.py", line 2165, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1187, in as_dataset datasets = map_nested( ^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\utils\py_utils.py", line 456, in map_nested return function(data_struct) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1217, in _build_single_dataset ds = self._as_dataset( ^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\builder.py", line 1291, in _as_dataset dataset_kwargs = ArrowReader(cache_dir, self.info).read( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 244, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 265, in read_files pa_table = self._read_files(files, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 200, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 336, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\arrow_reader.py", line 357, in read_table return table_cls.from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 1059, in from_file table = _memory_mapped_arrow_table_from_file(filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\bberman\Documents\Art-Workspace\venv\Lib\site-packages\datasets\table.py", line 66, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() ^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow\ipc.pxi", line 757, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow\error.pxi", line 91, in pyarrow.lib.check_status OSError: [WinError 8] PrefetchVirtualMemory failed. Detail: [Windows error 8] Not enough memory resources are available to process this command. ``` This error is probably a red herring: https://stackoverflow.com/questions/50263929/numpy-memmap-returns-not-enough-memory-while-there-are-plenty-available In other words, the issue is related to asking for a memory mapping of length N > M the length of the file on Windows. This gracefully succeeds on Linux. I have 1024 arrow files in my cache instead of 128 like in the repository for it. Probably related. I don't know why `datasets` reorganized/rewrote the dataset in my cache to be 1024 slices instead of the original 128. ### Steps to reproduce the bug ``` # as a huggingface developer, you may already have laion2B-en somewhere _CACHE_DIR = "." from datasets import load_dataset load_dataset("laion/laion2B-en", split="train", cache_dir=_CACHE_DIR, keep_in_memory=False) ``` ### Expected behavior This should correctly load as a memory mapped Arrow dataset. ### Environment info - `datasets` version: 2.15.0 - Platform: Windows-10-10.0.20348-SP0 (this is windows 2022) - Python version: 3.11.4 - `huggingface_hub` version: 0.19.4 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 - `fsspec` version: 2023.10.0 Hmm, I have a feeling this works fine on Linux, and is a real bug for however `datasets` is doing the sharding on Windows. I will follow up, but I think this is a real bug.
[ -0.10396318137645721, -0.1658564954996109, -0.06416884064674377, 0.3617137670516968, 0.045910730957984924, -0.1833963394165039, -0.012238878756761551, 0.26278215646743774, -0.2864784300327301, -0.08144982159137726, -0.02400197833776474, 0.0840771496295929, -0.14902691543102264, 0.1495058536529541, -0.03063856065273285, -0.03984741121530533, 0.0771910548210144, 0.12992259860038757, 0.2934598922729492, 0.16215330362319946, -0.4650859832763672, 0.35488027334213257, -0.2558758854866028, 0.10274055600166321, -0.06378618627786636, 0.1223767027258873, -0.3196195960044861, 0.5092806220054626, -0.28727012872695923, -0.3582841157913208, 0.4790029525756836, -0.30870354175567627, 0.36739757657051086, 0.1376122534275055, -0.00011523867578944191, 0.05485638976097107, 0.46044373512268066, -0.053147390484809875, 0.1673220545053482, 0.0958859995007515, 0.09431613236665726, -0.3622174561023712, -0.1488802433013916, -0.3601912558078766, 0.04446486383676529, -0.19450753927230835, -0.11527718603610992, -0.4744306206703186, 0.3433225452899933, 0.34332796931266785, 0.17225056886672974, 0.23018306493759155, 0.3630772829055786, 0.22018302977085114, 0.6044424772262573, -0.4517322778701782, -0.11601124703884125, 0.1880270540714264, 0.09052082151174545, -0.19645997881889343, 0.12938793003559113, 0.09616880118846893, -0.16839519143104553, -0.07067321240901947, -0.15562501549720764, -0.09010029584169388, 0.14442545175552368, -0.3717038035392761, -0.04261757433414459, 0.067752905189991, -0.03524560481309891, -0.05534256994724274, -0.16399887204170227, 0.26411646604537964, 0.030805695801973343, -0.5285080671310425, 0.2086520791053772, 0.35857439041137695, -0.0847676694393158, -0.05767494812607765, -0.04259467497467995, 0.09457999467849731, -0.0017680823802947998, 0.10504259169101715, -0.12069675326347351, 0.19219088554382324, -0.0820118635892868, 0.18123333156108856, 0.04026917368173599, 0.003902548924088478, 0.21010437607765198, 0.22022745013237, -0.32798096537590027, 0.10570291429758072, -0.4765613079071045, 0.04070339351892471, -0.08174420148134232, 0.28546828031539917, -0.044916849583387375, -0.050283730030059814, -0.08062916994094849, -0.0865580216050148, -0.14981800317764282, -0.11620870977640152, -0.05401568487286568, 0.4200056791305542, 0.0047071874141693115, -0.38476327061653137, 0.24009813368320465, 0.18792808055877686, 0.16747629642486572, 0.054135218262672424, -0.39239582419395447, -0.4642088711261749, -0.048038382083177567, -0.04021858051419258, 0.32786017656326294, -0.37214094400405884, -0.5733500719070435, 0.14143170416355133, -0.5692523121833801, 0.20278558135032654, 0.06204264983534813, 0.2793368101119995, -0.34032508730888367, -0.13716629147529602, 0.29225385189056396, 0.1804284006357193, -0.165046826004982, 0.03734845295548439, -0.008327510207891464, 0.21995852887630463, -0.19099698960781097, -0.10635039955377579, 0.08154016733169556, -0.36832407116889954, 0.5237658023834229, 0.22890357673168182, -0.017118431627750397, 0.05429517477750778, 0.10540474951267242, -0.22765959799289703, -0.3076716363430023, 0.28638675808906555, -0.1566094160079956, -0.007442089729011059, 0.13802756369113922, 0.062122322618961334, 0.012379884719848633, 0.25426024198532104, -0.1505430042743683, -0.20728950202465057, -0.2037099301815033, 0.16265088319778442, -0.10137004405260086, 0.1700955331325531, 0.3873383104801178, 0.024755358695983887, 0.2557815909385681, -0.19022274017333984, 0.024442583322525024, -0.17892122268676758, -0.49436888098716736, -0.16883385181427002, 0.3723070025444031, 0.008580997586250305, -0.09290443360805511, 0.045592911541461945, -0.29972293972969055, -0.09407852590084076, 0.3640092611312866, 0.10164648294448853, -0.06267382204532623, -0.010548621416091919, -0.46043023467063904, 0.08122338354587555, -0.19129881262779236, -0.34107106924057007, -0.32865041494369507, 0.4735720157623291, -0.1620633602142334, 0.33762502670288086, 0.01470162719488144, -0.009244699962437153, -0.2239348292350769, -0.35918083786964417, 0.4350607395172119, 0.17353065311908722, -0.0058902557939291, -0.13615484535694122, -0.48548388481140137, -0.4237338900566101, 0.3071894645690918, 0.33309096097946167, 0.16834299266338348, -0.19748345017433167, 0.1543683260679245, 0.5204558372497559, 0.1619521975517273, 0.09422635287046432, 0.0824144259095192, 0.19880864024162292, -0.245722696185112, -0.2646991014480591, -0.07643380761146545, 0.04763974994421005, -0.1596105694770813, 0.2700636386871338, -0.28090742230415344, 0.15925690531730652, -0.06307756900787354, 0.1164504885673523, -0.2511117458343506, 0.18181106448173523, -0.09474271535873413, -0.2472255825996399, 0.1807108074426651, 0.068353071808815, -0.23802818357944489, -0.08220233023166656, 0.16630326211452484, 0.41525545716285706, 0.06355112791061401, -0.08599527925252914, -0.10765910148620605, 0.014787474647164345, -0.3218420445919037, -0.10912773013114929, 0.10928100347518921, 0.21685755252838135, 0.22975510358810425, 0.013429281301796436, -0.17475131154060364, 0.28259509801864624, 0.15150736272335052, -0.21642975509166718, -0.02172110229730606, -0.12831290066242218, 0.3187291622161865, -0.3926483690738678, 0.28817808628082275, 0.4494491517543793, 0.06076633185148239, -0.023594167083501816, 0.28204065561294556, 0.20420968532562256, -0.20786608755588531, -0.05499560385942459, -0.011961229145526886, -0.0222882479429245, 0.15183529257774353, -0.1312483847141266, -0.20130003988742828, -0.01967892050743103, 0.5470788478851318, 0.2590557336807251, -0.07472953200340271, 0.16692420840263367, -0.10432539880275726, -0.1967262625694275, 0.18989036977291107, 0.01880810409784317, -0.030384831130504608, 0.08124957233667374, -0.22530221939086914, -0.16734877228736877, 0.30194711685180664, -0.4550797641277313, 0.5055994987487793, 0.006160619203001261, -0.18173639476299286, 0.20135441422462463, -0.2803895175457001, -0.13446475565433502, 0.23612672090530396, 0.027283646166324615, 0.1782967746257782, 0.29030248522758484, 0.08071767538785934, 0.13685756921768188, -0.40517011284828186, -0.23393835127353668, -0.057251378893852234, 0.06609947979450226, -0.24410852789878845, -0.23566119372844696, -0.09920857101678848, -0.001776285469532013, 0.1236765906214714, -0.40121564269065857, -0.19181270897388458, 0.03832131624221802, -0.014187291264533997, 0.09390968084335327, 0.1081240326166153, 0.007352706976234913, -0.28722625970840454, 0.050189509987831116, 0.22673721611499786, -0.0701567754149437, -0.01220107451081276, 0.11828882992267609, -0.3647078573703766, 0.044692378491163254, 0.1680942177772522, -0.10000324994325638, 0.1386716514825821, 0.038295574486255646, -0.028410546481609344, -0.12430635839700699, -0.33586063981056213, -0.04494093358516693, -0.184409961104393, 0.675073504447937, 0.08657554537057877, 0.044727977365255356, -0.2883932590484619, -0.39848989248275757, 0.20048770308494568, 0.2731606960296631, -0.1155707836151123, 0.1409587264060974, 0.0858575776219368, 0.07656078785657883, -0.17892161011695862, -0.044758595526218414, -0.07274269312620163, -0.3597073554992676, 0.01941404864192009, -0.03579612076282501, -0.11587226390838623, 0.13168883323669434, -0.18240635097026825, 0.17288416624069214, 0.5054889917373657, 0.02528655156493187, -0.2901579737663269, -0.3475990295410156, 0.1905186027288437, -0.06264864653348923, -0.2594660520553589, -0.05778328329324722, -0.0026705749332904816, 0.09334969520568848, 0.2697675824165344, -0.42312484979629517, -0.04174503684043884, -0.014795919880270958, 0.14797621965408325, -0.17382241785526276, -0.3538969159126282, 0.2849053740501404, 0.2340078055858612, -0.03137299045920372, -0.09749604016542435, -0.2075367569923401, -0.07764723151922226, -0.008408699184656143, 0.4140312373638153, 0.002065306529402733, 0.20911955833435059, -0.017816372215747833, 0.04531519487500191, 0.15128271281719208, 0.2853335738182068, 0.7059415578842163, 0.15238270163536072, 0.1911250203847885, 0.12037934362888336, -0.2509270906448364, 0.1740177571773529, -0.20073163509368896, -0.014154101721942425, 0.33949872851371765, -0.06420644372701645, -0.00702819786965847, -0.2144095003604889, -0.08470308780670166, -0.21895474195480347, -0.062671959400177, 0.013783234171569347, -0.1984517127275467, 0.34522363543510437, -0.20986807346343994, -0.08896081149578094, 0.36883628368377686, -0.026597287505865097, 0.21737021207809448, 0.17576996982097626, -0.1267344355583191, -0.1552066057920456, -0.19829697906970978, -0.21983826160430908, -0.4107115566730499, 0.2797967195510864, 0.13473951816558838, 0.6053631901741028, 0.024261970072984695, -0.04728056117892265, -0.009520165622234344, -0.3188266456127167, 0.44892358779907227, -0.11870791763067245, 0.11287638545036316, 0.12380711734294891, -0.012164819985628128, -0.5684407949447632, -0.29695290327072144, -0.06092183664441109, 0.2707672417163849, 0.049191784113645554, 0.4614696800708771, -0.1427006721496582, 0.2389986664056778, 0.315900981426239, 0.13029681146144867, -0.09473742544651031, -0.08245020359754562, -0.4103216230869293, -0.6870731115341187, -0.1309131234884262, 0.038848500698804855, -0.09975145757198334, 0.4027709364891052, -0.15969029068946838, -0.09481701999902725, -0.08056039363145828, 0.19697529077529907, -0.06398084759712219, -0.06338833272457123, 0.0739927664399147, 0.0868270993232727, 0.2531450092792511, -0.09419143199920654, 0.2027396261692047, -0.05720166862010956, 0.31642061471939087, 0.13974978029727936, -0.25895535945892334, 0.04596645012497902, 0.08078401535749435, 0.08692130446434021, 0.2498498111963272, -0.22185015678405762, -0.20216262340545654, 0.042904794216156006, 0.0741298571228981, -0.0531868077814579, 0.25452932715415955, 0.8272789120674133, -0.27019721269607544, -0.3177138864994049, -0.05536390841007233, 0.3019482493400574, -0.035790666937828064, -0.031045030802488327, -0.1361473947763443, -0.4344770908355713, -0.19778074324131012, 0.4961393475532532, 0.22306165099143982, 0.9382805824279785, 0.06029851734638214, 0.07747390866279602, 0.36871129274368286, 0.06222014129161835, 0.261342853307724, -0.436367392539978, 0.11314044892787933, -0.03354635834693909, -0.4514071047306061, 0.13319513201713562, 0.11602902412414551, 0.1124788299202919, -0.12724338471889496, -0.3201117217540741, -0.004287440329790115, 0.17103101313114166, -0.1982191652059555, 0.20202995836734772, -0.11692741513252258, -0.03284744173288345, -0.1594519019126892, -0.30887824296951294, 0.10638882219791412, 0.018059711903333664, 0.2763407528400421, -0.32945775985717773, 0.07050231099128723, 0.08831067383289337, -0.2714240550994873, -0.33382681012153625, 0.3557634949684143, -0.2556294798851013, 0.2920178771018982, -0.6306742429733276, 0.15711453557014465, -0.11657126247882843, 0.21915215253829956, 0.3410787582397461, 0.3689152002334595, -0.16857074201107025, 0.15864132344722748, 0.29903677105903625, -0.11008032411336899, 0.23795278370380402, -0.17699816823005676, -0.06213122606277466, -0.29552531242370605, -0.18054336309432983, -0.006072007119655609, -0.29743215441703796, 0.08405224978923798, -0.018683001399040222, 0.0911019891500473, -0.01000211387872696, 0.005315215792506933, -0.06519843637943268, -0.004380226135253906, 0.3272298276424408, -0.21076896786689758, 0.13338255882263184, 0.007430829107761383, -0.1289440095424652, 0.2952834963798523, -0.3113306760787964, -0.39142927527427673, -0.05662054196000099, 0.41349461674690247, -0.019437439739704132, 0.2364853322505951, 0.3887900710105896, 0.008746769279241562, 0.12820586562156677, -0.06725127249956131, -0.05177865922451019, -0.3094165623188019, -0.17839114367961884, 0.06226048246026039, 0.40574753284454346, -0.021263964474201202, -0.04132126271724701, 0.6821672916412354, 0.5023379921913147, -0.05805019289255142, 0.2842259705066681, -0.5085428357124329, -0.053661465644836426, 0.41216886043548584, 0.039025746285915375, 0.235213503241539, 0.11354953795671463, 0.15442945063114166, 0.1110527366399765, -0.01907435990869999, -0.24681416153907776, 0.021809792146086693, -0.153691366314888, 0.10439179092645645, -0.08066314458847046, 0.07095588743686676, 0.3835847079753876, 0.3150915205478668, 0.18962092697620392, 0.1593913435935974, 0.012683290056884289, -0.13242052495479584, -0.20616857707500458, 0.15075919032096863, 0.12781068682670593, -0.25666311383247375, 0.1267160028219223, -0.2540701627731323, 0.0822921171784401, -0.033575452864170074, -0.02667447179555893, 0.13791200518608093, 0.0697200745344162, -0.10875383764505386, 0.08206716924905777, 0.12426124513149261, -0.04286176711320877, 0.3303702175617218, -0.03857188671827316, 0.3692846894264221, 0.23078685998916626, 0.219427227973938, 0.01910974271595478, -0.11759467422962189, 0.6458368301391602, -0.23686110973358154, -0.04535818099975586, 0.12787358462810516, 0.03256795555353165, -0.17061109840869904, -0.05049710348248482, -0.0771624818444252, 0.18255779147148132, 0.5723705887794495, -0.20992954075336456, -0.14079710841178894, 0.15141195058822632, 0.194304421544075, -0.3506428599357605, 0.0013894770527258515, 0.025028983131051064, -0.45401936769485474, -0.2719036042690277, 0.06966239213943481, 0.12043818831443787, -0.022400878369808197, 0.07968534529209137, -0.12065999954938889, 0.2021828293800354, 0.07756482064723969, -0.10862641036510468, 0.3175910413265228, -0.1361135095357895, 0.20454400777816772, 0.04626336693763733, -0.3149254322052002, 0.37645089626312256, 0.2715967893600464, 0.14238962531089783, -0.1644340604543686, 0.11133373528718948, 0.570709764957428, -0.161426842212677, -0.40532830357551575, -0.050516340881586075, 0.460482656955719, 0.052108071744441986, -0.0041686370968818665, -0.012508861720561981, 0.46504542231559753, -0.15834172070026398, -0.09814237803220749, -0.400020956993103, 0.40834593772888184, -0.11230169981718063, -0.2506638467311859, 0.20403268933296204, -0.0223197303712368, -0.32103824615478516, 0.19936393201351166, -0.00882018730044365, 0.2969422936439514, -0.1414569467306137, 0.30034640431404114, -0.34923744201660156, -0.2137998640537262, -0.24988865852355957, 0.3892728388309479, -0.24792155623435974, -0.3205779790878296, 0.3538101315498352, 0.27754461765289307, -0.14086118340492249, -0.12944549322128296, 0.27486395835876465, 0.2537926137447357, 0.28803426027297974, -0.4131760597229004, -0.15939603745937347, 0.25405043363571167, 0.2008870393037796, -0.23630540072917938, 0.1896883249282837, 0.5250464677810669, 0.46516165137290955, 0.25976452231407166, 0.1164189875125885, -0.2230025678873062, 0.3714628517627716, -0.11950945854187012, -0.2746327817440033, -0.03436828404664993, 0.11163027584552765, 0.0272496547549963, 0.006951227784156799, -0.05608365684747696, -0.07173549383878708, -0.41343042254447937, 0.15677982568740845, -0.02207026258111, -0.05299657583236694, 0.042912665754556656, 0.004690198693424463, 0.07002294808626175, 0.03816083073616028, 0.3015451729297638, 0.41265085339546204, 0.29615840315818787, -0.27783313393592834, -0.6142833232879639, -0.609196662902832, 0.21157948672771454, -0.03502114489674568, 0.13998739421367645, 0.06432487070560455, -0.1356162130832672, -0.019466541707515717, 0.09293445944786072, -0.15853892266750336, -0.3117798864841461, 0.24147766828536987, 0.07942589372396469, -0.2589091360569, 0.24800267815589905, 0.4954819083213806, 0.058294542133808136, -0.13152071833610535, -0.4492769241333008, 0.15586937963962555, 0.024809330701828003, 0.07500588893890381, -0.15926514565944672, -0.3705042898654938, 0.009272489696741104, -0.46183785796165466, 0.8872697353363037, 0.09777717292308807, 0.16251987218856812, -0.1749747097492218, -0.22559593617916107, -0.2874727249145508, -0.11634852737188339, 0.013107637874782085, 0.012100376188755035, 0.19317810237407684, 0.2746496796607971, -0.03941042721271515, 0.4162321388721466, -0.30120113492012024, 0.21877819299697876, 0.022692278027534485, -0.10465989261865616, -0.28682202100753784, -0.04481813311576843, -0.15804550051689148, -0.10041826963424683, -0.3055849075317383, 0.31130552291870117, -0.004229240119457245, 0.23836414515972137, -0.32406821846961975, -0.38642624020576477, 0.3152194619178772, -0.246345654129982, -0.0803663432598114, 0.21592918038368225, 0.301235556602478, -0.34466224908828735, -0.11868561059236526, 0.27865153551101685, 0.07851838320493698, 0.28991949558258057, 0.3873494863510132, -0.3197360932826996, 0.22576572000980377, -0.0417034737765789, -0.18798695504665375, -0.0010480470955371857, 0.23499229550361633, 0.04246830567717552, -0.2748907506465912, 0.275691956281662, -0.13954386115074158 ]
https://github.com/huggingface/datasets/issues/6467
New version release request
We will publish it soon (we usually do it in intervals of 1-2 months, so probably next week)
### Feature request Hi! I am using `datasets` in library `xtuner` and am highly interested in the features introduced since v2.15.0. To avoid installation from source in our pypi wheels, we are eagerly waiting for the new release. So, Does your team have a new release plan for v2.15.1 and could you please share it with us? Thanks very much! ### Motivation . ### Your contribution .
18
New version release request ### Feature request Hi! I am using `datasets` in library `xtuner` and am highly interested in the features introduced since v2.15.0. To avoid installation from source in our pypi wheels, we are eagerly waiting for the new release. So, Does your team have a new release plan for v2.15.1 and could you please share it with us? Thanks very much! ### Motivation . ### Your contribution . We will publish it soon (we usually do it in intervals of 1-2 months, so probably next week)
[ -0.445797860622406, 0.29189902544021606, -0.07614562660455704, -0.06915648281574249, 0.025643663480877876, -0.18820473551750183, -0.005975153297185898, 0.29262658953666687, -0.3280109465122223, 0.20499104261398315, 0.21357905864715576, 0.24996213614940643, -0.37874558568000793, 0.43638479709625244, -0.03912561014294624, -0.2581973671913147, 0.085100919008255, 0.2111540138721466, -0.22152936458587646, -0.08256673812866211, -0.1784408837556839, -0.09560060501098633, -0.16696520149707794, 0.3061983585357666, -0.3760680556297302, -0.1269284188747406, -0.4008386731147766, -0.08959405869245529, -0.6505075693130493, -0.45635491609573364, 0.2715657651424408, 0.4392762780189514, 0.24544155597686768, 0.5390733480453491, -0.00011963614815613255, -0.35795408487319946, 0.2620927095413208, 0.11512690782546997, -0.24798189103603363, -0.1748683899641037, -0.19455793499946594, -0.3973909318447113, 0.01947084814310074, -0.004456743597984314, 0.16003894805908203, -0.19785627722740173, 0.0816730409860611, 0.3285480737686157, 0.007815569639205933, -0.04102262482047081, 0.1623380184173584, 0.37004217505455017, 0.03350308910012245, -0.17621438205242157, 0.3655868172645569, 0.20428261160850525, -0.36121878027915955, -0.13582192361354828, 0.7153136730194092, -0.09215021133422852, -0.15091127157211304, 0.14007286727428436, -0.014419613406062126, -0.2698690891265869, 0.18357673287391663, 0.08932650089263916, -0.15563830733299255, -0.4101589620113373, -0.20409932732582092, 0.3486010432243347, 0.5031329393386841, -0.22141456604003906, -0.36669397354125977, -0.001805175095796585, -0.14220425486564636, -0.23917661607265472, 0.08147738128900528, -0.113154835999012, -0.10975998640060425, 0.03926094248890877, 0.132925346493721, -0.5441612601280212, -0.256487637758255, 0.14058001339435577, -0.10545924305915833, 0.890639066696167, 0.09388673305511475, -0.09011507779359818, 0.030522210523486137, -0.22111813724040985, 0.4701601564884186, 0.004135848954319954, -0.16983015835285187, 0.3237769305706024, -0.31877925992012024, -0.5342130064964294, 0.1786675751209259, -0.4106135964393616, 0.30213335156440735, 0.10664724558591843, 0.10917451977729797, -0.21928316354751587, -0.4034176170825958, -0.13378357887268066, 0.5380098223686218, 0.20048554241657257, 0.21377751231193542, 0.19873426854610443, 0.18818610906600952, 0.17454536259174347, 0.23847398161888123, 0.13863180577754974, 0.013209554366767406, 0.05456669628620148, 0.01715126633644104, 0.04917819797992706, 0.28235578536987305, -0.3207704424858093, 0.3346611261367798, -0.04375094920396805, -0.027840949594974518, -0.5358143448829651, -0.04506856948137283, -0.18237540125846863, 0.05351942777633667, 0.4412139654159546, -0.31253206729888916, -0.02485710009932518, -0.10681770741939545, -0.2394362837076187, -0.2937408685684204, -0.15030799806118011, -0.07259014248847961, 0.12213703989982605, 0.05519014969468117, -0.37142419815063477, -0.08205980807542801, 0.05682862550020218, 0.281524121761322, 0.08872723579406738, 0.22056186199188232, 0.11555346846580505, -0.13575142621994019, 0.1916084587574005, -0.2542268633842468, 0.1504768282175064, -0.13927628099918365, -0.12098666280508041, -0.16927854716777802, 0.6368443965911865, 0.0743919312953949, -0.5167413949966431, 0.030670251697301865, 0.14888796210289001, -0.4210096001625061, -0.2969108819961548, 0.007338918745517731, 0.24483248591423035, -0.26664507389068604, 0.2474343180656433, 0.05768746882677078, 0.038933973759412766, -0.04204244911670685, -0.19001004099845886, -0.19991090893745422, 0.1621013879776001, -0.2974194586277008, -0.0867457315325737, 0.13078387081623077, -0.10761658847332001, -0.053142525255680084, 0.0785788968205452, -0.06877666711807251, -0.2705196738243103, 0.095466248691082, 0.040540844202041626, 0.5097721815109253, -0.264020174741745, -0.4933476150035858, 0.35712558031082153, -0.36142247915267944, -0.4332307279109955, 0.4034874737262726, 0.2372903823852539, 0.4294271767139435, -0.22786535322666168, -0.3577139973640442, 0.17816022038459778, -0.30430591106414795, -0.21521911025047302, -0.36564740538597107, -0.6652055382728577, 0.09497156739234924, 0.17657017707824707, 0.3788169324398041, 0.011883653700351715, 0.039840929210186005, 0.16139501333236694, 0.4121592342853546, 0.051597923040390015, 0.163990318775177, 0.001675184816122055, 0.582146406173706, -0.00991307944059372, 0.11073347181081772, -0.19007501006126404, -0.12651106715202332, 0.14353853464126587, -0.1978144645690918, 0.11866752058267593, 0.29789119958877563, -0.03497971594333649, -0.14406371116638184, 0.10123320668935776, -0.21518979966640472, -0.2554207742214203, -0.0030653998255729675, -0.06475366652011871, -0.14784350991249084, 0.12877492606639862, -0.3563413918018341, -0.16394035518169403, -0.2698228359222412, 0.14286698400974274, -0.040950462222099304, 0.48936158418655396, -0.0997576043009758, -0.251719206571579, -0.03639940917491913, 0.05116961523890495, -0.03939707577228546, -0.10669266432523727, -0.07594703882932663, 0.054457008838653564, -0.05354329198598862, -0.029678791761398315, 0.674903154373169, 0.44131797552108765, 0.3308625817298889, -0.12397180497646332, 0.5724024772644043, 0.09701377153396606, -0.11958076804876328, 0.06553568691015244, -0.053860731422901154, 0.358987033367157, -0.37514108419418335, 0.029567867517471313, -0.08259067684412003, 0.20156046748161316, 0.22062915563583374, 0.1390640139579773, -0.14756985008716583, -0.1595093309879303, -0.016868267208337784, 0.1389300674200058, 0.02457936480641365, -0.07703528553247452, -0.17759382724761963, 0.24429598450660706, 0.5282202959060669, -0.008090583607554436, -0.058748483657836914, 0.15279769897460938, -0.02157396823167801, -0.020481806248426437, 0.09322475641965866, 0.2590036392211914, 0.10754469037055969, 0.08717983961105347, -0.06036082282662392, -0.045455336570739746, 0.18268990516662598, -0.10685307532548904, 0.1662447303533554, 0.14951364696025848, -0.29294970631599426, -0.10438375920057297, -0.08241453021764755, 0.1632273644208908, 0.019813671708106995, -0.07176700234413147, 0.12167755514383316, 0.3114892244338989, 0.09199073910713196, -0.37339234352111816, -0.0504983589053154, -0.540160059928894, -0.08333952724933624, -0.09821785241365433, -0.28802838921546936, -0.1964547485113144, 0.05081239342689514, 0.1544966846704483, 0.05181993916630745, 0.2952662706375122, 0.05396394804120064, 0.35172322392463684, -0.17614662647247314, 0.18953390419483185, -0.05974080041050911, -0.1475231647491455, -0.08533254265785217, 0.19839148223400116, -0.11385004967451096, -0.2571158707141876, 0.2792021930217743, 0.019829517230391502, 0.38526076078414917, -0.4955518841743469, -0.6562049984931946, 0.15106728672981262, -0.23089031875133514, -0.027510827407240868, 0.2015959620475769, -0.14935781061649323, 0.14999297261238098, 0.08496754616498947, 0.2942782938480377, -0.15979649126529694, -0.24984905123710632, -0.03562531992793083, 0.03461942449212074, 0.19725129008293152, 0.028924312442541122, -0.2966122031211853, -0.21780623495578766, -0.13004620373249054, 0.138243168592453, 0.20716474950313568, 0.1437901258468628, -0.023650087416172028, 0.18928155303001404, -0.14309662580490112, -0.009293174371123314, -0.41502293944358826, 0.05908013507723808, -0.35236746072769165, 0.16869796812534332, 0.006010168697685003, -0.24043969810009003, 0.10212104022502899, -0.048463933169841766, -0.05395856872200966, 0.06804807484149933, -0.6474263668060303, -0.3164776563644409, -0.11661021411418915, 0.4022270143032074, 0.3582150936126709, 0.13870777189731598, 0.3926270306110382, 0.38972339034080505, -0.02539723925292492, 0.0738472118973732, -0.32825106382369995, -0.13392969965934753, 0.4176788628101349, 0.14523358643054962, 0.2181490957736969, 0.29521051049232483, 0.26590508222579956, 0.7640487551689148, 0.14515264332294464, 0.3342231214046478, 0.15123134851455688, 0.04987632483243942, 0.1533382087945938, -0.2672159969806671, -0.3265434503555298, 0.12481407076120377, 0.04129781574010849, 0.007820673286914825, 0.0496097169816494, 0.13816732168197632, 0.1409086138010025, -0.255987286567688, -0.18453219532966614, 0.33400991559028625, 0.0007819458842277527, 0.1682126671075821, -0.0056919194757938385, 0.3876189589500427, -0.13793255388736725, -0.03373958170413971, -0.24470697343349457, -0.08425375819206238, -0.06309839338064194, 0.16824977099895477, 0.24853047728538513, 0.021840589120984077, 0.188988596200943, 0.3005295395851135, -0.537675142288208, 0.1541513055562973, 0.16235233843326569, 0.15922874212265015, 0.007219549268484116, 0.08051090687513351, -0.06439514458179474, 0.10302142053842545, -0.011195912957191467, -0.1559028923511505, -0.13349021971225739, 0.4357766807079315, -0.6148207783699036, 0.15648521482944489, -0.003021392971277237, -0.4209582209587097, -0.45895740389823914, -0.42614492774009705, 0.05876004323363304, 0.04527663439512253, -0.4985305368900299, 0.3864372670650482, 0.0802190974354744, -0.25898855924606323, 0.0351613312959671, 0.004868760704994202, 0.06588564068078995, -0.24439728260040283, 0.00566478818655014, -0.20751646161079407, -0.21129769086837769, -0.28687581419944763, -0.19456861913204193, 0.1227043867111206, -0.1400715410709381, -0.03134983777999878, -0.1728944033384323, 0.07151995599269867, -0.1689874529838562, 0.17101842164993286, 0.0037597939372062683, -0.26547184586524963, 0.2866542935371399, 0.21881017088890076, -0.035507943481206894, -0.27416756749153137, 0.2838069200515747, -0.4512212872505188, 0.29684242606163025, 0.2693920135498047, -0.09541568905115128, 0.3836905360221863, -0.042484067380428314, 0.18334230780601501, -0.3376334607601166, -0.0465882383286953, 0.6579641699790955, 0.053253959864377975, -0.03134200721979141, -0.5295296907424927, 0.22935286164283752, 0.2917139232158661, -0.27578407526016235, 0.38669759035110474, 0.20335066318511963, 0.10637809336185455, 0.025110170245170593, 0.16603755950927734, 1.0553616285324097, -0.03212442994117737, 0.2941562533378601, 0.15915149450302124, -0.23855972290039062, 0.453828364610672, 0.2559947967529297, -0.10487737506628036, -0.3087897300720215, -0.5182955265045166, -0.1416202038526535, -0.13477164506912231, -0.09893921762704849, 0.06989619880914688, -0.35926854610443115, 0.2582608163356781, -0.2639092206954956, 0.08711473643779755, 0.25893110036849976, 0.3859551250934601, 0.11977112293243408, 0.017046596854925156, 0.023670442402362823, 0.07454221695661545, -0.05954347550868988, 0.08415669202804565, -0.18280181288719177, -0.18144454061985016, 0.06029217317700386, -0.00955471396446228, -0.3466190695762634, -0.16015037894248962, 0.2941417992115021, 0.05022767186164856, 0.02350715547800064, -0.559827983379364, 0.14294825494289398, -0.20927327871322632, 0.1630905717611313, -0.10313805937767029, 0.06978373229503632, -0.15301893651485443, -0.08459144085645676, 0.231752410531044, 0.3645719289779663, 0.3030812740325928, 0.40632164478302, -0.28808194398880005, -0.12118177115917206, 0.23825395107269287, -0.0012578042224049568, -0.09574753046035767, -0.7136163711547852, -0.13713116943836212, -0.00229022279381752, -0.4555084705352783, 0.5247039794921875, 0.09346528351306915, -0.22915485501289368, -0.17902347445487976, 0.10719947516918182, 0.40346479415893555, 0.09704738855361938, 0.13032075762748718, 0.08462081849575043, -0.09408871829509735, -0.16023609042167664, -0.1389453411102295, 0.5209046006202698, -0.34918537735939026, 0.14646565914154053, -0.03284398466348648, 0.018973443657159805, -0.2079576551914215, 0.309266060590744, 0.13725616037845612, -0.5451034903526306, 0.15838703513145447, -0.21314787864685059, -0.11550799757242203, 0.22845833003520966, 0.5974893569946289, 0.24268817901611328, 0.14328467845916748, -0.2793508470058441, 0.13914835453033447, -0.4146715998649597, 0.21804459393024445, -0.2749846577644348, 0.130747988820076, -0.517582893371582, 0.1355898678302765, 0.04705682396888733, -0.01698814518749714, -0.26450273394584656, -0.009935738518834114, 0.18631939589977264, -0.12289640307426453, 0.019935425370931625, 0.06205999478697777, -0.2755996286869049, 0.13689257204532623, 0.0015180353075265884, -0.21729879081249237, -0.2818613350391388, -0.07214274257421494, -0.19672168791294098, 0.1579771339893341, 0.06397254019975662, -0.02075517177581787, -0.06023125350475311, 0.019007310271263123, -0.18167130649089813, 0.22366905212402344, 0.23876532912254333, 0.0886797234416008, 0.07488565146923065, 0.36996403336524963, 0.18274858593940735, -0.1585809886455536, -0.3610578775405884, 0.40069156885147095, 0.2759976387023926, 0.2997877895832062, 0.19068074226379395, 0.3009704351425171, 0.09378070384263992, -0.13356125354766846, -0.12445897608995438, 0.1440671980381012, 0.24725590646266937, 0.27191123366355896, 0.13494786620140076, -0.11460025608539581, 0.23622143268585205, -0.040529850870370865, 0.3462550640106201, 0.09171509742736816, 0.05313779413700104, -0.2101488709449768, 0.16968804597854614, 0.20488841831684113, -0.23112152516841888, -0.21362008154392242, -0.046862680464982986, 0.2852396070957184, -0.10203349590301514, 0.21235790848731995, 0.10482829809188843, 0.21322473883628845, 0.7359588146209717, 0.011736933141946793, 0.05695703625679016, -0.11123885214328766, 0.254317045211792, 0.4668594002723694, 0.04840425029397011, 0.044375039637088776, 0.4460225999355316, 0.2613586187362671, 0.00315934419631958, 0.15218687057495117, -0.0407005175948143, 0.06423819065093994, 0.36316829919815063, 0.11722680926322937, 0.43131306767463684, -0.07214668393135071, -0.3945663869380951, -0.037489235401153564, 0.16813671588897705, -0.058281488716602325, 0.06742390990257263, 0.47925087809562683, -0.027620330452919006, 0.030812641605734825, -0.07713311165571213, -0.1232529729604721, 0.05619599670171738, 0.19091400504112244, -0.25535130500793457, -0.24641510844230652, -0.30577564239501953, -0.16737249493598938, -0.21911457180976868, 0.06445945054292679, 0.23946315050125122, 0.04755014181137085, 0.0458541102707386, -0.34259462356567383, -0.011352863162755966, 0.16464850306510925, -0.012782849371433258, -0.13089460134506226, 0.20086146891117096, 0.021597765386104584, 0.06935541331768036, 0.026157302781939507, 0.5229682326316833, 0.18682314455509186, -0.11109049618244171, -0.1334749013185501, 0.14037632942199707, -0.13379943370819092, -0.07216443866491318, 0.18978069722652435, 0.0529630146920681, 0.05411814898252487, -0.044693153351545334, 0.140290305018425, 0.04508122056722641, -0.06166108325123787, 0.1994025856256485, -0.0350547693669796, -0.1704794466495514, -0.31038224697113037, 0.24178430438041687, 0.43660473823547363, -0.2718883752822876, 0.1278795599937439, 0.0765613317489624, -0.2630915939807892, 0.12988349795341492, 0.3703019917011261, 0.08428702503442764, -0.10149166733026505, -0.05208220332860947, 0.04913622885942459, 0.013114385306835175, 0.19402848184108734, 0.3451358675956726, 0.359927773475647, -0.0916530042886734, -0.3541285991668701, -0.3907957375049591, 0.2853471636772156, 0.33013278245925903, -0.20242701470851898, 0.06079902499914169, 0.14289899170398712, 0.10926605761051178, 0.22694259881973267, 0.2868424654006958, -0.3258362412452698, -0.14217540621757507, 0.057430706918239594, -0.5658145546913147, -0.06390154361724854, 0.3583261966705322, 0.3305477797985077, -0.10760997235774994, 0.14584502577781677, 0.036368031054735184, -0.04126256704330444, -0.010440610349178314, -0.12609748542308807, -0.1187649816274643, 0.33642470836639404, 0.14395713806152344, 0.2518486976623535, 0.09584441781044006, 0.08465083688497543, 0.2311815619468689, -0.14152750372886658, -0.2629726231098175, -0.1884412318468094, -0.19839833676815033, -0.0630556270480156, 0.08150353282690048, 0.2096414715051651, -0.13920976221561432, 0.059325166046619415, -0.42826107144355774, 0.27697813510894775, -0.23379415273666382, 0.18582452833652496, -0.26092517375946045, 0.23079971969127655, 0.06303989142179489, -0.16661278903484344, 0.2728184461593628, 0.3005490005016327, 0.03733937069773674, -0.12868165969848633, -0.41530126333236694, -0.1730319857597351, 0.30824244022369385, 0.4072578251361847, -0.10672253370285034, -0.4694434106349945, -0.05836807191371918, -0.07640174776315689, -0.05308912694454193, -0.2727266550064087, -0.004401147365570068, 0.18484172224998474, 0.13254113495349884, -0.16298237442970276, 0.06180860474705696, 0.3147243559360504, 0.1419159173965454, -0.039544861763715744, 0.4378679692745209, -0.19056066870689392, -0.01798996701836586, 0.04072853550314903, -0.06126568466424942 ]
https://github.com/huggingface/datasets/issues/6466
Can't align optional features of struct
Friendly bump, I would be happy to work on this issue once I get the go-ahead from the dev team.
### Describe the bug Hello! I'm currently experiencing an issue where I can't concatenate datasets if an inner field of a Feature is Optional. I have a column named `speaker`, and this holds some information about a speaker. ```python @dataclass class Speaker: name: str email: Optional[str] ``` If I have two datasets, one happens to have `email` always None, then I get `The features can't be aligned because the key email of features` ### Steps to reproduce the bug You can run the following script: ```python ds = Dataset.from_dict({'speaker': [{'name': 'Ben', 'email': None}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) concatenate_datasets([ds, ds2]) >>>The features can't be aligned because the key speaker of features {'speaker': {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)}} has unexpected type - {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)} (expected either {'email': Value(dtype='null', id=None), 'name': Value(dtype='string', id=None)} or Value("null"). ``` ### Expected behavior I think this should work; if two top-level columns were in the same situation it would properly cast to `string`. ```python ds = Dataset.from_dict({'email': [None, None]}) ds2 = Dataset.from_dict({'email': ['abc@aol.com', 'one@yahoo.com']}) concatenate_datasets([ds, ds2]) >>> # Works! ``` ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35 - Python version: 3.9.13 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 - `fsspec` version: 2023.6.0 I would be happy to fix this issue.
20
Can't align optional features of struct ### Describe the bug Hello! I'm currently experiencing an issue where I can't concatenate datasets if an inner field of a Feature is Optional. I have a column named `speaker`, and this holds some information about a speaker. ```python @dataclass class Speaker: name: str email: Optional[str] ``` If I have two datasets, one happens to have `email` always None, then I get `The features can't be aligned because the key email of features` ### Steps to reproduce the bug You can run the following script: ```python ds = Dataset.from_dict({'speaker': [{'name': 'Ben', 'email': None}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) concatenate_datasets([ds, ds2]) >>>The features can't be aligned because the key speaker of features {'speaker': {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)}} has unexpected type - {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)} (expected either {'email': Value(dtype='null', id=None), 'name': Value(dtype='string', id=None)} or Value("null"). ``` ### Expected behavior I think this should work; if two top-level columns were in the same situation it would properly cast to `string`. ```python ds = Dataset.from_dict({'email': [None, None]}) ds2 = Dataset.from_dict({'email': ['abc@aol.com', 'one@yahoo.com']}) concatenate_datasets([ds, ds2]) >>> # Works! ``` ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35 - Python version: 3.9.13 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 - `fsspec` version: 2023.6.0 I would be happy to fix this issue. Friendly bump, I would be happy to work on this issue once I get the go-ahead from the dev team.
[ 0.05887921527028084, -0.32638096809387207, 0.1339402198791504, 0.23355932533740997, 0.21374790370464325, 0.14838314056396484, 0.1363566368818283, 0.0305489432066679, -0.12449480593204498, -0.01858857274055481, 0.08468348532915115, 0.02271345630288124, 0.10085220634937286, 0.24634630978107452, -0.7380690574645996, -0.053196340799331665, 0.1208876222372055, 0.11724138259887695, 0.02780875936150551, -0.07556430995464325, -0.0332350879907608, 0.20948144793510437, -0.37742626667022705, -0.20419125258922577, -0.20557938516139984, 0.22163844108581543, -0.12999798357486725, -0.01495739072561264, 0.1112603023648262, 0.11424943059682846, 0.4427764117717743, 0.08451101928949356, -0.24581141769886017, 0.1434725672006607, -0.00012169573892606422, 0.10539336502552032, 0.3147260546684265, -0.04143800958991051, -0.3637579083442688, -0.238414004445076, -0.3983522057533264, -0.2557165026664734, -0.11032594740390778, -0.15653449296951294, -0.07477404177188873, -0.20277489721775055, -0.1285906732082367, -0.24067270755767822, -0.023443058133125305, -0.01224602572619915, 0.10695500671863556, 0.34622839093208313, 0.19975058734416962, -0.15650564432144165, -0.1156843975186348, 0.4340174198150635, -0.11877685785293579, -0.4476948380470276, -0.42575016617774963, 0.12698666751384735, 0.613505482673645, -0.030933422967791557, -0.08562014251947403, -0.3964955508708954, 0.09671254456043243, 0.277650386095047, -0.38695403933525085, -0.1880163848400116, 0.04884030669927597, 0.24747878313064575, 0.7935325503349304, -0.0435057058930397, -0.38832417130470276, -0.14090865850448608, 0.06637342274188995, 0.029881658032536507, 0.28010106086730957, 0.053901441395282745, 0.13674256205558777, 0.20156259834766388, 0.15951527655124664, 0.27005574107170105, -0.028183843940496445, 0.16744913160800934, -0.026981119066476822, 0.06546178460121155, 0.019827064126729965, -0.04542500525712967, -0.4781768321990967, -0.3012455105781555, -0.27952730655670166, -0.35956403613090515, -0.2635989785194397, 0.16236738860607147, -0.15161338448524475, -0.16812501847743988, 0.05330902710556984, -0.30898377299308777, -0.09543175250291824, 0.05237759277224541, -0.13823138177394867, -0.03312110900878906, 0.06597805768251419, 0.1717359721660614, 0.25217553973197937, -0.09045618772506714, 0.2720056176185608, 0.3626476228237152, -0.08884003758430481, -0.1811843365430832, 0.1679304838180542, -0.04959692060947418, 0.18924638628959656, 0.08701436221599579, 0.030043374747037888, -0.026644110679626465, 0.5618736147880554, -0.19941499829292297, -0.29760557413101196, 0.41674524545669556, -0.20165914297103882, 0.21442939341068268, 0.09548889100551605, -0.18273907899856567, -0.04715120047330856, 0.6188604831695557, 0.053567491471767426, 0.3082994818687439, 0.2834073603153229, -0.05140083283185959, -0.10019102692604065, -0.17604275047779083, 0.19538986682891846, -0.26814088225364685, -0.07865068316459656, 0.11591577529907227, -0.10109684616327286, 0.4956245422363281, 0.023676477372646332, 0.12084779143333435, -0.4509139955043793, -0.34953343868255615, -0.10966645926237106, 0.1989327222108841, -0.1638619601726532, 0.02402404509484768, 0.16842427849769592, -0.06133030727505684, 0.00232502818107605, 0.1331370621919632, -0.21492546796798706, -0.3620027005672455, -0.43265923857688904, 0.1659102588891983, -0.33955687284469604, -0.09601716697216034, 0.1428631693124771, 0.17533473670482635, 0.19076606631278992, -0.016555268317461014, -0.09032205492258072, -0.15323927998542786, -0.13643169403076172, -0.08821158111095428, 0.11892158538103104, 0.18249067664146423, -0.1923733502626419, 0.06255984306335449, 0.11938212811946869, 0.11975039541721344, 0.22742974758148193, 0.14016193151474, 0.06562419980764389, 0.03295520693063736, -0.2124779224395752, 0.16558738052845, 0.5105963945388794, -0.3210776150226593, -0.22006601095199585, -0.024272870272397995, -0.04901944845914841, 0.32202818989753723, 0.14116886258125305, 0.11369116604328156, -0.17969729006290436, -0.06916399300098419, 0.07585763931274414, 0.4360937476158142, -0.1276215761899948, -0.12453573942184448, -0.24383454024791718, -0.012035062536597252, 0.5701443552970886, 0.05647395923733711, -0.21421201527118683, 0.187612846493721, -0.20458659529685974, -0.08865498006343842, 0.11751217395067215, -0.16936062276363373, -0.013500049710273743, 0.19710636138916016, 0.46563130617141724, 0.23429538309574127, 0.030714694410562515, -0.32286956906318665, -0.7312206029891968, 0.20473387837409973, 0.3624815344810486, 0.046015866100788116, -0.11187347769737244, -0.22518537938594818, 0.09277821332216263, -0.27220550179481506, 0.03740151599049568, 0.45138391852378845, 0.12341625988483429, -0.05375640094280243, -0.15482337772846222, -0.3383498191833496, -0.27867624163627625, 0.3146995007991791, -0.2048642635345459, 0.07219170033931732, -0.04262525960803032, 0.2516041696071625, 0.0878051295876503, 0.05679396912455559, -0.29749903082847595, 0.3242848515510559, 0.18610379099845886, 0.11512332409620285, -0.23683485388755798, 0.23452335596084595, 0.27478495240211487, -0.3173447251319885, -0.3310237526893616, -0.1724449247121811, -0.2901165783405304, -0.04503761976957321, -0.3277679681777954, 0.3391987681388855, 0.06359938532114029, -0.166072815656662, -0.0533452033996582, 0.3756221532821655, 0.15453313291072845, 0.35385701060295105, -0.22239260375499725, 0.20757438242435455, 0.25906747579574585, -0.24190576374530792, -0.12351733446121216, -0.5416694283485413, 0.055830758064985275, 0.05078359693288803, -0.019473783671855927, 0.23560740053653717, -0.7419503927230835, 0.1443224847316742, 0.06567667424678802, 0.25671377778053284, -0.02671123296022415, 0.1275160014629364, 0.1668253391981125, 0.19283413887023926, -0.14367912709712982, -0.020909227430820465, 0.3467642664909363, 0.14431965351104736, -0.1547931730747223, 0.2055204212665558, -0.06568566709756851, 0.005562314763665199, 0.10539291799068451, 0.16075202822685242, -0.2717757225036621, 0.3692610561847687, 0.46944278478622437, 0.32527655363082886, -0.011696573346853256, -0.11287689208984375, 0.06547658890485764, -0.03367019444704056, -0.4442005455493927, 0.023195484653115273, -0.41217389702796936, -0.07726658880710602, -0.004004162736237049, -0.5158283710479736, -0.16678036749362946, -0.428936630487442, -0.02390323206782341, 0.21031039953231812, -0.4653624892234802, 0.11029885709285736, -0.278810977935791, 0.19596487283706665, -0.04313506931066513, -0.5006077289581299, -0.09751304984092712, -0.05286789685487747, -0.052920855581760406, 0.03707676753401756, 0.21382470428943634, -0.13960306346416473, -0.06540290266275406, -0.22551053762435913, -0.16930097341537476, 0.026404179632663727, -0.2979768216609955, -0.03584742546081543, -0.22614167630672455, -0.027536502107977867, 0.205837219953537, 0.0184146910905838, 0.1452120691537857, -0.2372668832540512, 0.41183385252952576, 0.6605141162872314, -0.39131858944892883, 0.6667752861976624, 0.17420996725559235, -0.4476846158504486, -0.3174822926521301, -0.12270133942365646, -0.04935324937105179, -0.19018462300300598, 0.1274612843990326, -0.19155210256576538, 0.19233234226703644, 0.46560001373291016, 0.06189553067088127, -0.3465135395526886, 0.16486726701259613, 0.03285661339759827, -0.18224851787090302, -0.032130174338817596, 0.5443512797355652, 0.0811331570148468, -0.2659842073917389, 0.018581803888082504, -0.002190191298723221, -0.07291761040687561, 0.0818430632352829, 0.010210685431957245, -0.06457562744617462, -0.27529749274253845, 0.44326868653297424, -0.15739575028419495, -0.16708165407180786, 0.1317141354084015, 0.4371335208415985, 0.05857306718826294, 0.026792943477630615, 0.01974502205848694, 0.11124928295612335, 0.48165395855903625, 0.12511679530143738, -0.08397367596626282, -0.05431541055440903, -0.11375799775123596, -0.01873806118965149, 0.4010939598083496, -0.1857876181602478, 0.1886005401611328, 0.0038300398737192154, 0.4126427173614502, -0.17880776524543762, -0.4062066972255707, -0.20056019723415375, 0.045643098652362823, -0.1346326470375061, -0.15578244626522064, -0.1539994776248932, 0.17410525679588318, -0.16593430936336517, 0.2543945014476776, -0.01043473556637764, -0.1768471747636795, 0.0783010944724083, -0.3746103346347809, 0.02400677651166916, 0.04191816225647926, 0.040428705513477325, -0.25253012776374817, -0.19716483354568481, -0.05412479490041733, 0.33074602484703064, -0.021570652723312378, -0.025977687910199165, -0.3143923282623291, -0.2409958839416504, 0.22622111439704895, 0.3108874559402466, 0.21811442077159882, 0.5360287427902222, 0.15770143270492554, -0.2097238004207611, -0.18464650213718414, 0.1139969453215599, 0.25727248191833496, 0.0005624424666166306, -0.09243687987327576, 0.38597673177719116, 0.21732044219970703, -0.1832357496023178, -0.43121030926704407, -0.12374335527420044, 0.02301013097167015, 0.09243699908256531, 0.5203214883804321, -0.2404821217060089, 0.01172470860183239, 0.0036025401204824448, 0.425340473651886, -0.09671640396118164, -0.3384753465652466, -0.07785861939191818, 0.01700698956847191, 0.07323624938726425, -0.0781426653265953, 0.3779953718185425, 0.521573007106781, 0.019177967682480812, -0.05771476775407791, -0.20095643401145935, -0.31417039036750793, 0.24337102472782135, -0.06907007098197937, 0.4201454520225525, -0.3197689354419708, 0.29595065116882324, -0.35013100504875183, 0.049917519092559814, 0.07538910210132599, 0.6669101715087891, 0.45209550857543945, -0.5188495516777039, -0.20414826273918152, -0.19131186604499817, 0.4210087060928345, -0.07682228088378906, -0.11022064089775085, 0.3613285720348358, -0.3281197249889374, 0.05582533776760101, -0.14068150520324707, -0.05569852888584137, 0.3130202889442444, 0.026041239500045776, -0.06328395009040833, -0.16503369808197021, 0.07454103231430054, -0.11095315217971802, 0.009147830307483673, 0.4112471044063568, 0.3859800100326538, -0.04822378605604172, 0.2231910526752472, -0.14566099643707275, 0.716918408870697, 0.6535355448722839, -0.2633401155471802, 0.09522176533937454, -0.2947368919849396, 0.4319934546947479, 0.14401103556156158, 0.19219663739204407, -0.1442125141620636, -0.2325766533613205, -0.11785948276519775, -0.04623468220233917, -0.03915555775165558, -0.16951721906661987, -0.23247574269771576, 0.20274865627288818, -0.5918864607810974, 0.7352206707000732, 0.06437308341264725, -0.01055237278342247, 0.17781290411949158, -0.09203173220157623, -0.10559801757335663, -0.018467433750629425, 0.18999150395393372, 0.10361464321613312, -0.06262257695198059, -0.09294939041137695, -0.21141405403614044, -0.2655004858970642, -0.46344494819641113, 0.44479137659072876, 0.0733511745929718, 0.12422037869691849, 0.35057559609413147, -0.10861144959926605, 0.22238487005233765, 0.5134228467941284, 0.27812284231185913, 0.22599007189273834, -0.15998107194900513, -0.15153156220912933, 0.07871904969215393, 0.23449915647506714, -0.12750521302223206, -0.13015802204608917, 0.2208544760942459, 0.05462777614593506, -0.2724883258342743, -0.022498562932014465, -0.06214214116334915, 0.06621973216533661, -0.179811492562294, -0.201345756649971, -0.21326254308223724, -0.44109776616096497, -0.10220760107040405, -0.09448191523551941, 0.2987153232097626, -0.16200074553489685, 0.05722266063094139, 0.0026755183935165405, 0.012945631518959999, 0.08033038675785065, 0.00608372688293457, -0.1890239417552948, 0.039957258850336075, 0.2742312550544739, 0.1973738670349121, 0.26748549938201904, 0.5607527494430542, -0.0992688313126564, -0.06301642209291458, -0.06329227983951569, -0.07497508078813553, -0.34678539633750916, -0.005550287663936615, 0.06137806177139282, -0.11907443404197693, -0.13947826623916626, -0.04197193682193756, 0.3526141941547394, 0.12183226644992828, 0.17532390356063843, -0.22850991785526276, -0.32842910289764404, -0.1397482007741928, 0.11945801228284836, 0.12214015424251556, -0.05540361627936363, -0.2768087387084961, 0.3592524826526642, -0.049553629010915756, -0.0024533867835998535, -0.20549926161766052, -0.2899847626686096, -0.0308606568723917, 0.029754087328910828, 0.1266179382801056, 0.0803249403834343, 0.24730144441127777, -0.3778613805770874, 0.11686593294143677, -0.12718388438224792, 0.0635165423154831, -0.10185250639915466, -0.26973608136177063, 0.16782258450984955, 0.3819527328014374, 0.11278845369815826, -0.08486838638782501, -0.056145139038562775, 0.08476002514362335, -0.23094762861728668, -0.2253485769033432, 0.3103155195713043, -0.16739554703235626, 0.5129708647727966, -0.06360654532909393, 0.3588427007198334, -0.33516812324523926, 0.1492312252521515, 0.08000798523426056, -0.13566894829273224, -0.20030415058135986, -0.10976508259773254, -0.15135104954242706, 0.04039403796195984, -0.2341260015964508, 0.024747110903263092, -0.10859154164791107, -0.009193912148475647, 0.1944730579853058, -0.18704135715961456, 0.06732548773288727, -0.08807176351547241, 0.21159367263317108, 0.4163423478603363, 0.08896978944540024, -0.05027077719569206, 0.09420318901538849, 0.12834644317626953, -0.3473838269710541, -0.14833447337150574, 0.09582297503948212, 0.36323776841163635, 0.025829602032899857, 0.1356610208749771, 0.124967560172081, -0.2788292467594147, -0.18920005857944489, -0.053166694939136505, 0.3162437081336975, 0.17579041421413422, 0.33165523409843445, 0.5378014445304871, 0.1015281230211258, 0.23594239354133606, 0.06337302178144455, -0.03796287998557091, -0.034524835646152496, 0.31552720069885254, 0.27442556619644165, -0.13673144578933716, 0.37352854013442993, -0.24390864372253418, 0.07932597398757935, -0.14280012249946594, 0.4710075259208679, 0.11626771837472916, 0.48202306032180786, 0.073375403881073, 0.20993949472904205, -0.03636710345745087, -0.20227967202663422, -0.38349539041519165, -0.27953243255615234, -0.10871453583240509, -0.2663743197917938, 0.0916735976934433, -0.1778763383626938, -0.14932870864868164, -0.14474669098854065, -0.34772539138793945, 0.10778466612100601, -0.04922536760568619, 0.3603116273880005, -0.053741127252578735, 0.041636738926172256, -0.19529679417610168, 0.18578189611434937, 0.38718467950820923, 0.45073410868644714, -0.4415925443172455, 0.15748870372772217, 0.22623662650585175, -0.11956854164600372, 0.3631419837474823, 0.2696790099143982, 0.29726120829582214, 0.5435131192207336, 0.004411260597407818, 0.03760639205574989, 0.11809101700782776, -0.22996823489665985, 0.09754113852977753, 0.13651075959205627, -0.4021996259689331, -0.30036190152168274, 0.13265365362167358, 0.10363148152828217, -0.14136725664138794, 0.364827960729599, -0.1525019109249115, 0.291125625371933, -0.5386605262756348, 0.420146107673645, 0.0763382762670517, -0.14949780702590942, 0.15206101536750793, -0.04077240079641342, 0.25741592049598694, -0.6759119033813477, 0.2652820646762848, 0.44720661640167236, 0.04857341945171356, 0.1368800848722458, 0.07079919427633286, 0.2004450261592865, 0.15002350509166718, 0.5890935063362122, -0.2726130187511444, -0.024827491492033005, 0.08077214658260345, -0.3605751097202301, 0.2826237976551056, -0.1455158144235611, -0.0566786490380764, 0.3761308193206787, 0.11875869333744049, 0.26122376322746277, 0.07844886183738708, 0.028819389641284943, 0.25123798847198486, -0.3393231928348541, -0.06017746031284332, -0.35117506980895996, -0.07767786085605621, -0.204851433634758, -0.24881184101104736, -0.06902378797531128, -0.2612821161746979, 0.1814180165529251, 0.15983757376670837, 0.1416015923023224, -0.028866097331047058, -0.11533086001873016, 0.03588884696364403, 0.07935242354869843, -0.11586517095565796, 0.2722133994102478, 0.362447589635849, -0.03571862727403641, -0.11867798119783401, -0.07178942859172821, -0.05951262637972832, -0.4257059693336487, 0.3827376365661621, -0.19036778807640076, 0.15982837975025177, -0.03790813684463501, 0.28046274185180664, 0.03098963387310505, 0.031701747328042984, 0.1089445948600769, 0.0886712521314621, -0.4139707386493683, 0.5248034000396729, -0.373647540807724, 0.009596596471965313, -0.12216504663228989, 0.11189262568950653, 0.08609631657600403, 0.15266075730323792, -0.1405399739742279, -0.5699788928031921, 0.16644659638404846, 0.0046975864097476006, -0.3122806251049042, -0.17423230409622192, 0.09573117643594742, 0.33372244238853455, 0.2056403011083603, -0.3935917913913727, -0.2890397608280182, 0.30505019426345825, -0.18971297144889832, 0.2157483547925949, -0.17477825284004211, 0.17782141268253326, -0.15184561908245087, -0.1262330412864685, 0.37988707423210144, -0.180555522441864, 0.000338185578584671, 0.050458308309316635, -0.013319447636604309 ]
https://github.com/huggingface/datasets/issues/6466
Can't align optional features of struct
Thanks for the PR! I'm struggling with this as well and would love to see this PR merged. My case is slightly different, with keys completely missing rather than being `None`: ``` ds = Dataset.from_dict({'speaker': [{'name': 'Ben'}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) print(concatenate_datasets([ds, ds2]).features) print(concatenate_datasets([ds, ds2]).to_dict()) ``` I would expect this to work as well because other Dataset functions already handle this situation well. For example, this works just as expected: ``` ds = Dataset.from_dict({'n': [1,2]}) ds_mapped = ds.map(lambda x: { 'speaker': {'name': 'Ben'} if x['n'] == 1 else {'name': 'Fred', 'email': 'abc@aol.com'} }) print(ds_mapped) ```
### Describe the bug Hello! I'm currently experiencing an issue where I can't concatenate datasets if an inner field of a Feature is Optional. I have a column named `speaker`, and this holds some information about a speaker. ```python @dataclass class Speaker: name: str email: Optional[str] ``` If I have two datasets, one happens to have `email` always None, then I get `The features can't be aligned because the key email of features` ### Steps to reproduce the bug You can run the following script: ```python ds = Dataset.from_dict({'speaker': [{'name': 'Ben', 'email': None}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) concatenate_datasets([ds, ds2]) >>>The features can't be aligned because the key speaker of features {'speaker': {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)}} has unexpected type - {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)} (expected either {'email': Value(dtype='null', id=None), 'name': Value(dtype='string', id=None)} or Value("null"). ``` ### Expected behavior I think this should work; if two top-level columns were in the same situation it would properly cast to `string`. ```python ds = Dataset.from_dict({'email': [None, None]}) ds2 = Dataset.from_dict({'email': ['abc@aol.com', 'one@yahoo.com']}) concatenate_datasets([ds, ds2]) >>> # Works! ``` ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35 - Python version: 3.9.13 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 - `fsspec` version: 2023.6.0 I would be happy to fix this issue.
98
Can't align optional features of struct ### Describe the bug Hello! I'm currently experiencing an issue where I can't concatenate datasets if an inner field of a Feature is Optional. I have a column named `speaker`, and this holds some information about a speaker. ```python @dataclass class Speaker: name: str email: Optional[str] ``` If I have two datasets, one happens to have `email` always None, then I get `The features can't be aligned because the key email of features` ### Steps to reproduce the bug You can run the following script: ```python ds = Dataset.from_dict({'speaker': [{'name': 'Ben', 'email': None}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) concatenate_datasets([ds, ds2]) >>>The features can't be aligned because the key speaker of features {'speaker': {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)}} has unexpected type - {'email': Value(dtype='string', id=None), 'name': Value(dtype='string', id=None)} (expected either {'email': Value(dtype='null', id=None), 'name': Value(dtype='string', id=None)} or Value("null"). ``` ### Expected behavior I think this should work; if two top-level columns were in the same situation it would properly cast to `string`. ```python ds = Dataset.from_dict({'email': [None, None]}) ds2 = Dataset.from_dict({'email': ['abc@aol.com', 'one@yahoo.com']}) concatenate_datasets([ds, ds2]) >>> # Works! ``` ### Environment info - `datasets` version: 2.15.1.dev0 - Platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35 - Python version: 3.9.13 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.4.4 - `fsspec` version: 2023.6.0 I would be happy to fix this issue. Thanks for the PR! I'm struggling with this as well and would love to see this PR merged. My case is slightly different, with keys completely missing rather than being `None`: ``` ds = Dataset.from_dict({'speaker': [{'name': 'Ben'}]}) ds2 = Dataset.from_dict({'speaker': [{'name': 'Fred', 'email': 'abc@aol.com'}]}) print(concatenate_datasets([ds, ds2]).features) print(concatenate_datasets([ds, ds2]).to_dict()) ``` I would expect this to work as well because other Dataset functions already handle this situation well. For example, this works just as expected: ``` ds = Dataset.from_dict({'n': [1,2]}) ds_mapped = ds.map(lambda x: { 'speaker': {'name': 'Ben'} if x['n'] == 1 else {'name': 'Fred', 'email': 'abc@aol.com'} }) print(ds_mapped) ```
[ 0.05887921527028084, -0.32638096809387207, 0.1339402198791504, 0.23355932533740997, 0.21374790370464325, 0.14838314056396484, 0.1363566368818283, 0.0305489432066679, -0.12449480593204498, -0.01858857274055481, 0.08468348532915115, 0.02271345630288124, 0.10085220634937286, 0.24634630978107452, -0.7380690574645996, -0.053196340799331665, 0.1208876222372055, 0.11724138259887695, 0.02780875936150551, -0.07556430995464325, -0.0332350879907608, 0.20948144793510437, -0.37742626667022705, -0.20419125258922577, -0.20557938516139984, 0.22163844108581543, -0.12999798357486725, -0.01495739072561264, 0.1112603023648262, 0.11424943059682846, 0.4427764117717743, 0.08451101928949356, -0.24581141769886017, 0.1434725672006607, -0.00012169573892606422, 0.10539336502552032, 0.3147260546684265, -0.04143800958991051, -0.3637579083442688, -0.238414004445076, -0.3983522057533264, -0.2557165026664734, -0.11032594740390778, -0.15653449296951294, -0.07477404177188873, -0.20277489721775055, -0.1285906732082367, -0.24067270755767822, -0.023443058133125305, -0.01224602572619915, 0.10695500671863556, 0.34622839093208313, 0.19975058734416962, -0.15650564432144165, -0.1156843975186348, 0.4340174198150635, -0.11877685785293579, -0.4476948380470276, -0.42575016617774963, 0.12698666751384735, 0.613505482673645, -0.030933422967791557, -0.08562014251947403, -0.3964955508708954, 0.09671254456043243, 0.277650386095047, -0.38695403933525085, -0.1880163848400116, 0.04884030669927597, 0.24747878313064575, 0.7935325503349304, -0.0435057058930397, -0.38832417130470276, -0.14090865850448608, 0.06637342274188995, 0.029881658032536507, 0.28010106086730957, 0.053901441395282745, 0.13674256205558777, 0.20156259834766388, 0.15951527655124664, 0.27005574107170105, -0.028183843940496445, 0.16744913160800934, -0.026981119066476822, 0.06546178460121155, 0.019827064126729965, -0.04542500525712967, -0.4781768321990967, -0.3012455105781555, -0.27952730655670166, -0.35956403613090515, -0.2635989785194397, 0.16236738860607147, -0.15161338448524475, -0.16812501847743988, 0.05330902710556984, -0.30898377299308777, -0.09543175250291824, 0.05237759277224541, -0.13823138177394867, -0.03312110900878906, 0.06597805768251419, 0.1717359721660614, 0.25217553973197937, -0.09045618772506714, 0.2720056176185608, 0.3626476228237152, -0.08884003758430481, -0.1811843365430832, 0.1679304838180542, -0.04959692060947418, 0.18924638628959656, 0.08701436221599579, 0.030043374747037888, -0.026644110679626465, 0.5618736147880554, -0.19941499829292297, -0.29760557413101196, 0.41674524545669556, -0.20165914297103882, 0.21442939341068268, 0.09548889100551605, -0.18273907899856567, -0.04715120047330856, 0.6188604831695557, 0.053567491471767426, 0.3082994818687439, 0.2834073603153229, -0.05140083283185959, -0.10019102692604065, -0.17604275047779083, 0.19538986682891846, -0.26814088225364685, -0.07865068316459656, 0.11591577529907227, -0.10109684616327286, 0.4956245422363281, 0.023676477372646332, 0.12084779143333435, -0.4509139955043793, -0.34953343868255615, -0.10966645926237106, 0.1989327222108841, -0.1638619601726532, 0.02402404509484768, 0.16842427849769592, -0.06133030727505684, 0.00232502818107605, 0.1331370621919632, -0.21492546796798706, -0.3620027005672455, -0.43265923857688904, 0.1659102588891983, -0.33955687284469604, -0.09601716697216034, 0.1428631693124771, 0.17533473670482635, 0.19076606631278992, -0.016555268317461014, -0.09032205492258072, -0.15323927998542786, -0.13643169403076172, -0.08821158111095428, 0.11892158538103104, 0.18249067664146423, -0.1923733502626419, 0.06255984306335449, 0.11938212811946869, 0.11975039541721344, 0.22742974758148193, 0.14016193151474, 0.06562419980764389, 0.03295520693063736, -0.2124779224395752, 0.16558738052845, 0.5105963945388794, -0.3210776150226593, -0.22006601095199585, -0.024272870272397995, -0.04901944845914841, 0.32202818989753723, 0.14116886258125305, 0.11369116604328156, -0.17969729006290436, -0.06916399300098419, 0.07585763931274414, 0.4360937476158142, -0.1276215761899948, -0.12453573942184448, -0.24383454024791718, -0.012035062536597252, 0.5701443552970886, 0.05647395923733711, -0.21421201527118683, 0.187612846493721, -0.20458659529685974, -0.08865498006343842, 0.11751217395067215, -0.16936062276363373, -0.013500049710273743, 0.19710636138916016, 0.46563130617141724, 0.23429538309574127, 0.030714694410562515, -0.32286956906318665, -0.7312206029891968, 0.20473387837409973, 0.3624815344810486, 0.046015866100788116, -0.11187347769737244, -0.22518537938594818, 0.09277821332216263, -0.27220550179481506, 0.03740151599049568, 0.45138391852378845, 0.12341625988483429, -0.05375640094280243, -0.15482337772846222, -0.3383498191833496, -0.27867624163627625, 0.3146995007991791, -0.2048642635345459, 0.07219170033931732, -0.04262525960803032, 0.2516041696071625, 0.0878051295876503, 0.05679396912455559, -0.29749903082847595, 0.3242848515510559, 0.18610379099845886, 0.11512332409620285, -0.23683485388755798, 0.23452335596084595, 0.27478495240211487, -0.3173447251319885, -0.3310237526893616, -0.1724449247121811, -0.2901165783405304, -0.04503761976957321, -0.3277679681777954, 0.3391987681388855, 0.06359938532114029, -0.166072815656662, -0.0533452033996582, 0.3756221532821655, 0.15453313291072845, 0.35385701060295105, -0.22239260375499725, 0.20757438242435455, 0.25906747579574585, -0.24190576374530792, -0.12351733446121216, -0.5416694283485413, 0.055830758064985275, 0.05078359693288803, -0.019473783671855927, 0.23560740053653717, -0.7419503927230835, 0.1443224847316742, 0.06567667424678802, 0.25671377778053284, -0.02671123296022415, 0.1275160014629364, 0.1668253391981125, 0.19283413887023926, -0.14367912709712982, -0.020909227430820465, 0.3467642664909363, 0.14431965351104736, -0.1547931730747223, 0.2055204212665558, -0.06568566709756851, 0.005562314763665199, 0.10539291799068451, 0.16075202822685242, -0.2717757225036621, 0.3692610561847687, 0.46944278478622437, 0.32527655363082886, -0.011696573346853256, -0.11287689208984375, 0.06547658890485764, -0.03367019444704056, -0.4442005455493927, 0.023195484653115273, -0.41217389702796936, -0.07726658880710602, -0.004004162736237049, -0.5158283710479736, -0.16678036749362946, -0.428936630487442, -0.02390323206782341, 0.21031039953231812, -0.4653624892234802, 0.11029885709285736, -0.278810977935791, 0.19596487283706665, -0.04313506931066513, -0.5006077289581299, -0.09751304984092712, -0.05286789685487747, -0.052920855581760406, 0.03707676753401756, 0.21382470428943634, -0.13960306346416473, -0.06540290266275406, -0.22551053762435913, -0.16930097341537476, 0.026404179632663727, -0.2979768216609955, -0.03584742546081543, -0.22614167630672455, -0.027536502107977867, 0.205837219953537, 0.0184146910905838, 0.1452120691537857, -0.2372668832540512, 0.41183385252952576, 0.6605141162872314, -0.39131858944892883, 0.6667752861976624, 0.17420996725559235, -0.4476846158504486, -0.3174822926521301, -0.12270133942365646, -0.04935324937105179, -0.19018462300300598, 0.1274612843990326, -0.19155210256576538, 0.19233234226703644, 0.46560001373291016, 0.06189553067088127, -0.3465135395526886, 0.16486726701259613, 0.03285661339759827, -0.18224851787090302, -0.032130174338817596, 0.5443512797355652, 0.0811331570148468, -0.2659842073917389, 0.018581803888082504, -0.002190191298723221, -0.07291761040687561, 0.0818430632352829, 0.010210685431957245, -0.06457562744617462, -0.27529749274253845, 0.44326868653297424, -0.15739575028419495, -0.16708165407180786, 0.1317141354084015, 0.4371335208415985, 0.05857306718826294, 0.026792943477630615, 0.01974502205848694, 0.11124928295612335, 0.48165395855903625, 0.12511679530143738, -0.08397367596626282, -0.05431541055440903, -0.11375799775123596, -0.01873806118965149, 0.4010939598083496, -0.1857876181602478, 0.1886005401611328, 0.0038300398737192154, 0.4126427173614502, -0.17880776524543762, -0.4062066972255707, -0.20056019723415375, 0.045643098652362823, -0.1346326470375061, -0.15578244626522064, -0.1539994776248932, 0.17410525679588318, -0.16593430936336517, 0.2543945014476776, -0.01043473556637764, -0.1768471747636795, 0.0783010944724083, -0.3746103346347809, 0.02400677651166916, 0.04191816225647926, 0.040428705513477325, -0.25253012776374817, -0.19716483354568481, -0.05412479490041733, 0.33074602484703064, -0.021570652723312378, -0.025977687910199165, -0.3143923282623291, -0.2409958839416504, 0.22622111439704895, 0.3108874559402466, 0.21811442077159882, 0.5360287427902222, 0.15770143270492554, -0.2097238004207611, -0.18464650213718414, 0.1139969453215599, 0.25727248191833496, 0.0005624424666166306, -0.09243687987327576, 0.38597673177719116, 0.21732044219970703, -0.1832357496023178, -0.43121030926704407, -0.12374335527420044, 0.02301013097167015, 0.09243699908256531, 0.5203214883804321, -0.2404821217060089, 0.01172470860183239, 0.0036025401204824448, 0.425340473651886, -0.09671640396118164, -0.3384753465652466, -0.07785861939191818, 0.01700698956847191, 0.07323624938726425, -0.0781426653265953, 0.3779953718185425, 0.521573007106781, 0.019177967682480812, -0.05771476775407791, -0.20095643401145935, -0.31417039036750793, 0.24337102472782135, -0.06907007098197937, 0.4201454520225525, -0.3197689354419708, 0.29595065116882324, -0.35013100504875183, 0.049917519092559814, 0.07538910210132599, 0.6669101715087891, 0.45209550857543945, -0.5188495516777039, -0.20414826273918152, -0.19131186604499817, 0.4210087060928345, -0.07682228088378906, -0.11022064089775085, 0.3613285720348358, -0.3281197249889374, 0.05582533776760101, -0.14068150520324707, -0.05569852888584137, 0.3130202889442444, 0.026041239500045776, -0.06328395009040833, -0.16503369808197021, 0.07454103231430054, -0.11095315217971802, 0.009147830307483673, 0.4112471044063568, 0.3859800100326538, -0.04822378605604172, 0.2231910526752472, -0.14566099643707275, 0.716918408870697, 0.6535355448722839, -0.2633401155471802, 0.09522176533937454, -0.2947368919849396, 0.4319934546947479, 0.14401103556156158, 0.19219663739204407, -0.1442125141620636, -0.2325766533613205, -0.11785948276519775, -0.04623468220233917, -0.03915555775165558, -0.16951721906661987, -0.23247574269771576, 0.20274865627288818, -0.5918864607810974, 0.7352206707000732, 0.06437308341264725, -0.01055237278342247, 0.17781290411949158, -0.09203173220157623, -0.10559801757335663, -0.018467433750629425, 0.18999150395393372, 0.10361464321613312, -0.06262257695198059, -0.09294939041137695, -0.21141405403614044, -0.2655004858970642, -0.46344494819641113, 0.44479137659072876, 0.0733511745929718, 0.12422037869691849, 0.35057559609413147, -0.10861144959926605, 0.22238487005233765, 0.5134228467941284, 0.27812284231185913, 0.22599007189273834, -0.15998107194900513, -0.15153156220912933, 0.07871904969215393, 0.23449915647506714, -0.12750521302223206, -0.13015802204608917, 0.2208544760942459, 0.05462777614593506, -0.2724883258342743, -0.022498562932014465, -0.06214214116334915, 0.06621973216533661, -0.179811492562294, -0.201345756649971, -0.21326254308223724, -0.44109776616096497, -0.10220760107040405, -0.09448191523551941, 0.2987153232097626, -0.16200074553489685, 0.05722266063094139, 0.0026755183935165405, 0.012945631518959999, 0.08033038675785065, 0.00608372688293457, -0.1890239417552948, 0.039957258850336075, 0.2742312550544739, 0.1973738670349121, 0.26748549938201904, 0.5607527494430542, -0.0992688313126564, -0.06301642209291458, -0.06329227983951569, -0.07497508078813553, -0.34678539633750916, -0.005550287663936615, 0.06137806177139282, -0.11907443404197693, -0.13947826623916626, -0.04197193682193756, 0.3526141941547394, 0.12183226644992828, 0.17532390356063843, -0.22850991785526276, -0.32842910289764404, -0.1397482007741928, 0.11945801228284836, 0.12214015424251556, -0.05540361627936363, -0.2768087387084961, 0.3592524826526642, -0.049553629010915756, -0.0024533867835998535, -0.20549926161766052, -0.2899847626686096, -0.0308606568723917, 0.029754087328910828, 0.1266179382801056, 0.0803249403834343, 0.24730144441127777, -0.3778613805770874, 0.11686593294143677, -0.12718388438224792, 0.0635165423154831, -0.10185250639915466, -0.26973608136177063, 0.16782258450984955, 0.3819527328014374, 0.11278845369815826, -0.08486838638782501, -0.056145139038562775, 0.08476002514362335, -0.23094762861728668, -0.2253485769033432, 0.3103155195713043, -0.16739554703235626, 0.5129708647727966, -0.06360654532909393, 0.3588427007198334, -0.33516812324523926, 0.1492312252521515, 0.08000798523426056, -0.13566894829273224, -0.20030415058135986, -0.10976508259773254, -0.15135104954242706, 0.04039403796195984, -0.2341260015964508, 0.024747110903263092, -0.10859154164791107, -0.009193912148475647, 0.1944730579853058, -0.18704135715961456, 0.06732548773288727, -0.08807176351547241, 0.21159367263317108, 0.4163423478603363, 0.08896978944540024, -0.05027077719569206, 0.09420318901538849, 0.12834644317626953, -0.3473838269710541, -0.14833447337150574, 0.09582297503948212, 0.36323776841163635, 0.025829602032899857, 0.1356610208749771, 0.124967560172081, -0.2788292467594147, -0.18920005857944489, -0.053166694939136505, 0.3162437081336975, 0.17579041421413422, 0.33165523409843445, 0.5378014445304871, 0.1015281230211258, 0.23594239354133606, 0.06337302178144455, -0.03796287998557091, -0.034524835646152496, 0.31552720069885254, 0.27442556619644165, -0.13673144578933716, 0.37352854013442993, -0.24390864372253418, 0.07932597398757935, -0.14280012249946594, 0.4710075259208679, 0.11626771837472916, 0.48202306032180786, 0.073375403881073, 0.20993949472904205, -0.03636710345745087, -0.20227967202663422, -0.38349539041519165, -0.27953243255615234, -0.10871453583240509, -0.2663743197917938, 0.0916735976934433, -0.1778763383626938, -0.14932870864868164, -0.14474669098854065, -0.34772539138793945, 0.10778466612100601, -0.04922536760568619, 0.3603116273880005, -0.053741127252578735, 0.041636738926172256, -0.19529679417610168, 0.18578189611434937, 0.38718467950820923, 0.45073410868644714, -0.4415925443172455, 0.15748870372772217, 0.22623662650585175, -0.11956854164600372, 0.3631419837474823, 0.2696790099143982, 0.29726120829582214, 0.5435131192207336, 0.004411260597407818, 0.03760639205574989, 0.11809101700782776, -0.22996823489665985, 0.09754113852977753, 0.13651075959205627, -0.4021996259689331, -0.30036190152168274, 0.13265365362167358, 0.10363148152828217, -0.14136725664138794, 0.364827960729599, -0.1525019109249115, 0.291125625371933, -0.5386605262756348, 0.420146107673645, 0.0763382762670517, -0.14949780702590942, 0.15206101536750793, -0.04077240079641342, 0.25741592049598694, -0.6759119033813477, 0.2652820646762848, 0.44720661640167236, 0.04857341945171356, 0.1368800848722458, 0.07079919427633286, 0.2004450261592865, 0.15002350509166718, 0.5890935063362122, -0.2726130187511444, -0.024827491492033005, 0.08077214658260345, -0.3605751097202301, 0.2826237976551056, -0.1455158144235611, -0.0566786490380764, 0.3761308193206787, 0.11875869333744049, 0.26122376322746277, 0.07844886183738708, 0.028819389641284943, 0.25123798847198486, -0.3393231928348541, -0.06017746031284332, -0.35117506980895996, -0.07767786085605621, -0.204851433634758, -0.24881184101104736, -0.06902378797531128, -0.2612821161746979, 0.1814180165529251, 0.15983757376670837, 0.1416015923023224, -0.028866097331047058, -0.11533086001873016, 0.03588884696364403, 0.07935242354869843, -0.11586517095565796, 0.2722133994102478, 0.362447589635849, -0.03571862727403641, -0.11867798119783401, -0.07178942859172821, -0.05951262637972832, -0.4257059693336487, 0.3827376365661621, -0.19036778807640076, 0.15982837975025177, -0.03790813684463501, 0.28046274185180664, 0.03098963387310505, 0.031701747328042984, 0.1089445948600769, 0.0886712521314621, -0.4139707386493683, 0.5248034000396729, -0.373647540807724, 0.009596596471965313, -0.12216504663228989, 0.11189262568950653, 0.08609631657600403, 0.15266075730323792, -0.1405399739742279, -0.5699788928031921, 0.16644659638404846, 0.0046975864097476006, -0.3122806251049042, -0.17423230409622192, 0.09573117643594742, 0.33372244238853455, 0.2056403011083603, -0.3935917913913727, -0.2890397608280182, 0.30505019426345825, -0.18971297144889832, 0.2157483547925949, -0.17477825284004211, 0.17782141268253326, -0.15184561908245087, -0.1262330412864685, 0.37988707423210144, -0.180555522441864, 0.000338185578584671, 0.050458308309316635, -0.013319447636604309 ]
https://github.com/huggingface/datasets/issues/6460
jsonlines files don't load with `load_dataset`
Hi @serenalotreck, We use Apache Arrow `pyarrow` to read jsonlines and it throws an error when trying to load your data files: ```python In [1]: import pyarrow as pa In [2]: data = pa.json.read_json("train.jsonl") --------------------------------------------------------------------------- ArrowInvalid Traceback (most recent call last) <ipython-input-14-e9b104832528> in <module> ----> 1 data = pa.json.read_json("train.jsonl") .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json() .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 ``` I think it has to do with the data structure of the fields "ner" (and also "relations"): ```json "ner": [ [ [0, 4, "Biochemical_process"], [15, 16, "Protein"] ], ``` Arrow interprets this data structure as an array, an arrays contain just a single data type: - when reading sequentially, it finds first the `0` and infers that the data is of type `number`; - when it finds the string `"Biochemical_process"`, it cannot cast it to number and throws the `ArrowInvalid` error One solution could be to change the data structure of your data files. Any other ideas, @huggingface/datasets ?
### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5
171
jsonlines files don't load with `load_dataset` ### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5 Hi @serenalotreck, We use Apache Arrow `pyarrow` to read jsonlines and it throws an error when trying to load your data files: ```python In [1]: import pyarrow as pa In [2]: data = pa.json.read_json("train.jsonl") --------------------------------------------------------------------------- ArrowInvalid Traceback (most recent call last) <ipython-input-14-e9b104832528> in <module> ----> 1 data = pa.json.read_json("train.jsonl") .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json() .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() .../huggingface/datasets/venv/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 ``` I think it has to do with the data structure of the fields "ner" (and also "relations"): ```json "ner": [ [ [0, 4, "Biochemical_process"], [15, 16, "Protein"] ], ``` Arrow interprets this data structure as an array, an arrays contain just a single data type: - when reading sequentially, it finds first the `0` and infers that the data is of type `number`; - when it finds the string `"Biochemical_process"`, it cannot cast it to number and throws the `ArrowInvalid` error One solution could be to change the data structure of your data files. Any other ideas, @huggingface/datasets ?
[ -0.23013778030872345, 0.12285789847373962, -0.04837002605199814, 0.44046550989151, 0.2559809386730194, 0.03217126429080963, 0.19228461384773254, 0.19167602062225342, 0.2536107003688812, -0.10145920515060425, 0.21212731301784515, 0.38886600732803345, -0.19203750789165497, 0.3685356080532074, -0.011028236709535122, -0.14814956486225128, 0.004168793559074402, 0.08705297857522964, -0.06175565719604492, 0.0658518522977829, -0.2930653989315033, 0.4825318157672882, -0.1257709264755249, -0.2876797318458557, -0.33003658056259155, 0.20288699865341187, 0.15511536598205566, 0.3156035244464874, -0.2079012244939804, -0.3987046182155609, 0.35157549381256104, 0.04336966946721077, 0.1589081585407257, 0.5264840722084045, -0.0001143237532232888, 0.21673448383808136, 0.27660316228866577, -0.10340578109025955, -0.2854090631008148, -0.47449755668640137, -0.4354296028614044, -0.35923469066619873, 0.2056596875190735, -0.12188692390918732, 0.025597747415304184, -0.05712522938847542, -0.06398769468069077, -0.4945879578590393, 0.620658278465271, 0.29994556307792664, 0.2132384032011032, 0.4240158796310425, 0.20004580914974213, 0.006130576133728027, 0.1954740285873413, 0.31599241495132446, -0.08488216996192932, 0.5176390409469604, -0.01900678128004074, 0.3008069694042206, 0.052854280918836594, 0.09206686913967133, 0.06130719929933548, -0.13582712411880493, 0.3350379765033722, -0.01612403243780136, -0.33958250284194946, -0.049703486263751984, 0.0916493833065033, 0.2932741641998291, 0.28175392746925354, -0.17623484134674072, -0.3398975729942322, -0.5134028792381287, -0.0815391093492508, -0.31680935621261597, 0.5144974589347839, 0.006754542235285044, -0.029025070369243622, 0.10368940979242325, -0.2740059494972229, -0.16540935635566711, -0.07543505728244781, 0.05499521270394325, 0.02594834566116333, -0.20279687643051147, -0.2553956210613251, -0.009640589356422424, 0.16675935685634613, 0.015619440004229546, -0.20738528668880463, 0.10045038163661957, -0.2053886353969574, 0.22936701774597168, -0.12631911039352417, 0.16434334218502045, 0.03683217242360115, -0.3876156508922577, 0.3063931167125702, 0.32786357402801514, 0.06894217431545258, -0.05616734176874161, -0.3469131588935852, 0.0909804031252861, 0.31034618616104126, 0.22376593947410583, 0.08497157692909241, -0.16012147068977356, 0.20159514248371124, 0.3660426437854767, 0.00265604630112648, -0.13085803389549255, -0.16736875474452972, -0.08507009595632553, -0.23537863790988922, -0.1078358069062233, 0.27910488843917847, -0.1600480079650879, -0.16545166075229645, 0.17736583948135376, -0.30597421526908875, -0.2850099802017212, -0.002418489195406437, 0.28072163462638855, 0.01062800083309412, 0.24693003296852112, 0.234425887465477, 0.2308492511510849, 0.06152881681919098, -0.12820741534233093, -0.15346495807170868, -0.006010590121150017, -0.09311218559741974, 0.014515133574604988, 0.18436595797538757, -0.24471184611320496, 0.41176459193229675, 0.07668663561344147, -0.14603137969970703, -0.1822875738143921, -0.08000978082418442, 0.1019207090139389, -0.18536630272865295, 0.12262073159217834, 0.15326905250549316, 0.017455795779824257, 0.07108049094676971, -0.10697455704212189, -0.10262157022953033, 0.029737688601017, -0.3839438557624817, -0.026868220418691635, -0.14751389622688293, 0.1672704815864563, -0.28068602085113525, -0.06506884098052979, -0.6126501560211182, 0.024948623031377792, -0.1666679084300995, -0.03756767511367798, 0.12080421298742294, -0.032943084836006165, 0.10325722396373749, -0.1247980147600174, 0.33856216073036194, 0.38423097133636475, -0.36005011200904846, -0.24723826348781586, 0.14040599763393402, -0.2597774267196655, 0.15089592337608337, 0.20674709975719452, -0.16721168160438538, 0.15960514545440674, -0.35039904713630676, 0.2761918902397156, 0.29760482907295227, -0.08912905305624008, -0.2591823637485504, 0.30782076716423035, -0.08967970311641693, 0.44879430532455444, 0.0406963936984539, -0.1900867074728012, 0.12328926473855972, 0.17875465750694275, 0.18449907004833221, 0.23866939544677734, 0.21687395870685577, 0.14103367924690247, -0.11487790942192078, -0.26377448439598083, 0.1196662038564682, 0.21916012465953827, -0.1874096542596817, -0.008503474295139313, -0.006935611367225647, 0.18316705524921417, 0.3368963897228241, -0.009793732315301895, -0.11830583959817886, 0.27371281385421753, 0.014900106936693192, 0.18169361352920532, 0.017656786367297173, 0.02628738433122635, -0.7521730661392212, 0.08564125746488571, -0.10332726687192917, 0.003992743790149689, -0.2349569946527481, -0.07457500696182251, -0.2460048496723175, 0.1403312236070633, -0.2719948887825012, -0.2472585141658783, 0.08910121023654938, 0.14886066317558289, 0.19214500486850739, 0.23873181641101837, -0.4370036721229553, 0.2790202498435974, -0.0864042192697525, 0.27795925736427307, -0.5994994640350342, 0.358914852142334, 0.14002741873264313, -0.1287887841463089, 0.1456013023853302, 0.30551522970199585, -0.03188133239746094, -0.4063511788845062, -0.2225998044013977, 0.3179192841053009, 0.19522739946842194, 0.04171401262283325, -0.1144784465432167, 0.12583717703819275, 0.1418490707874298, -0.043150078505277634, -0.21936091780662537, 0.12255239486694336, 0.06070230156183243, -0.028398558497428894, -0.24975982308387756, 0.24245136976242065, -0.1279555708169937, 0.3297531008720398, 0.12965944409370422, -0.12854517996311188, 0.16678869724273682, 0.018570411950349808, -0.1791592389345169, -0.10798576474189758, 0.3472801446914673, 0.27593106031417847, 0.2687149941921234, 0.0479547418653965, -0.13796760141849518, -0.12867042422294617, 0.7998291850090027, 0.011514782905578613, 0.022404108196496964, 0.2738809287548065, -0.05506100505590439, -0.028032362461090088, 0.11604126542806625, 0.12667863070964813, 0.24430951476097107, 0.11296039819717407, 0.00046629831194877625, 0.1918676197528839, 0.0559629388153553, -0.29940667748451233, 0.18219783902168274, 0.013921938836574554, -0.013087984174489975, 0.20487099885940552, 0.07336357980966568, 0.0007958104833960533, -0.46591466665267944, -0.2463345229625702, -0.2551076412200928, 0.24762031435966492, -0.3513181507587433, 0.1053256019949913, -0.4553815424442291, -0.10145995765924454, -0.13359707593917847, -0.1713157743215561, -0.5278865694999695, -0.3669494092464447, -0.2872796654701233, 0.09322239458560944, -0.08492925763130188, -0.014864984899759293, -0.30367058515548706, 0.0477147251367569, -0.03381453827023506, -0.265848308801651, -0.2685377299785614, 0.06668202579021454, -0.27526482939720154, 0.050593916326761246, 0.4722769558429718, -0.05752667039632797, 0.10135581344366074, -0.19120408594608307, -0.004189483821392059, -0.08166032284498215, -0.142278254032135, 0.1732427477836609, -0.1922004073858261, 0.13219045102596283, 0.38801300525665283, 0.3611944913864136, -0.06921994686126709, -0.20282313227653503, 0.2469973862171173, 0.08447104692459106, -0.28275471925735474, -0.013778481632471085, 0.01872756890952587, 0.0442039929330349, -0.28457632660865784, -0.32959839701652527, 0.11776605248451233, -0.47015380859375, 0.7083844542503357, -0.05820886045694351, -0.024433113634586334, 0.22255797684192657, 0.05125180631875992, 0.4339563846588135, -0.06362131237983704, 0.06466331332921982, -0.1090082898736, -0.5038890838623047, 0.22995541989803314, -0.17091278731822968, -0.3370618522167206, 0.21572840213775635, 0.06013592332601547, 0.2619449496269226, -0.1713949292898178, -0.5283801555633545, 0.01704566180706024, -0.11507387459278107, 0.2520380914211273, -0.01783282309770584, -0.022387361153960228, 0.14861688017845154, -0.12039262801408768, 0.06434036046266556, -0.13338613510131836, -0.12681853771209717, 0.23692449927330017, -0.2452985942363739, 0.11890249699354172, 0.08820755779743195, 0.7091601490974426, -0.10506676137447357, -0.019287951290607452, 0.45038244128227234, 0.03413895145058632, 0.5685428380966187, -0.1224198117852211, 0.3633236289024353, -0.28498575091362, -0.20431871712207794, -0.15628565847873688, -0.009565398097038269, 0.07695227116346359, 0.05894232913851738, 0.27060452103614807, 0.2762213945388794, -0.22319947183132172, -0.006235755980014801, -0.27643150091171265, -0.22371746599674225, 0.1583409309387207, 0.05862141028046608, -0.059799693524837494, -0.17064329981803894, 0.08985594660043716, 0.09053196012973785, 0.09379050880670547, -0.01582147367298603, 0.3854542374610901, 0.3200932741165161, 0.062140606343746185, -0.6170750856399536, -0.0769263505935669, -0.45512956380844116, 0.21256670355796814, -0.0008016976062208414, 0.3278009295463562, -0.03177192807197571, 0.022857334464788437, 0.1429201364517212, -0.285889595746994, 0.7596274018287659, 0.14432430267333984, -0.10302472114562988, 0.1058456301689148, 0.1309521347284317, -0.3242335915565491, 0.12137891352176666, 0.10239279270172119, 0.12533928453922272, 0.5416638255119324, 0.34779155254364014, -0.3742675185203552, -0.1584194153547287, 0.26748180389404297, 0.09247159212827682, -0.004883140325546265, -0.2284339815378189, -0.2695276141166687, -0.4646669626235962, -0.2518210709095001, -0.18761977553367615, 0.019677365198731422, 0.37974515557289124, 0.024883387610316277, -0.15068769454956055, 0.1376418024301529, -0.5244578123092651, -0.006534852087497711, 0.2029689997434616, 0.28463155031204224, 0.025061791762709618, 0.09616243839263916, 0.26618993282318115, 0.2393568456172943, 0.20382007956504822, 0.890621542930603, -0.028678465634584427, -0.4815205931663513, 0.11623970419168472, -0.10777858644723892, 0.3585921823978424, 0.04334116727113724, -0.12591171264648438, 0.19073277711868286, 0.09482523798942566, 0.026218898594379425, -0.08432886004447937, 0.0616048164665699, 0.4022357165813446, -0.06341119855642319, -0.12312100827693939, -0.4914613366127014, 0.5422191023826599, 0.05723505839705467, 0.2537291646003723, 0.05092618614435196, 0.14018012583255768, -0.277653306722641, 0.10844002664089203, -0.2753247320652008, 0.6423538327217102, 0.23023772239685059, 0.08481418341398239, 0.5401000380516052, -0.25236040353775024, 0.5430934429168701, -0.3520500063896179, -0.13201968371868134, -0.1970752328634262, 0.23107707500457764, -0.05093416944146156, -0.0658595860004425, 0.20420366525650024, 0.045849137008190155, -0.00022299587726593018, 0.032780591398477554, -0.11402915418148041, -0.15768128633499146, -0.0647832378745079, 0.2883266508579254, -0.28750860691070557, -0.18755055963993073, -0.7293282151222229, 0.12413570284843445, 0.008849456906318665, 0.11464563012123108, 0.020087186247110367, -0.17837274074554443, -0.05251362547278404, -0.49953311681747437, -0.38229256868362427, 0.1961211860179901, -0.11122588068246841, -0.002521514892578125, 0.30984753370285034, 0.026110202074050903, 0.10153679549694061, 0.059270381927490234, 0.06978470087051392, -0.027186524122953415, -0.1405334323644638, 0.13423383235931396, -0.20487767457962036, -0.04980241134762764, 0.038937002420425415, 0.1748376488685608, 0.31119394302368164, -0.19448864459991455, -0.08234865963459015, 0.10696706920862198, -0.1796359121799469, -0.5056490898132324, 0.032945454120635986, 0.13498477637767792, -0.20140628516674042, -0.2556958794593811, -0.09878882765769958, 0.0903158187866211, 0.32325825095176697, -0.13904501497745514, 0.0934857726097107, 0.25758183002471924, 0.1364952176809311, -0.19692006707191467, 0.04765113443136215, -0.18601657450199127, -0.18724653124809265, 0.3263692557811737, -0.18657445907592773, -0.16152840852737427, 0.43610480427742004, 0.41048336029052734, -0.1037481501698494, -0.1357087939977646, 0.29059097170829773, 0.5397540926933289, -0.40356507897377014, 0.14552073180675507, 0.13160303235054016, 0.17106769979000092, -0.17542536556720734, 0.3037150502204895, 0.0702599287033081, -0.09148342162370682, 0.1755833774805069, -0.5147277116775513, -0.26948773860931396, 0.2200922667980194, 0.06453755497932434, 0.18047641217708588, 0.009424753487110138, -0.03210993856191635, -0.06146708130836487, -0.35326308012008667, -0.22663870453834534, 0.10511881858110428, -0.06065494567155838, -0.22680452466011047, 0.3242168724536896, -0.04880101978778839, 0.5696450471878052, -0.08598427474498749, 0.12475481629371643, 0.2021636962890625, -0.2130531519651413, -0.12668898701667786, -0.26283735036849976, 0.07942456752061844, 0.11579450964927673, -0.15912336111068726, -0.1464289277791977, 0.06171859800815582, -0.2524520754814148, -0.08139634877443314, 0.19060301780700684, -0.05501788854598999, -0.11013001203536987, 0.06642421334981918, 0.11531765758991241, 0.2109566032886505, -0.18661144375801086, 0.02849555015563965, 0.07861427962779999, 0.3585559129714966, 0.09000005573034286, -0.0009168796241283417, -0.21650715172290802, 0.14178815484046936, -0.24971310794353485, 0.14168183505535126, 0.13441398739814758, 0.1510830521583557, 0.2699749171733856, -0.40516358613967896, 0.04634678736329079, 0.1507667452096939, 0.1358170360326767, 0.46965062618255615, -0.19482608139514923, 0.15333136916160583, 0.07235699892044067, 0.12997819483280182, -0.0547226145863533, 0.01101150456815958, 0.2720224857330322, 0.18259060382843018, -0.04660507291555405, 0.04713834822177887, 0.00977126881480217, 0.04065714776515961, -0.054783716797828674, 0.08999709784984589, 0.3429553806781769, 0.28865861892700195, 0.35815516114234924, 0.19004176557064056, -0.21717821061611176, 0.11064117401838303, -0.14880739152431488, 0.06883294880390167, 0.2678269147872925, 0.16297364234924316, -0.19628608226776123, 0.22513921558856964, -0.2166925072669983, 0.0003031417727470398, -0.10241291671991348, -0.4691862165927887, -0.2391364425420761, 0.24166062474250793, -0.027743175625801086, 0.2785334587097168, -0.01797720044851303, 0.4557577967643738, -0.2643914520740509, -0.0005964045412838459, -0.3029399812221527, 0.18921317160129547, -0.11416781693696976, -0.1297789067029953, -0.12416522949934006, -0.19603465497493744, -0.35321417450904846, -0.03599293529987335, -0.08005140721797943, -0.004690535366535187, -0.08790417015552521, 0.008127756416797638, -0.14681334793567657, -0.30748599767684937, -0.08473917841911316, -0.08533825725317001, 0.007070720195770264, -0.10170114040374756, 0.43273934721946716, 0.32556772232055664, 0.0035315975546836853, 0.24888966977596283, 0.08397474884986877, 0.2945765256881714, 0.19170942902565002, 0.299259215593338, -0.2961865961551666, -0.2858143150806427, 0.0748608186841011, -0.08623235672712326, 0.4306855797767639, -0.13142836093902588, 0.06427880376577377, 0.1926906555891037, 0.15180110931396484, -0.16583631932735443, 0.1596222221851349, -0.060274701565504074, 0.36156532168388367, -0.3586384654045105, 0.32841113209724426, -0.45822250843048096, 0.15570595860481262, -0.2701035737991333, -0.17277315258979797, -0.27569395303726196, -0.33047428727149963, -0.016330592334270477, 0.11501313000917435, 0.0053809285163879395, -0.2639530897140503, 0.07579223811626434, -0.045516978949308395, 0.4670082926750183, 0.4941006898880005, 0.10765140503644943, 0.1612970232963562, -0.18902873992919922, -0.4919188618659973, -0.07742533832788467, -0.10267220437526703, 0.026653198525309563, 0.06530045717954636, -0.047930240631103516, -0.09341932088136673, 0.16448171436786652, 0.15160630643367767, 0.31479835510253906, -0.13506454229354858, -0.2298167645931244, -0.2712256610393524, -0.2077159732580185, 0.2582937479019165, -0.13965098559856415, -0.11483784765005112, -0.020067568868398666, 0.2209024578332901, -0.05054157227277756, -0.062183722853660583, -0.1317523568868637, 0.137021005153656, -0.24059158563613892, -0.12682794034481049, 0.3775871694087982, 0.2160317599773407, 0.3346262276172638, -0.10398761928081512, -0.3999274969100952, -0.44196617603302, -0.2367475926876068, -0.010187516920268536, 0.40269237756729126, -0.06943956017494202, 0.6453307867050171, -0.21400156617164612, -0.0774800032377243, -0.3579314053058624, 0.30400651693344116, -0.16625778377056122, -0.36099010705947876, -0.3295455873012543, 0.19439369440078735, -0.18369001150131226, 0.14065220952033997, 0.15356439352035522, 0.0857292041182518, -0.0981370359659195, 0.1669774055480957, -0.05500166118144989, -0.10481378436088562, 0.36187994480133057, -0.3540547490119934, -0.07478217780590057, 0.11728968471288681, -0.020389437675476074, 0.14139431715011597, -0.21345624327659607, -0.6122726202011108, 0.043801672756671906, 0.34976914525032043, 0.11156167834997177, -0.1511559635400772, 0.23207536339759827, -0.07119351625442505, -0.14250265061855316, -0.08314749598503113, 0.5256012082099915, 0.10403034090995789, -0.251539409160614, 0.5749450325965881, -0.08532562851905823 ]
https://github.com/huggingface/datasets/issues/6460
jsonlines files don't load with `load_dataset`
Hi @albertvillanova, Thanks for the explanation! To the best of my knowledge, arrays in a json [can contain multiple data types](https://docs.actian.com/ingres/11.2/index.html#page/SQLRef/Data_Types.htm), and I'm able to read these files with the `jsonlines` package. Is the requirement for arrays to only have one data type specific to PyArrow? I'd prefer to keep the data structure as is, since it's a specific input requirement for the models this data was generated for. Any thoughts on how to enable the use of `load_dataset` with this dataset would be great!
### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5
85
jsonlines files don't load with `load_dataset` ### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5 Hi @albertvillanova, Thanks for the explanation! To the best of my knowledge, arrays in a json [can contain multiple data types](https://docs.actian.com/ingres/11.2/index.html#page/SQLRef/Data_Types.htm), and I'm able to read these files with the `jsonlines` package. Is the requirement for arrays to only have one data type specific to PyArrow? I'd prefer to keep the data structure as is, since it's a specific input requirement for the models this data was generated for. Any thoughts on how to enable the use of `load_dataset` with this dataset would be great!
[ -0.23013778030872345, 0.12285789847373962, -0.04837002605199814, 0.44046550989151, 0.2559809386730194, 0.03217126429080963, 0.19228461384773254, 0.19167602062225342, 0.2536107003688812, -0.10145920515060425, 0.21212731301784515, 0.38886600732803345, -0.19203750789165497, 0.3685356080532074, -0.011028236709535122, -0.14814956486225128, 0.004168793559074402, 0.08705297857522964, -0.06175565719604492, 0.0658518522977829, -0.2930653989315033, 0.4825318157672882, -0.1257709264755249, -0.2876797318458557, -0.33003658056259155, 0.20288699865341187, 0.15511536598205566, 0.3156035244464874, -0.2079012244939804, -0.3987046182155609, 0.35157549381256104, 0.04336966946721077, 0.1589081585407257, 0.5264840722084045, -0.0001143237532232888, 0.21673448383808136, 0.27660316228866577, -0.10340578109025955, -0.2854090631008148, -0.47449755668640137, -0.4354296028614044, -0.35923469066619873, 0.2056596875190735, -0.12188692390918732, 0.025597747415304184, -0.05712522938847542, -0.06398769468069077, -0.4945879578590393, 0.620658278465271, 0.29994556307792664, 0.2132384032011032, 0.4240158796310425, 0.20004580914974213, 0.006130576133728027, 0.1954740285873413, 0.31599241495132446, -0.08488216996192932, 0.5176390409469604, -0.01900678128004074, 0.3008069694042206, 0.052854280918836594, 0.09206686913967133, 0.06130719929933548, -0.13582712411880493, 0.3350379765033722, -0.01612403243780136, -0.33958250284194946, -0.049703486263751984, 0.0916493833065033, 0.2932741641998291, 0.28175392746925354, -0.17623484134674072, -0.3398975729942322, -0.5134028792381287, -0.0815391093492508, -0.31680935621261597, 0.5144974589347839, 0.006754542235285044, -0.029025070369243622, 0.10368940979242325, -0.2740059494972229, -0.16540935635566711, -0.07543505728244781, 0.05499521270394325, 0.02594834566116333, -0.20279687643051147, -0.2553956210613251, -0.009640589356422424, 0.16675935685634613, 0.015619440004229546, -0.20738528668880463, 0.10045038163661957, -0.2053886353969574, 0.22936701774597168, -0.12631911039352417, 0.16434334218502045, 0.03683217242360115, -0.3876156508922577, 0.3063931167125702, 0.32786357402801514, 0.06894217431545258, -0.05616734176874161, -0.3469131588935852, 0.0909804031252861, 0.31034618616104126, 0.22376593947410583, 0.08497157692909241, -0.16012147068977356, 0.20159514248371124, 0.3660426437854767, 0.00265604630112648, -0.13085803389549255, -0.16736875474452972, -0.08507009595632553, -0.23537863790988922, -0.1078358069062233, 0.27910488843917847, -0.1600480079650879, -0.16545166075229645, 0.17736583948135376, -0.30597421526908875, -0.2850099802017212, -0.002418489195406437, 0.28072163462638855, 0.01062800083309412, 0.24693003296852112, 0.234425887465477, 0.2308492511510849, 0.06152881681919098, -0.12820741534233093, -0.15346495807170868, -0.006010590121150017, -0.09311218559741974, 0.014515133574604988, 0.18436595797538757, -0.24471184611320496, 0.41176459193229675, 0.07668663561344147, -0.14603137969970703, -0.1822875738143921, -0.08000978082418442, 0.1019207090139389, -0.18536630272865295, 0.12262073159217834, 0.15326905250549316, 0.017455795779824257, 0.07108049094676971, -0.10697455704212189, -0.10262157022953033, 0.029737688601017, -0.3839438557624817, -0.026868220418691635, -0.14751389622688293, 0.1672704815864563, -0.28068602085113525, -0.06506884098052979, -0.6126501560211182, 0.024948623031377792, -0.1666679084300995, -0.03756767511367798, 0.12080421298742294, -0.032943084836006165, 0.10325722396373749, -0.1247980147600174, 0.33856216073036194, 0.38423097133636475, -0.36005011200904846, -0.24723826348781586, 0.14040599763393402, -0.2597774267196655, 0.15089592337608337, 0.20674709975719452, -0.16721168160438538, 0.15960514545440674, -0.35039904713630676, 0.2761918902397156, 0.29760482907295227, -0.08912905305624008, -0.2591823637485504, 0.30782076716423035, -0.08967970311641693, 0.44879430532455444, 0.0406963936984539, -0.1900867074728012, 0.12328926473855972, 0.17875465750694275, 0.18449907004833221, 0.23866939544677734, 0.21687395870685577, 0.14103367924690247, -0.11487790942192078, -0.26377448439598083, 0.1196662038564682, 0.21916012465953827, -0.1874096542596817, -0.008503474295139313, -0.006935611367225647, 0.18316705524921417, 0.3368963897228241, -0.009793732315301895, -0.11830583959817886, 0.27371281385421753, 0.014900106936693192, 0.18169361352920532, 0.017656786367297173, 0.02628738433122635, -0.7521730661392212, 0.08564125746488571, -0.10332726687192917, 0.003992743790149689, -0.2349569946527481, -0.07457500696182251, -0.2460048496723175, 0.1403312236070633, -0.2719948887825012, -0.2472585141658783, 0.08910121023654938, 0.14886066317558289, 0.19214500486850739, 0.23873181641101837, -0.4370036721229553, 0.2790202498435974, -0.0864042192697525, 0.27795925736427307, -0.5994994640350342, 0.358914852142334, 0.14002741873264313, -0.1287887841463089, 0.1456013023853302, 0.30551522970199585, -0.03188133239746094, -0.4063511788845062, -0.2225998044013977, 0.3179192841053009, 0.19522739946842194, 0.04171401262283325, -0.1144784465432167, 0.12583717703819275, 0.1418490707874298, -0.043150078505277634, -0.21936091780662537, 0.12255239486694336, 0.06070230156183243, -0.028398558497428894, -0.24975982308387756, 0.24245136976242065, -0.1279555708169937, 0.3297531008720398, 0.12965944409370422, -0.12854517996311188, 0.16678869724273682, 0.018570411950349808, -0.1791592389345169, -0.10798576474189758, 0.3472801446914673, 0.27593106031417847, 0.2687149941921234, 0.0479547418653965, -0.13796760141849518, -0.12867042422294617, 0.7998291850090027, 0.011514782905578613, 0.022404108196496964, 0.2738809287548065, -0.05506100505590439, -0.028032362461090088, 0.11604126542806625, 0.12667863070964813, 0.24430951476097107, 0.11296039819717407, 0.00046629831194877625, 0.1918676197528839, 0.0559629388153553, -0.29940667748451233, 0.18219783902168274, 0.013921938836574554, -0.013087984174489975, 0.20487099885940552, 0.07336357980966568, 0.0007958104833960533, -0.46591466665267944, -0.2463345229625702, -0.2551076412200928, 0.24762031435966492, -0.3513181507587433, 0.1053256019949913, -0.4553815424442291, -0.10145995765924454, -0.13359707593917847, -0.1713157743215561, -0.5278865694999695, -0.3669494092464447, -0.2872796654701233, 0.09322239458560944, -0.08492925763130188, -0.014864984899759293, -0.30367058515548706, 0.0477147251367569, -0.03381453827023506, -0.265848308801651, -0.2685377299785614, 0.06668202579021454, -0.27526482939720154, 0.050593916326761246, 0.4722769558429718, -0.05752667039632797, 0.10135581344366074, -0.19120408594608307, -0.004189483821392059, -0.08166032284498215, -0.142278254032135, 0.1732427477836609, -0.1922004073858261, 0.13219045102596283, 0.38801300525665283, 0.3611944913864136, -0.06921994686126709, -0.20282313227653503, 0.2469973862171173, 0.08447104692459106, -0.28275471925735474, -0.013778481632471085, 0.01872756890952587, 0.0442039929330349, -0.28457632660865784, -0.32959839701652527, 0.11776605248451233, -0.47015380859375, 0.7083844542503357, -0.05820886045694351, -0.024433113634586334, 0.22255797684192657, 0.05125180631875992, 0.4339563846588135, -0.06362131237983704, 0.06466331332921982, -0.1090082898736, -0.5038890838623047, 0.22995541989803314, -0.17091278731822968, -0.3370618522167206, 0.21572840213775635, 0.06013592332601547, 0.2619449496269226, -0.1713949292898178, -0.5283801555633545, 0.01704566180706024, -0.11507387459278107, 0.2520380914211273, -0.01783282309770584, -0.022387361153960228, 0.14861688017845154, -0.12039262801408768, 0.06434036046266556, -0.13338613510131836, -0.12681853771209717, 0.23692449927330017, -0.2452985942363739, 0.11890249699354172, 0.08820755779743195, 0.7091601490974426, -0.10506676137447357, -0.019287951290607452, 0.45038244128227234, 0.03413895145058632, 0.5685428380966187, -0.1224198117852211, 0.3633236289024353, -0.28498575091362, -0.20431871712207794, -0.15628565847873688, -0.009565398097038269, 0.07695227116346359, 0.05894232913851738, 0.27060452103614807, 0.2762213945388794, -0.22319947183132172, -0.006235755980014801, -0.27643150091171265, -0.22371746599674225, 0.1583409309387207, 0.05862141028046608, -0.059799693524837494, -0.17064329981803894, 0.08985594660043716, 0.09053196012973785, 0.09379050880670547, -0.01582147367298603, 0.3854542374610901, 0.3200932741165161, 0.062140606343746185, -0.6170750856399536, -0.0769263505935669, -0.45512956380844116, 0.21256670355796814, -0.0008016976062208414, 0.3278009295463562, -0.03177192807197571, 0.022857334464788437, 0.1429201364517212, -0.285889595746994, 0.7596274018287659, 0.14432430267333984, -0.10302472114562988, 0.1058456301689148, 0.1309521347284317, -0.3242335915565491, 0.12137891352176666, 0.10239279270172119, 0.12533928453922272, 0.5416638255119324, 0.34779155254364014, -0.3742675185203552, -0.1584194153547287, 0.26748180389404297, 0.09247159212827682, -0.004883140325546265, -0.2284339815378189, -0.2695276141166687, -0.4646669626235962, -0.2518210709095001, -0.18761977553367615, 0.019677365198731422, 0.37974515557289124, 0.024883387610316277, -0.15068769454956055, 0.1376418024301529, -0.5244578123092651, -0.006534852087497711, 0.2029689997434616, 0.28463155031204224, 0.025061791762709618, 0.09616243839263916, 0.26618993282318115, 0.2393568456172943, 0.20382007956504822, 0.890621542930603, -0.028678465634584427, -0.4815205931663513, 0.11623970419168472, -0.10777858644723892, 0.3585921823978424, 0.04334116727113724, -0.12591171264648438, 0.19073277711868286, 0.09482523798942566, 0.026218898594379425, -0.08432886004447937, 0.0616048164665699, 0.4022357165813446, -0.06341119855642319, -0.12312100827693939, -0.4914613366127014, 0.5422191023826599, 0.05723505839705467, 0.2537291646003723, 0.05092618614435196, 0.14018012583255768, -0.277653306722641, 0.10844002664089203, -0.2753247320652008, 0.6423538327217102, 0.23023772239685059, 0.08481418341398239, 0.5401000380516052, -0.25236040353775024, 0.5430934429168701, -0.3520500063896179, -0.13201968371868134, -0.1970752328634262, 0.23107707500457764, -0.05093416944146156, -0.0658595860004425, 0.20420366525650024, 0.045849137008190155, -0.00022299587726593018, 0.032780591398477554, -0.11402915418148041, -0.15768128633499146, -0.0647832378745079, 0.2883266508579254, -0.28750860691070557, -0.18755055963993073, -0.7293282151222229, 0.12413570284843445, 0.008849456906318665, 0.11464563012123108, 0.020087186247110367, -0.17837274074554443, -0.05251362547278404, -0.49953311681747437, -0.38229256868362427, 0.1961211860179901, -0.11122588068246841, -0.002521514892578125, 0.30984753370285034, 0.026110202074050903, 0.10153679549694061, 0.059270381927490234, 0.06978470087051392, -0.027186524122953415, -0.1405334323644638, 0.13423383235931396, -0.20487767457962036, -0.04980241134762764, 0.038937002420425415, 0.1748376488685608, 0.31119394302368164, -0.19448864459991455, -0.08234865963459015, 0.10696706920862198, -0.1796359121799469, -0.5056490898132324, 0.032945454120635986, 0.13498477637767792, -0.20140628516674042, -0.2556958794593811, -0.09878882765769958, 0.0903158187866211, 0.32325825095176697, -0.13904501497745514, 0.0934857726097107, 0.25758183002471924, 0.1364952176809311, -0.19692006707191467, 0.04765113443136215, -0.18601657450199127, -0.18724653124809265, 0.3263692557811737, -0.18657445907592773, -0.16152840852737427, 0.43610480427742004, 0.41048336029052734, -0.1037481501698494, -0.1357087939977646, 0.29059097170829773, 0.5397540926933289, -0.40356507897377014, 0.14552073180675507, 0.13160303235054016, 0.17106769979000092, -0.17542536556720734, 0.3037150502204895, 0.0702599287033081, -0.09148342162370682, 0.1755833774805069, -0.5147277116775513, -0.26948773860931396, 0.2200922667980194, 0.06453755497932434, 0.18047641217708588, 0.009424753487110138, -0.03210993856191635, -0.06146708130836487, -0.35326308012008667, -0.22663870453834534, 0.10511881858110428, -0.06065494567155838, -0.22680452466011047, 0.3242168724536896, -0.04880101978778839, 0.5696450471878052, -0.08598427474498749, 0.12475481629371643, 0.2021636962890625, -0.2130531519651413, -0.12668898701667786, -0.26283735036849976, 0.07942456752061844, 0.11579450964927673, -0.15912336111068726, -0.1464289277791977, 0.06171859800815582, -0.2524520754814148, -0.08139634877443314, 0.19060301780700684, -0.05501788854598999, -0.11013001203536987, 0.06642421334981918, 0.11531765758991241, 0.2109566032886505, -0.18661144375801086, 0.02849555015563965, 0.07861427962779999, 0.3585559129714966, 0.09000005573034286, -0.0009168796241283417, -0.21650715172290802, 0.14178815484046936, -0.24971310794353485, 0.14168183505535126, 0.13441398739814758, 0.1510830521583557, 0.2699749171733856, -0.40516358613967896, 0.04634678736329079, 0.1507667452096939, 0.1358170360326767, 0.46965062618255615, -0.19482608139514923, 0.15333136916160583, 0.07235699892044067, 0.12997819483280182, -0.0547226145863533, 0.01101150456815958, 0.2720224857330322, 0.18259060382843018, -0.04660507291555405, 0.04713834822177887, 0.00977126881480217, 0.04065714776515961, -0.054783716797828674, 0.08999709784984589, 0.3429553806781769, 0.28865861892700195, 0.35815516114234924, 0.19004176557064056, -0.21717821061611176, 0.11064117401838303, -0.14880739152431488, 0.06883294880390167, 0.2678269147872925, 0.16297364234924316, -0.19628608226776123, 0.22513921558856964, -0.2166925072669983, 0.0003031417727470398, -0.10241291671991348, -0.4691862165927887, -0.2391364425420761, 0.24166062474250793, -0.027743175625801086, 0.2785334587097168, -0.01797720044851303, 0.4557577967643738, -0.2643914520740509, -0.0005964045412838459, -0.3029399812221527, 0.18921317160129547, -0.11416781693696976, -0.1297789067029953, -0.12416522949934006, -0.19603465497493744, -0.35321417450904846, -0.03599293529987335, -0.08005140721797943, -0.004690535366535187, -0.08790417015552521, 0.008127756416797638, -0.14681334793567657, -0.30748599767684937, -0.08473917841911316, -0.08533825725317001, 0.007070720195770264, -0.10170114040374756, 0.43273934721946716, 0.32556772232055664, 0.0035315975546836853, 0.24888966977596283, 0.08397474884986877, 0.2945765256881714, 0.19170942902565002, 0.299259215593338, -0.2961865961551666, -0.2858143150806427, 0.0748608186841011, -0.08623235672712326, 0.4306855797767639, -0.13142836093902588, 0.06427880376577377, 0.1926906555891037, 0.15180110931396484, -0.16583631932735443, 0.1596222221851349, -0.060274701565504074, 0.36156532168388367, -0.3586384654045105, 0.32841113209724426, -0.45822250843048096, 0.15570595860481262, -0.2701035737991333, -0.17277315258979797, -0.27569395303726196, -0.33047428727149963, -0.016330592334270477, 0.11501313000917435, 0.0053809285163879395, -0.2639530897140503, 0.07579223811626434, -0.045516978949308395, 0.4670082926750183, 0.4941006898880005, 0.10765140503644943, 0.1612970232963562, -0.18902873992919922, -0.4919188618659973, -0.07742533832788467, -0.10267220437526703, 0.026653198525309563, 0.06530045717954636, -0.047930240631103516, -0.09341932088136673, 0.16448171436786652, 0.15160630643367767, 0.31479835510253906, -0.13506454229354858, -0.2298167645931244, -0.2712256610393524, -0.2077159732580185, 0.2582937479019165, -0.13965098559856415, -0.11483784765005112, -0.020067568868398666, 0.2209024578332901, -0.05054157227277756, -0.062183722853660583, -0.1317523568868637, 0.137021005153656, -0.24059158563613892, -0.12682794034481049, 0.3775871694087982, 0.2160317599773407, 0.3346262276172638, -0.10398761928081512, -0.3999274969100952, -0.44196617603302, -0.2367475926876068, -0.010187516920268536, 0.40269237756729126, -0.06943956017494202, 0.6453307867050171, -0.21400156617164612, -0.0774800032377243, -0.3579314053058624, 0.30400651693344116, -0.16625778377056122, -0.36099010705947876, -0.3295455873012543, 0.19439369440078735, -0.18369001150131226, 0.14065220952033997, 0.15356439352035522, 0.0857292041182518, -0.0981370359659195, 0.1669774055480957, -0.05500166118144989, -0.10481378436088562, 0.36187994480133057, -0.3540547490119934, -0.07478217780590057, 0.11728968471288681, -0.020389437675476074, 0.14139431715011597, -0.21345624327659607, -0.6122726202011108, 0.043801672756671906, 0.34976914525032043, 0.11156167834997177, -0.1511559635400772, 0.23207536339759827, -0.07119351625442505, -0.14250265061855316, -0.08314749598503113, 0.5256012082099915, 0.10403034090995789, -0.251539409160614, 0.5749450325965881, -0.08532562851905823 ]
https://github.com/huggingface/datasets/issues/6460
jsonlines files don't load with `load_dataset`
Hi again @serenalotreck, Yes, it is specific to PyArrow: as far as I know, Arrow does not support arrays with multiple data types. As this is related specifically to your dataset structure (and not the `datasets` library), I have created a dedicated issue in your dataset page: https://huggingface.co/datasets/slotreck/pickle/discussions/1 Let's continue the discussion there! :hugs:
### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5
54
jsonlines files don't load with `load_dataset` ### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5 Hi again @serenalotreck, Yes, it is specific to PyArrow: as far as I know, Arrow does not support arrays with multiple data types. As this is related specifically to your dataset structure (and not the `datasets` library), I have created a dedicated issue in your dataset page: https://huggingface.co/datasets/slotreck/pickle/discussions/1 Let's continue the discussion there! :hugs:
[ -0.23013778030872345, 0.12285789847373962, -0.04837002605199814, 0.44046550989151, 0.2559809386730194, 0.03217126429080963, 0.19228461384773254, 0.19167602062225342, 0.2536107003688812, -0.10145920515060425, 0.21212731301784515, 0.38886600732803345, -0.19203750789165497, 0.3685356080532074, -0.011028236709535122, -0.14814956486225128, 0.004168793559074402, 0.08705297857522964, -0.06175565719604492, 0.0658518522977829, -0.2930653989315033, 0.4825318157672882, -0.1257709264755249, -0.2876797318458557, -0.33003658056259155, 0.20288699865341187, 0.15511536598205566, 0.3156035244464874, -0.2079012244939804, -0.3987046182155609, 0.35157549381256104, 0.04336966946721077, 0.1589081585407257, 0.5264840722084045, -0.0001143237532232888, 0.21673448383808136, 0.27660316228866577, -0.10340578109025955, -0.2854090631008148, -0.47449755668640137, -0.4354296028614044, -0.35923469066619873, 0.2056596875190735, -0.12188692390918732, 0.025597747415304184, -0.05712522938847542, -0.06398769468069077, -0.4945879578590393, 0.620658278465271, 0.29994556307792664, 0.2132384032011032, 0.4240158796310425, 0.20004580914974213, 0.006130576133728027, 0.1954740285873413, 0.31599241495132446, -0.08488216996192932, 0.5176390409469604, -0.01900678128004074, 0.3008069694042206, 0.052854280918836594, 0.09206686913967133, 0.06130719929933548, -0.13582712411880493, 0.3350379765033722, -0.01612403243780136, -0.33958250284194946, -0.049703486263751984, 0.0916493833065033, 0.2932741641998291, 0.28175392746925354, -0.17623484134674072, -0.3398975729942322, -0.5134028792381287, -0.0815391093492508, -0.31680935621261597, 0.5144974589347839, 0.006754542235285044, -0.029025070369243622, 0.10368940979242325, -0.2740059494972229, -0.16540935635566711, -0.07543505728244781, 0.05499521270394325, 0.02594834566116333, -0.20279687643051147, -0.2553956210613251, -0.009640589356422424, 0.16675935685634613, 0.015619440004229546, -0.20738528668880463, 0.10045038163661957, -0.2053886353969574, 0.22936701774597168, -0.12631911039352417, 0.16434334218502045, 0.03683217242360115, -0.3876156508922577, 0.3063931167125702, 0.32786357402801514, 0.06894217431545258, -0.05616734176874161, -0.3469131588935852, 0.0909804031252861, 0.31034618616104126, 0.22376593947410583, 0.08497157692909241, -0.16012147068977356, 0.20159514248371124, 0.3660426437854767, 0.00265604630112648, -0.13085803389549255, -0.16736875474452972, -0.08507009595632553, -0.23537863790988922, -0.1078358069062233, 0.27910488843917847, -0.1600480079650879, -0.16545166075229645, 0.17736583948135376, -0.30597421526908875, -0.2850099802017212, -0.002418489195406437, 0.28072163462638855, 0.01062800083309412, 0.24693003296852112, 0.234425887465477, 0.2308492511510849, 0.06152881681919098, -0.12820741534233093, -0.15346495807170868, -0.006010590121150017, -0.09311218559741974, 0.014515133574604988, 0.18436595797538757, -0.24471184611320496, 0.41176459193229675, 0.07668663561344147, -0.14603137969970703, -0.1822875738143921, -0.08000978082418442, 0.1019207090139389, -0.18536630272865295, 0.12262073159217834, 0.15326905250549316, 0.017455795779824257, 0.07108049094676971, -0.10697455704212189, -0.10262157022953033, 0.029737688601017, -0.3839438557624817, -0.026868220418691635, -0.14751389622688293, 0.1672704815864563, -0.28068602085113525, -0.06506884098052979, -0.6126501560211182, 0.024948623031377792, -0.1666679084300995, -0.03756767511367798, 0.12080421298742294, -0.032943084836006165, 0.10325722396373749, -0.1247980147600174, 0.33856216073036194, 0.38423097133636475, -0.36005011200904846, -0.24723826348781586, 0.14040599763393402, -0.2597774267196655, 0.15089592337608337, 0.20674709975719452, -0.16721168160438538, 0.15960514545440674, -0.35039904713630676, 0.2761918902397156, 0.29760482907295227, -0.08912905305624008, -0.2591823637485504, 0.30782076716423035, -0.08967970311641693, 0.44879430532455444, 0.0406963936984539, -0.1900867074728012, 0.12328926473855972, 0.17875465750694275, 0.18449907004833221, 0.23866939544677734, 0.21687395870685577, 0.14103367924690247, -0.11487790942192078, -0.26377448439598083, 0.1196662038564682, 0.21916012465953827, -0.1874096542596817, -0.008503474295139313, -0.006935611367225647, 0.18316705524921417, 0.3368963897228241, -0.009793732315301895, -0.11830583959817886, 0.27371281385421753, 0.014900106936693192, 0.18169361352920532, 0.017656786367297173, 0.02628738433122635, -0.7521730661392212, 0.08564125746488571, -0.10332726687192917, 0.003992743790149689, -0.2349569946527481, -0.07457500696182251, -0.2460048496723175, 0.1403312236070633, -0.2719948887825012, -0.2472585141658783, 0.08910121023654938, 0.14886066317558289, 0.19214500486850739, 0.23873181641101837, -0.4370036721229553, 0.2790202498435974, -0.0864042192697525, 0.27795925736427307, -0.5994994640350342, 0.358914852142334, 0.14002741873264313, -0.1287887841463089, 0.1456013023853302, 0.30551522970199585, -0.03188133239746094, -0.4063511788845062, -0.2225998044013977, 0.3179192841053009, 0.19522739946842194, 0.04171401262283325, -0.1144784465432167, 0.12583717703819275, 0.1418490707874298, -0.043150078505277634, -0.21936091780662537, 0.12255239486694336, 0.06070230156183243, -0.028398558497428894, -0.24975982308387756, 0.24245136976242065, -0.1279555708169937, 0.3297531008720398, 0.12965944409370422, -0.12854517996311188, 0.16678869724273682, 0.018570411950349808, -0.1791592389345169, -0.10798576474189758, 0.3472801446914673, 0.27593106031417847, 0.2687149941921234, 0.0479547418653965, -0.13796760141849518, -0.12867042422294617, 0.7998291850090027, 0.011514782905578613, 0.022404108196496964, 0.2738809287548065, -0.05506100505590439, -0.028032362461090088, 0.11604126542806625, 0.12667863070964813, 0.24430951476097107, 0.11296039819717407, 0.00046629831194877625, 0.1918676197528839, 0.0559629388153553, -0.29940667748451233, 0.18219783902168274, 0.013921938836574554, -0.013087984174489975, 0.20487099885940552, 0.07336357980966568, 0.0007958104833960533, -0.46591466665267944, -0.2463345229625702, -0.2551076412200928, 0.24762031435966492, -0.3513181507587433, 0.1053256019949913, -0.4553815424442291, -0.10145995765924454, -0.13359707593917847, -0.1713157743215561, -0.5278865694999695, -0.3669494092464447, -0.2872796654701233, 0.09322239458560944, -0.08492925763130188, -0.014864984899759293, -0.30367058515548706, 0.0477147251367569, -0.03381453827023506, -0.265848308801651, -0.2685377299785614, 0.06668202579021454, -0.27526482939720154, 0.050593916326761246, 0.4722769558429718, -0.05752667039632797, 0.10135581344366074, -0.19120408594608307, -0.004189483821392059, -0.08166032284498215, -0.142278254032135, 0.1732427477836609, -0.1922004073858261, 0.13219045102596283, 0.38801300525665283, 0.3611944913864136, -0.06921994686126709, -0.20282313227653503, 0.2469973862171173, 0.08447104692459106, -0.28275471925735474, -0.013778481632471085, 0.01872756890952587, 0.0442039929330349, -0.28457632660865784, -0.32959839701652527, 0.11776605248451233, -0.47015380859375, 0.7083844542503357, -0.05820886045694351, -0.024433113634586334, 0.22255797684192657, 0.05125180631875992, 0.4339563846588135, -0.06362131237983704, 0.06466331332921982, -0.1090082898736, -0.5038890838623047, 0.22995541989803314, -0.17091278731822968, -0.3370618522167206, 0.21572840213775635, 0.06013592332601547, 0.2619449496269226, -0.1713949292898178, -0.5283801555633545, 0.01704566180706024, -0.11507387459278107, 0.2520380914211273, -0.01783282309770584, -0.022387361153960228, 0.14861688017845154, -0.12039262801408768, 0.06434036046266556, -0.13338613510131836, -0.12681853771209717, 0.23692449927330017, -0.2452985942363739, 0.11890249699354172, 0.08820755779743195, 0.7091601490974426, -0.10506676137447357, -0.019287951290607452, 0.45038244128227234, 0.03413895145058632, 0.5685428380966187, -0.1224198117852211, 0.3633236289024353, -0.28498575091362, -0.20431871712207794, -0.15628565847873688, -0.009565398097038269, 0.07695227116346359, 0.05894232913851738, 0.27060452103614807, 0.2762213945388794, -0.22319947183132172, -0.006235755980014801, -0.27643150091171265, -0.22371746599674225, 0.1583409309387207, 0.05862141028046608, -0.059799693524837494, -0.17064329981803894, 0.08985594660043716, 0.09053196012973785, 0.09379050880670547, -0.01582147367298603, 0.3854542374610901, 0.3200932741165161, 0.062140606343746185, -0.6170750856399536, -0.0769263505935669, -0.45512956380844116, 0.21256670355796814, -0.0008016976062208414, 0.3278009295463562, -0.03177192807197571, 0.022857334464788437, 0.1429201364517212, -0.285889595746994, 0.7596274018287659, 0.14432430267333984, -0.10302472114562988, 0.1058456301689148, 0.1309521347284317, -0.3242335915565491, 0.12137891352176666, 0.10239279270172119, 0.12533928453922272, 0.5416638255119324, 0.34779155254364014, -0.3742675185203552, -0.1584194153547287, 0.26748180389404297, 0.09247159212827682, -0.004883140325546265, -0.2284339815378189, -0.2695276141166687, -0.4646669626235962, -0.2518210709095001, -0.18761977553367615, 0.019677365198731422, 0.37974515557289124, 0.024883387610316277, -0.15068769454956055, 0.1376418024301529, -0.5244578123092651, -0.006534852087497711, 0.2029689997434616, 0.28463155031204224, 0.025061791762709618, 0.09616243839263916, 0.26618993282318115, 0.2393568456172943, 0.20382007956504822, 0.890621542930603, -0.028678465634584427, -0.4815205931663513, 0.11623970419168472, -0.10777858644723892, 0.3585921823978424, 0.04334116727113724, -0.12591171264648438, 0.19073277711868286, 0.09482523798942566, 0.026218898594379425, -0.08432886004447937, 0.0616048164665699, 0.4022357165813446, -0.06341119855642319, -0.12312100827693939, -0.4914613366127014, 0.5422191023826599, 0.05723505839705467, 0.2537291646003723, 0.05092618614435196, 0.14018012583255768, -0.277653306722641, 0.10844002664089203, -0.2753247320652008, 0.6423538327217102, 0.23023772239685059, 0.08481418341398239, 0.5401000380516052, -0.25236040353775024, 0.5430934429168701, -0.3520500063896179, -0.13201968371868134, -0.1970752328634262, 0.23107707500457764, -0.05093416944146156, -0.0658595860004425, 0.20420366525650024, 0.045849137008190155, -0.00022299587726593018, 0.032780591398477554, -0.11402915418148041, -0.15768128633499146, -0.0647832378745079, 0.2883266508579254, -0.28750860691070557, -0.18755055963993073, -0.7293282151222229, 0.12413570284843445, 0.008849456906318665, 0.11464563012123108, 0.020087186247110367, -0.17837274074554443, -0.05251362547278404, -0.49953311681747437, -0.38229256868362427, 0.1961211860179901, -0.11122588068246841, -0.002521514892578125, 0.30984753370285034, 0.026110202074050903, 0.10153679549694061, 0.059270381927490234, 0.06978470087051392, -0.027186524122953415, -0.1405334323644638, 0.13423383235931396, -0.20487767457962036, -0.04980241134762764, 0.038937002420425415, 0.1748376488685608, 0.31119394302368164, -0.19448864459991455, -0.08234865963459015, 0.10696706920862198, -0.1796359121799469, -0.5056490898132324, 0.032945454120635986, 0.13498477637767792, -0.20140628516674042, -0.2556958794593811, -0.09878882765769958, 0.0903158187866211, 0.32325825095176697, -0.13904501497745514, 0.0934857726097107, 0.25758183002471924, 0.1364952176809311, -0.19692006707191467, 0.04765113443136215, -0.18601657450199127, -0.18724653124809265, 0.3263692557811737, -0.18657445907592773, -0.16152840852737427, 0.43610480427742004, 0.41048336029052734, -0.1037481501698494, -0.1357087939977646, 0.29059097170829773, 0.5397540926933289, -0.40356507897377014, 0.14552073180675507, 0.13160303235054016, 0.17106769979000092, -0.17542536556720734, 0.3037150502204895, 0.0702599287033081, -0.09148342162370682, 0.1755833774805069, -0.5147277116775513, -0.26948773860931396, 0.2200922667980194, 0.06453755497932434, 0.18047641217708588, 0.009424753487110138, -0.03210993856191635, -0.06146708130836487, -0.35326308012008667, -0.22663870453834534, 0.10511881858110428, -0.06065494567155838, -0.22680452466011047, 0.3242168724536896, -0.04880101978778839, 0.5696450471878052, -0.08598427474498749, 0.12475481629371643, 0.2021636962890625, -0.2130531519651413, -0.12668898701667786, -0.26283735036849976, 0.07942456752061844, 0.11579450964927673, -0.15912336111068726, -0.1464289277791977, 0.06171859800815582, -0.2524520754814148, -0.08139634877443314, 0.19060301780700684, -0.05501788854598999, -0.11013001203536987, 0.06642421334981918, 0.11531765758991241, 0.2109566032886505, -0.18661144375801086, 0.02849555015563965, 0.07861427962779999, 0.3585559129714966, 0.09000005573034286, -0.0009168796241283417, -0.21650715172290802, 0.14178815484046936, -0.24971310794353485, 0.14168183505535126, 0.13441398739814758, 0.1510830521583557, 0.2699749171733856, -0.40516358613967896, 0.04634678736329079, 0.1507667452096939, 0.1358170360326767, 0.46965062618255615, -0.19482608139514923, 0.15333136916160583, 0.07235699892044067, 0.12997819483280182, -0.0547226145863533, 0.01101150456815958, 0.2720224857330322, 0.18259060382843018, -0.04660507291555405, 0.04713834822177887, 0.00977126881480217, 0.04065714776515961, -0.054783716797828674, 0.08999709784984589, 0.3429553806781769, 0.28865861892700195, 0.35815516114234924, 0.19004176557064056, -0.21717821061611176, 0.11064117401838303, -0.14880739152431488, 0.06883294880390167, 0.2678269147872925, 0.16297364234924316, -0.19628608226776123, 0.22513921558856964, -0.2166925072669983, 0.0003031417727470398, -0.10241291671991348, -0.4691862165927887, -0.2391364425420761, 0.24166062474250793, -0.027743175625801086, 0.2785334587097168, -0.01797720044851303, 0.4557577967643738, -0.2643914520740509, -0.0005964045412838459, -0.3029399812221527, 0.18921317160129547, -0.11416781693696976, -0.1297789067029953, -0.12416522949934006, -0.19603465497493744, -0.35321417450904846, -0.03599293529987335, -0.08005140721797943, -0.004690535366535187, -0.08790417015552521, 0.008127756416797638, -0.14681334793567657, -0.30748599767684937, -0.08473917841911316, -0.08533825725317001, 0.007070720195770264, -0.10170114040374756, 0.43273934721946716, 0.32556772232055664, 0.0035315975546836853, 0.24888966977596283, 0.08397474884986877, 0.2945765256881714, 0.19170942902565002, 0.299259215593338, -0.2961865961551666, -0.2858143150806427, 0.0748608186841011, -0.08623235672712326, 0.4306855797767639, -0.13142836093902588, 0.06427880376577377, 0.1926906555891037, 0.15180110931396484, -0.16583631932735443, 0.1596222221851349, -0.060274701565504074, 0.36156532168388367, -0.3586384654045105, 0.32841113209724426, -0.45822250843048096, 0.15570595860481262, -0.2701035737991333, -0.17277315258979797, -0.27569395303726196, -0.33047428727149963, -0.016330592334270477, 0.11501313000917435, 0.0053809285163879395, -0.2639530897140503, 0.07579223811626434, -0.045516978949308395, 0.4670082926750183, 0.4941006898880005, 0.10765140503644943, 0.1612970232963562, -0.18902873992919922, -0.4919188618659973, -0.07742533832788467, -0.10267220437526703, 0.026653198525309563, 0.06530045717954636, -0.047930240631103516, -0.09341932088136673, 0.16448171436786652, 0.15160630643367767, 0.31479835510253906, -0.13506454229354858, -0.2298167645931244, -0.2712256610393524, -0.2077159732580185, 0.2582937479019165, -0.13965098559856415, -0.11483784765005112, -0.020067568868398666, 0.2209024578332901, -0.05054157227277756, -0.062183722853660583, -0.1317523568868637, 0.137021005153656, -0.24059158563613892, -0.12682794034481049, 0.3775871694087982, 0.2160317599773407, 0.3346262276172638, -0.10398761928081512, -0.3999274969100952, -0.44196617603302, -0.2367475926876068, -0.010187516920268536, 0.40269237756729126, -0.06943956017494202, 0.6453307867050171, -0.21400156617164612, -0.0774800032377243, -0.3579314053058624, 0.30400651693344116, -0.16625778377056122, -0.36099010705947876, -0.3295455873012543, 0.19439369440078735, -0.18369001150131226, 0.14065220952033997, 0.15356439352035522, 0.0857292041182518, -0.0981370359659195, 0.1669774055480957, -0.05500166118144989, -0.10481378436088562, 0.36187994480133057, -0.3540547490119934, -0.07478217780590057, 0.11728968471288681, -0.020389437675476074, 0.14139431715011597, -0.21345624327659607, -0.6122726202011108, 0.043801672756671906, 0.34976914525032043, 0.11156167834997177, -0.1511559635400772, 0.23207536339759827, -0.07119351625442505, -0.14250265061855316, -0.08314749598503113, 0.5256012082099915, 0.10403034090995789, -0.251539409160614, 0.5749450325965881, -0.08532562851905823 ]
https://github.com/huggingface/datasets/issues/6460
jsonlines files don't load with `load_dataset`
> Hi again @serenalotreck, > > Yes, it is specific to PyArrow: as far as I know, Arrow does not support arrays with multiple data types. > > As this is related specifically to your dataset structure (and not the `datasets` library), I have created a dedicated issue in your dataset page: https://huggingface.co/datasets/slotreck/pickle/discussions/1 > > Let's continue the discussion there! 🤗 This is really terrible. My JSONL format data is very simple, but I still report this error ![image](https://github.com/huggingface/datasets/assets/58240629/e3fed922-ced4-406c-b5bc-90a4b891c4ee) The error message is as follows: File "pyarrow/_json.pyx", line 290, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/inputs) changed from string to number in row 208
### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5
116
jsonlines files don't load with `load_dataset` ### Describe the bug While [the docs](https://huggingface.co/docs/datasets/upload_dataset#upload-dataset) seem to state that `.jsonl` is a supported extension for `datasets`, loading the dataset results in a `JSONDecodeError`. ### Steps to reproduce the bug Code: ``` from datasets import load_dataset dset = load_dataset('slotreck/pickle') ``` Traceback: ``` Downloading readme: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 925/925 [00:00<00:00, 3.11MB/s] Downloading and preparing dataset json/slotreck--pickle to /mnt/home/lotrecks/.cache/huggingface/datasets/slotreck___json/slotreck--pickle-0c311f36ed032b04/0.0.0/8bb11242116d547c741b2e8a1f18598ffdd40a1d4f2a2872c7a28b697434bc96... Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 589k/589k [00:00<00:00, 18.9MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104k/104k [00:00<00:00, 4.61MB/s] Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 170k/170k [00:00<00:00, 7.71MB/s] Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.77it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 523.92it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/mnt/home/lotrecks/.cache/huggingface/datasets/downloads/6ec07bb2f279c9377036af6948532513fa8f48244c672d2644a2d7018ee5c9cb' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 144, in _generate_tables dataset = json.load(f) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 3086) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1879, in _prepare_split_single for _, table in generator: File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 147, in _generate_tables raise e File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 259, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/ner/[]/[]/[]) changed from number to string in row 0 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/load.py", line 1815, in load_dataset storage_options=storage_options, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 913, in download_and_prepare **download_and_prepare_kwargs, File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1768, in _prepare_split gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args File "/mnt/home/lotrecks/anaconda3/envs/pickle/lib/python3.7/site-packages/datasets/builder.py", line 1912, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Expected behavior For the dataset to be loaded without error. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core - Python version: 3.7.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 8.0.0 - Pandas version: 1.3.5 > Hi again @serenalotreck, > > Yes, it is specific to PyArrow: as far as I know, Arrow does not support arrays with multiple data types. > > As this is related specifically to your dataset structure (and not the `datasets` library), I have created a dedicated issue in your dataset page: https://huggingface.co/datasets/slotreck/pickle/discussions/1 > > Let's continue the discussion there! 🤗 This is really terrible. My JSONL format data is very simple, but I still report this error ![image](https://github.com/huggingface/datasets/assets/58240629/e3fed922-ced4-406c-b5bc-90a4b891c4ee) The error message is as follows: File "pyarrow/_json.pyx", line 290, in pyarrow._json.read_json File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column(/inputs) changed from string to number in row 208
[ -0.23013778030872345, 0.12285789847373962, -0.04837002605199814, 0.44046550989151, 0.2559809386730194, 0.03217126429080963, 0.19228461384773254, 0.19167602062225342, 0.2536107003688812, -0.10145920515060425, 0.21212731301784515, 0.38886600732803345, -0.19203750789165497, 0.3685356080532074, -0.011028236709535122, -0.14814956486225128, 0.004168793559074402, 0.08705297857522964, -0.06175565719604492, 0.0658518522977829, -0.2930653989315033, 0.4825318157672882, -0.1257709264755249, -0.2876797318458557, -0.33003658056259155, 0.20288699865341187, 0.15511536598205566, 0.3156035244464874, -0.2079012244939804, -0.3987046182155609, 0.35157549381256104, 0.04336966946721077, 0.1589081585407257, 0.5264840722084045, -0.0001143237532232888, 0.21673448383808136, 0.27660316228866577, -0.10340578109025955, -0.2854090631008148, -0.47449755668640137, -0.4354296028614044, -0.35923469066619873, 0.2056596875190735, -0.12188692390918732, 0.025597747415304184, -0.05712522938847542, -0.06398769468069077, -0.4945879578590393, 0.620658278465271, 0.29994556307792664, 0.2132384032011032, 0.4240158796310425, 0.20004580914974213, 0.006130576133728027, 0.1954740285873413, 0.31599241495132446, -0.08488216996192932, 0.5176390409469604, -0.01900678128004074, 0.3008069694042206, 0.052854280918836594, 0.09206686913967133, 0.06130719929933548, -0.13582712411880493, 0.3350379765033722, -0.01612403243780136, -0.33958250284194946, -0.049703486263751984, 0.0916493833065033, 0.2932741641998291, 0.28175392746925354, -0.17623484134674072, -0.3398975729942322, -0.5134028792381287, -0.0815391093492508, -0.31680935621261597, 0.5144974589347839, 0.006754542235285044, -0.029025070369243622, 0.10368940979242325, -0.2740059494972229, -0.16540935635566711, -0.07543505728244781, 0.05499521270394325, 0.02594834566116333, -0.20279687643051147, -0.2553956210613251, -0.009640589356422424, 0.16675935685634613, 0.015619440004229546, -0.20738528668880463, 0.10045038163661957, -0.2053886353969574, 0.22936701774597168, -0.12631911039352417, 0.16434334218502045, 0.03683217242360115, -0.3876156508922577, 0.3063931167125702, 0.32786357402801514, 0.06894217431545258, -0.05616734176874161, -0.3469131588935852, 0.0909804031252861, 0.31034618616104126, 0.22376593947410583, 0.08497157692909241, -0.16012147068977356, 0.20159514248371124, 0.3660426437854767, 0.00265604630112648, -0.13085803389549255, -0.16736875474452972, -0.08507009595632553, -0.23537863790988922, -0.1078358069062233, 0.27910488843917847, -0.1600480079650879, -0.16545166075229645, 0.17736583948135376, -0.30597421526908875, -0.2850099802017212, -0.002418489195406437, 0.28072163462638855, 0.01062800083309412, 0.24693003296852112, 0.234425887465477, 0.2308492511510849, 0.06152881681919098, -0.12820741534233093, -0.15346495807170868, -0.006010590121150017, -0.09311218559741974, 0.014515133574604988, 0.18436595797538757, -0.24471184611320496, 0.41176459193229675, 0.07668663561344147, -0.14603137969970703, -0.1822875738143921, -0.08000978082418442, 0.1019207090139389, -0.18536630272865295, 0.12262073159217834, 0.15326905250549316, 0.017455795779824257, 0.07108049094676971, -0.10697455704212189, -0.10262157022953033, 0.029737688601017, -0.3839438557624817, -0.026868220418691635, -0.14751389622688293, 0.1672704815864563, -0.28068602085113525, -0.06506884098052979, -0.6126501560211182, 0.024948623031377792, -0.1666679084300995, -0.03756767511367798, 0.12080421298742294, -0.032943084836006165, 0.10325722396373749, -0.1247980147600174, 0.33856216073036194, 0.38423097133636475, -0.36005011200904846, -0.24723826348781586, 0.14040599763393402, -0.2597774267196655, 0.15089592337608337, 0.20674709975719452, -0.16721168160438538, 0.15960514545440674, -0.35039904713630676, 0.2761918902397156, 0.29760482907295227, -0.08912905305624008, -0.2591823637485504, 0.30782076716423035, -0.08967970311641693, 0.44879430532455444, 0.0406963936984539, -0.1900867074728012, 0.12328926473855972, 0.17875465750694275, 0.18449907004833221, 0.23866939544677734, 0.21687395870685577, 0.14103367924690247, -0.11487790942192078, -0.26377448439598083, 0.1196662038564682, 0.21916012465953827, -0.1874096542596817, -0.008503474295139313, -0.006935611367225647, 0.18316705524921417, 0.3368963897228241, -0.009793732315301895, -0.11830583959817886, 0.27371281385421753, 0.014900106936693192, 0.18169361352920532, 0.017656786367297173, 0.02628738433122635, -0.7521730661392212, 0.08564125746488571, -0.10332726687192917, 0.003992743790149689, -0.2349569946527481, -0.07457500696182251, -0.2460048496723175, 0.1403312236070633, -0.2719948887825012, -0.2472585141658783, 0.08910121023654938, 0.14886066317558289, 0.19214500486850739, 0.23873181641101837, -0.4370036721229553, 0.2790202498435974, -0.0864042192697525, 0.27795925736427307, -0.5994994640350342, 0.358914852142334, 0.14002741873264313, -0.1287887841463089, 0.1456013023853302, 0.30551522970199585, -0.03188133239746094, -0.4063511788845062, -0.2225998044013977, 0.3179192841053009, 0.19522739946842194, 0.04171401262283325, -0.1144784465432167, 0.12583717703819275, 0.1418490707874298, -0.043150078505277634, -0.21936091780662537, 0.12255239486694336, 0.06070230156183243, -0.028398558497428894, -0.24975982308387756, 0.24245136976242065, -0.1279555708169937, 0.3297531008720398, 0.12965944409370422, -0.12854517996311188, 0.16678869724273682, 0.018570411950349808, -0.1791592389345169, -0.10798576474189758, 0.3472801446914673, 0.27593106031417847, 0.2687149941921234, 0.0479547418653965, -0.13796760141849518, -0.12867042422294617, 0.7998291850090027, 0.011514782905578613, 0.022404108196496964, 0.2738809287548065, -0.05506100505590439, -0.028032362461090088, 0.11604126542806625, 0.12667863070964813, 0.24430951476097107, 0.11296039819717407, 0.00046629831194877625, 0.1918676197528839, 0.0559629388153553, -0.29940667748451233, 0.18219783902168274, 0.013921938836574554, -0.013087984174489975, 0.20487099885940552, 0.07336357980966568, 0.0007958104833960533, -0.46591466665267944, -0.2463345229625702, -0.2551076412200928, 0.24762031435966492, -0.3513181507587433, 0.1053256019949913, -0.4553815424442291, -0.10145995765924454, -0.13359707593917847, -0.1713157743215561, -0.5278865694999695, -0.3669494092464447, -0.2872796654701233, 0.09322239458560944, -0.08492925763130188, -0.014864984899759293, -0.30367058515548706, 0.0477147251367569, -0.03381453827023506, -0.265848308801651, -0.2685377299785614, 0.06668202579021454, -0.27526482939720154, 0.050593916326761246, 0.4722769558429718, -0.05752667039632797, 0.10135581344366074, -0.19120408594608307, -0.004189483821392059, -0.08166032284498215, -0.142278254032135, 0.1732427477836609, -0.1922004073858261, 0.13219045102596283, 0.38801300525665283, 0.3611944913864136, -0.06921994686126709, -0.20282313227653503, 0.2469973862171173, 0.08447104692459106, -0.28275471925735474, -0.013778481632471085, 0.01872756890952587, 0.0442039929330349, -0.28457632660865784, -0.32959839701652527, 0.11776605248451233, -0.47015380859375, 0.7083844542503357, -0.05820886045694351, -0.024433113634586334, 0.22255797684192657, 0.05125180631875992, 0.4339563846588135, -0.06362131237983704, 0.06466331332921982, -0.1090082898736, -0.5038890838623047, 0.22995541989803314, -0.17091278731822968, -0.3370618522167206, 0.21572840213775635, 0.06013592332601547, 0.2619449496269226, -0.1713949292898178, -0.5283801555633545, 0.01704566180706024, -0.11507387459278107, 0.2520380914211273, -0.01783282309770584, -0.022387361153960228, 0.14861688017845154, -0.12039262801408768, 0.06434036046266556, -0.13338613510131836, -0.12681853771209717, 0.23692449927330017, -0.2452985942363739, 0.11890249699354172, 0.08820755779743195, 0.7091601490974426, -0.10506676137447357, -0.019287951290607452, 0.45038244128227234, 0.03413895145058632, 0.5685428380966187, -0.1224198117852211, 0.3633236289024353, -0.28498575091362, -0.20431871712207794, -0.15628565847873688, -0.009565398097038269, 0.07695227116346359, 0.05894232913851738, 0.27060452103614807, 0.2762213945388794, -0.22319947183132172, -0.006235755980014801, -0.27643150091171265, -0.22371746599674225, 0.1583409309387207, 0.05862141028046608, -0.059799693524837494, -0.17064329981803894, 0.08985594660043716, 0.09053196012973785, 0.09379050880670547, -0.01582147367298603, 0.3854542374610901, 0.3200932741165161, 0.062140606343746185, -0.6170750856399536, -0.0769263505935669, -0.45512956380844116, 0.21256670355796814, -0.0008016976062208414, 0.3278009295463562, -0.03177192807197571, 0.022857334464788437, 0.1429201364517212, -0.285889595746994, 0.7596274018287659, 0.14432430267333984, -0.10302472114562988, 0.1058456301689148, 0.1309521347284317, -0.3242335915565491, 0.12137891352176666, 0.10239279270172119, 0.12533928453922272, 0.5416638255119324, 0.34779155254364014, -0.3742675185203552, -0.1584194153547287, 0.26748180389404297, 0.09247159212827682, -0.004883140325546265, -0.2284339815378189, -0.2695276141166687, -0.4646669626235962, -0.2518210709095001, -0.18761977553367615, 0.019677365198731422, 0.37974515557289124, 0.024883387610316277, -0.15068769454956055, 0.1376418024301529, -0.5244578123092651, -0.006534852087497711, 0.2029689997434616, 0.28463155031204224, 0.025061791762709618, 0.09616243839263916, 0.26618993282318115, 0.2393568456172943, 0.20382007956504822, 0.890621542930603, -0.028678465634584427, -0.4815205931663513, 0.11623970419168472, -0.10777858644723892, 0.3585921823978424, 0.04334116727113724, -0.12591171264648438, 0.19073277711868286, 0.09482523798942566, 0.026218898594379425, -0.08432886004447937, 0.0616048164665699, 0.4022357165813446, -0.06341119855642319, -0.12312100827693939, -0.4914613366127014, 0.5422191023826599, 0.05723505839705467, 0.2537291646003723, 0.05092618614435196, 0.14018012583255768, -0.277653306722641, 0.10844002664089203, -0.2753247320652008, 0.6423538327217102, 0.23023772239685059, 0.08481418341398239, 0.5401000380516052, -0.25236040353775024, 0.5430934429168701, -0.3520500063896179, -0.13201968371868134, -0.1970752328634262, 0.23107707500457764, -0.05093416944146156, -0.0658595860004425, 0.20420366525650024, 0.045849137008190155, -0.00022299587726593018, 0.032780591398477554, -0.11402915418148041, -0.15768128633499146, -0.0647832378745079, 0.2883266508579254, -0.28750860691070557, -0.18755055963993073, -0.7293282151222229, 0.12413570284843445, 0.008849456906318665, 0.11464563012123108, 0.020087186247110367, -0.17837274074554443, -0.05251362547278404, -0.49953311681747437, -0.38229256868362427, 0.1961211860179901, -0.11122588068246841, -0.002521514892578125, 0.30984753370285034, 0.026110202074050903, 0.10153679549694061, 0.059270381927490234, 0.06978470087051392, -0.027186524122953415, -0.1405334323644638, 0.13423383235931396, -0.20487767457962036, -0.04980241134762764, 0.038937002420425415, 0.1748376488685608, 0.31119394302368164, -0.19448864459991455, -0.08234865963459015, 0.10696706920862198, -0.1796359121799469, -0.5056490898132324, 0.032945454120635986, 0.13498477637767792, -0.20140628516674042, -0.2556958794593811, -0.09878882765769958, 0.0903158187866211, 0.32325825095176697, -0.13904501497745514, 0.0934857726097107, 0.25758183002471924, 0.1364952176809311, -0.19692006707191467, 0.04765113443136215, -0.18601657450199127, -0.18724653124809265, 0.3263692557811737, -0.18657445907592773, -0.16152840852737427, 0.43610480427742004, 0.41048336029052734, -0.1037481501698494, -0.1357087939977646, 0.29059097170829773, 0.5397540926933289, -0.40356507897377014, 0.14552073180675507, 0.13160303235054016, 0.17106769979000092, -0.17542536556720734, 0.3037150502204895, 0.0702599287033081, -0.09148342162370682, 0.1755833774805069, -0.5147277116775513, -0.26948773860931396, 0.2200922667980194, 0.06453755497932434, 0.18047641217708588, 0.009424753487110138, -0.03210993856191635, -0.06146708130836487, -0.35326308012008667, -0.22663870453834534, 0.10511881858110428, -0.06065494567155838, -0.22680452466011047, 0.3242168724536896, -0.04880101978778839, 0.5696450471878052, -0.08598427474498749, 0.12475481629371643, 0.2021636962890625, -0.2130531519651413, -0.12668898701667786, -0.26283735036849976, 0.07942456752061844, 0.11579450964927673, -0.15912336111068726, -0.1464289277791977, 0.06171859800815582, -0.2524520754814148, -0.08139634877443314, 0.19060301780700684, -0.05501788854598999, -0.11013001203536987, 0.06642421334981918, 0.11531765758991241, 0.2109566032886505, -0.18661144375801086, 0.02849555015563965, 0.07861427962779999, 0.3585559129714966, 0.09000005573034286, -0.0009168796241283417, -0.21650715172290802, 0.14178815484046936, -0.24971310794353485, 0.14168183505535126, 0.13441398739814758, 0.1510830521583557, 0.2699749171733856, -0.40516358613967896, 0.04634678736329079, 0.1507667452096939, 0.1358170360326767, 0.46965062618255615, -0.19482608139514923, 0.15333136916160583, 0.07235699892044067, 0.12997819483280182, -0.0547226145863533, 0.01101150456815958, 0.2720224857330322, 0.18259060382843018, -0.04660507291555405, 0.04713834822177887, 0.00977126881480217, 0.04065714776515961, -0.054783716797828674, 0.08999709784984589, 0.3429553806781769, 0.28865861892700195, 0.35815516114234924, 0.19004176557064056, -0.21717821061611176, 0.11064117401838303, -0.14880739152431488, 0.06883294880390167, 0.2678269147872925, 0.16297364234924316, -0.19628608226776123, 0.22513921558856964, -0.2166925072669983, 0.0003031417727470398, -0.10241291671991348, -0.4691862165927887, -0.2391364425420761, 0.24166062474250793, -0.027743175625801086, 0.2785334587097168, -0.01797720044851303, 0.4557577967643738, -0.2643914520740509, -0.0005964045412838459, -0.3029399812221527, 0.18921317160129547, -0.11416781693696976, -0.1297789067029953, -0.12416522949934006, -0.19603465497493744, -0.35321417450904846, -0.03599293529987335, -0.08005140721797943, -0.004690535366535187, -0.08790417015552521, 0.008127756416797638, -0.14681334793567657, -0.30748599767684937, -0.08473917841911316, -0.08533825725317001, 0.007070720195770264, -0.10170114040374756, 0.43273934721946716, 0.32556772232055664, 0.0035315975546836853, 0.24888966977596283, 0.08397474884986877, 0.2945765256881714, 0.19170942902565002, 0.299259215593338, -0.2961865961551666, -0.2858143150806427, 0.0748608186841011, -0.08623235672712326, 0.4306855797767639, -0.13142836093902588, 0.06427880376577377, 0.1926906555891037, 0.15180110931396484, -0.16583631932735443, 0.1596222221851349, -0.060274701565504074, 0.36156532168388367, -0.3586384654045105, 0.32841113209724426, -0.45822250843048096, 0.15570595860481262, -0.2701035737991333, -0.17277315258979797, -0.27569395303726196, -0.33047428727149963, -0.016330592334270477, 0.11501313000917435, 0.0053809285163879395, -0.2639530897140503, 0.07579223811626434, -0.045516978949308395, 0.4670082926750183, 0.4941006898880005, 0.10765140503644943, 0.1612970232963562, -0.18902873992919922, -0.4919188618659973, -0.07742533832788467, -0.10267220437526703, 0.026653198525309563, 0.06530045717954636, -0.047930240631103516, -0.09341932088136673, 0.16448171436786652, 0.15160630643367767, 0.31479835510253906, -0.13506454229354858, -0.2298167645931244, -0.2712256610393524, -0.2077159732580185, 0.2582937479019165, -0.13965098559856415, -0.11483784765005112, -0.020067568868398666, 0.2209024578332901, -0.05054157227277756, -0.062183722853660583, -0.1317523568868637, 0.137021005153656, -0.24059158563613892, -0.12682794034481049, 0.3775871694087982, 0.2160317599773407, 0.3346262276172638, -0.10398761928081512, -0.3999274969100952, -0.44196617603302, -0.2367475926876068, -0.010187516920268536, 0.40269237756729126, -0.06943956017494202, 0.6453307867050171, -0.21400156617164612, -0.0774800032377243, -0.3579314053058624, 0.30400651693344116, -0.16625778377056122, -0.36099010705947876, -0.3295455873012543, 0.19439369440078735, -0.18369001150131226, 0.14065220952033997, 0.15356439352035522, 0.0857292041182518, -0.0981370359659195, 0.1669774055480957, -0.05500166118144989, -0.10481378436088562, 0.36187994480133057, -0.3540547490119934, -0.07478217780590057, 0.11728968471288681, -0.020389437675476074, 0.14139431715011597, -0.21345624327659607, -0.6122726202011108, 0.043801672756671906, 0.34976914525032043, 0.11156167834997177, -0.1511559635400772, 0.23207536339759827, -0.07119351625442505, -0.14250265061855316, -0.08314749598503113, 0.5256012082099915, 0.10403034090995789, -0.251539409160614, 0.5749450325965881, -0.08532562851905823 ]
https://github.com/huggingface/datasets/issues/6457
`TypeError`: huggingface_hub.hf_file_system.HfFileSystem.find() got multiple values for keyword argument 'maxdepth'
> Maybe this should go in datasets directly... anyways you can easily fix this error by updating datasets>=2.15.1.dev0. @lhoestq @mariosasko for what I understand this is a bug fixed in `datasets` already, right? No need to do anything in `huggingface_hub`?
### Describe the bug Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Steps to reproduce the bug Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Expected behavior Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Environment info Please see https://github.com/huggingface/huggingface_hub/issues/1872
40
`TypeError`: huggingface_hub.hf_file_system.HfFileSystem.find() got multiple values for keyword argument 'maxdepth' ### Describe the bug Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Steps to reproduce the bug Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Expected behavior Please see https://github.com/huggingface/huggingface_hub/issues/1872 ### Environment info Please see https://github.com/huggingface/huggingface_hub/issues/1872 > Maybe this should go in datasets directly... anyways you can easily fix this error by updating datasets>=2.15.1.dev0. @lhoestq @mariosasko for what I understand this is a bug fixed in `datasets` already, right? No need to do anything in `huggingface_hub`?
[ -0.035941243171691895, -0.7556372880935669, -0.036174580454826355, 0.3993551731109619, 0.20192906260490417, -0.036666180938482285, -0.061978694051504135, 0.3705708980560303, 0.15028256177902222, 0.22910135984420776, -0.3483661115169525, -0.07723753899335861, -0.17496581375598907, 0.24227730929851532, -0.15313135087490082, -0.025247015058994293, 0.18430547416210175, 0.06644396483898163, -0.16641174256801605, 0.02372855693101883, -0.21807469427585602, 0.380636990070343, -0.07080161571502686, 0.09064455330371857, -0.5454609394073486, 0.008698437362909317, -0.20142602920532227, 0.2887410521507263, 0.05094751715660095, -0.2532433271408081, 0.3136357367038727, 0.03751758858561516, -0.08179409056901932, 0.35622403025627136, -0.00011404516408219934, -0.011510811746120453, 0.18278326094150543, -0.044655002653598785, -0.14930105209350586, -0.021630391478538513, 0.01633494347333908, 0.05486465245485306, -0.10672221332788467, -0.05917435511946678, -0.0038925651460886, -0.017941616475582123, 0.03433506190776825, 0.02576225996017456, 0.17793987691402435, 0.14545713365077972, 0.23965641856193542, 0.40403294563293457, 0.19029366970062256, -0.3681180477142334, 0.22781088948249817, 0.17877143621444702, 0.03817356377840042, 0.32776114344596863, 0.3046979308128357, 0.02969030849635601, -0.0717376247048378, 0.29332560300827026, 0.30395424365997314, 0.1243429034948349, 0.5383151173591614, -0.06511139869689941, -0.07304031401872635, -0.11112359166145325, 0.06007695943117142, 0.21557113528251648, -0.08869455009698868, -0.2925839424133301, -0.1787198781967163, -0.3488861322402954, 0.02819356694817543, -0.143517404794693, 0.4057990610599518, 0.08909499645233154, -0.1834317147731781, -0.16356167197227478, 0.001719858031719923, -0.3486872911453247, -0.004419833421707153, 0.033571142703294754, 0.08497892320156097, 0.060540616512298584, -0.3736144006252289, 0.09285514801740646, 0.3916544020175934, -0.3632255792617798, -0.3495227098464966, 0.0386723130941391, -0.1218605488538742, 0.021974671632051468, -0.40084874629974365, -0.1748884618282318, 0.16176839172840118, 0.4710976481437683, 0.4096601903438568, 0.015755876898765564, -0.14566154778003693, -0.0727376714348793, -0.13258911669254303, 0.019171860069036484, 0.30933499336242676, 0.005808515474200249, 0.15694090723991394, -0.049813974648714066, 0.07369336485862732, 0.49646055698394775, 0.012507867068052292, 0.03846871107816696, 0.2612440586090088, -0.3272790312767029, -0.2632289528846741, -0.024427037686109543, 0.2840668559074402, -0.09963589906692505, -0.11935116350650787, 0.06472375243902206, 0.1267167627811432, -0.012902097776532173, 0.20632778108119965, 0.3799992501735687, 0.26398107409477234, -0.028441432863473892, -0.11905884742736816, 0.14653697609901428, -0.2184370905160904, -0.004483662545681, -0.3228447437286377, 0.28004151582717896, 0.11997288465499878, 0.007173633668571711, 0.03260673210024834, -0.6014917492866516, 0.09068720042705536, 0.16383250057697296, 0.46169477701187134, -0.16728968918323517, -0.2812400162220001, -0.14089538156986237, -0.11804120987653732, 0.3014414310455322, -0.10860864818096161, 0.1299474537372589, 0.09931597113609314, -0.03496347740292549, -0.24988311529159546, -0.25926342606544495, -0.2537437379360199, -0.32719817757606506, -0.16047509014606476, 0.19310148060321808, 0.06449080258607864, 0.2751932442188263, -0.3240300118923187, 0.08147673308849335, 0.019783690571784973, 0.03969861939549446, -0.04157430678606033, 0.15846826136112213, -0.11171437799930573, -0.06734767556190491, 0.1705756038427353, 0.36214274168014526, 0.2484802007675171, -0.24115437269210815, 0.12577885389328003, -0.12742473185062408, -0.23632463812828064, 0.2749538719654083, -0.03979967162013054, 0.25497934222221375, -0.5299443602561951, 0.21739833056926727, -0.06438585370779037, -0.5159855484962463, -0.4534069895744324, 0.05255008861422539, 0.025004364550113678, 0.011249953880906105, -0.00735936313867569, -0.1896384060382843, -0.03979510813951492, -0.10497641563415527, 0.1770593523979187, -0.09935037046670914, 0.10642193257808685, 0.049627892673015594, -0.3540240526199341, -0.28640300035476685, -0.14525625109672546, -0.012701636180281639, 0.15808551013469696, -0.0641477033495903, 0.03532346338033676, 0.2888663411140442, 0.24237143993377686, 0.008867837488651276, 0.07013528048992157, 0.30797773599624634, 0.17534883320331573, 0.06830380856990814, -0.032530587166547775, -0.3146846890449524, -0.01632794737815857, 0.17823165655136108, -0.18386122584342957, 0.04176688194274902, 0.018446825444698334, -0.2628101706504822, -0.20701101422309875, -0.09806384146213531, -0.09300757944583893, -0.1619807481765747, 0.19090379774570465, 0.07940403372049332, -0.04194915294647217, -0.046315860003232956, -0.08903021365404129, 0.40866586565971375, -0.07857051491737366, 0.24115926027297974, -0.48605161905288696, 0.41477495431900024, -0.22808052599430084, 0.0941857099533081, -0.044713590294122696, 0.055771760642528534, 0.1841353476047516, -0.1223706603050232, -0.06535064429044724, 0.44987940788269043, -0.1412162333726883, 0.1745019257068634, 0.007857590913772583, -0.048060983419418335, 0.2507822811603546, 0.0790727436542511, -0.18492825329303741, -0.05167868360877037, 0.08527578413486481, 0.01698969304561615, 0.08710216730833054, 0.08938973397016525, -0.09491243958473206, 0.07127487659454346, 0.1469925343990326, 0.0275318194180727, -0.09848136454820633, 0.13811476528644562, 0.05321773141622543, -0.2903482913970947, 0.15968284010887146, 0.005365805700421333, 0.06690943241119385, -0.1316826194524765, -0.10094407200813293, -0.05130936950445175, 0.4806562662124634, 0.17654898762702942, 0.22553077340126038, 0.22023159265518188, -0.019279897212982178, 0.0333947017788887, 0.1267266869544983, -0.0013105124235153198, 0.2953221797943115, 0.14894849061965942, -0.08936212956905365, 0.14632196724414825, 0.001452709548175335, -0.0015104804188013077, 0.20487207174301147, 0.12748128175735474, 0.05469418689608574, 0.1395624727010727, -0.008919630199670792, -0.038624633103609085, -0.3896210789680481, -0.16078805923461914, -0.06497707962989807, 0.08006718009710312, -0.46485310792922974, -0.15464091300964355, -0.2054399847984314, -0.2551436424255371, -0.0967283844947815, -0.07172831147909164, -0.3406982719898224, -0.31005796790122986, 0.12217316031455994, 0.14374960958957672, -0.2422943115234375, 0.1887398511171341, 0.23679295182228088, 0.3673332631587982, -0.005774486809968948, 0.2895956039428711, -0.1827966868877411, 0.30236783623695374, -0.15324538946151733, -0.01746564544737339, 0.1487332433462143, -0.005180243402719498, 0.2278684675693512, -0.2649310231208801, 0.017343055456876755, -0.290880024433136, -0.3371519148349762, 0.1496565341949463, -0.13259576261043549, 0.2788340747356415, 0.4078998267650604, 0.0239897221326828, -0.13545899093151093, -0.2077462077140808, 0.2843072712421417, -0.10837794840335846, -0.10154836624860764, -0.043080538511276245, 0.00450741034001112, 0.19054080545902252, -0.2036779820919037, 0.07662305235862732, -0.06798196583986282, -0.5908728837966919, 0.3166816830635071, -0.11556805670261383, 0.19390535354614258, 0.24635416269302368, -0.01831209659576416, 0.2436409443616867, -0.3448987305164337, 0.06171789765357971, -0.3118148744106293, -0.3395630121231079, 0.050840575248003006, -0.17071683704853058, -0.23961611092090607, -0.2705472707748413, -0.0990511104464531, 0.22304506599903107, -0.3542741537094116, -0.4335818290710449, -0.47464293241500854, -0.358854204416275, 0.0914301723241806, -0.38130196928977966, 0.2726810872554779, 0.24305357038974762, -0.19775240123271942, -0.0822443813085556, -0.09031903743743896, -0.10702510178089142, 0.18728601932525635, -0.03782626986503601, 0.06172774359583855, -0.032743826508522034, 0.024956703186035156, 0.17551246285438538, 0.08788838982582092, 0.4012888967990875, 0.33348965644836426, 0.6497315168380737, -0.055652372539043427, 0.5408890247344971, -0.15039098262786865, -0.5627368688583374, 0.08639954775571823, 0.13214169442653656, 0.20490030944347382, 0.24677971005439758, 0.1355486810207367, 0.46822571754455566, 0.014985702931880951, -0.5805757641792297, -0.06535160541534424, -0.3881623446941376, -0.05015171319246292, 0.12152501940727234, -0.1809457540512085, -0.028845293447375298, 0.07205849140882492, -0.10949404537677765, 0.04329338297247887, 0.13804900646209717, 0.18938469886779785, -0.18121075630187988, 0.12779666483402252, 0.018253546208143234, -0.15809349715709686, -0.4563157558441162, 0.31239932775497437, -0.0009991941042244434, 0.16157999634742737, 0.035719651728868484, 0.013956189155578613, -0.05888509750366211, -0.13539956510066986, 0.7127633094787598, 0.19294479489326477, 0.14963948726654053, 0.04548102989792824, -0.060802169144153595, -0.4285811483860016, 0.011545434594154358, -0.13918866217136383, 0.26109156012535095, 0.13227196037769318, 0.7915903925895691, -0.27807995676994324, -0.32777202129364014, 0.04455646872520447, -0.10050707310438156, -0.05300353094935417, -0.01247800700366497, -0.1875302642583847, -0.3532647490501404, -0.3457697629928589, 0.16658732295036316, 0.27374958992004395, 0.44049182534217834, 0.17660829424858093, -0.07339853048324585, 0.11491115391254425, -0.31394362449645996, 0.12021777033805847, -0.030189184471964836, 0.28481513261795044, 0.0427703894674778, 0.09459139406681061, 0.09565754234790802, 0.07313446700572968, 0.273734986782074, 0.5773619413375854, 0.011500338092446327, -0.04410389065742493, 0.08564120531082153, -0.02171766757965088, 0.030055902898311615, 0.41892337799072266, -0.13285918533802032, 0.45868733525276184, -0.24385643005371094, 0.552969217300415, -0.4376712441444397, 0.14389699697494507, 0.26758232712745667, 0.0617944672703743, -0.12129046767950058, 0.26459670066833496, 0.49912407994270325, -0.11761395633220673, -0.032964278012514114, 0.3492910861968994, 0.9143888354301453, -0.37284737825393677, 0.016397159546613693, -0.012830711901187897, 0.7705563902854919, 0.17082953453063965, 0.1988655924797058, -0.07677286118268967, -0.2803794741630554, 0.5541820526123047, -0.12914589047431946, -0.047608114778995514, -0.33029791712760925, -0.41012439131736755, 0.11534292995929718, -0.0007726624608039856, 0.2368740737438202, -0.13862024247646332, -0.3038235604763031, 0.20552033185958862, 0.12320871651172638, 0.35612931847572327, -0.32631486654281616, 0.08256261050701141, -0.7069793939590454, -0.23488691449165344, -0.310264527797699, 0.18527747690677643, -0.15033799409866333, 0.1910523772239685, -0.173854798078537, 0.029065115377306938, 0.16735181212425232, -0.5926737785339355, -0.3402394950389862, -0.24036246538162231, -0.11531741172075272, 0.14002077281475067, 0.20882293581962585, 0.19770561158657074, 0.17900633811950684, -0.02976653352379799, 0.3528679609298706, 0.2638993263244629, -0.36788734793663025, 0.08722858875989914, -0.14842680096626282, 0.06009969860315323, -0.14313331246376038, 0.04067128524184227, 0.15929095447063446, -0.09066609293222427, -0.2259868085384369, -0.2774517834186554, 0.1654776930809021, -0.1732574999332428, -0.2392241507768631, 0.12127265334129333, -0.24970181286334991, -0.20947915315628052, -0.09395590424537659, -0.05034850537776947, -0.03969204053282738, -0.33815667033195496, 0.09577102959156036, 0.04739990830421448, -0.2591702938079834, 0.021084140986204147, -0.005218051373958588, -0.10337914526462555, -0.09608949720859528, 0.4719967544078827, -0.03661224991083145, 0.06569623202085495, 0.318065345287323, 0.009028885513544083, -0.06408500671386719, -0.21249324083328247, 0.3238265812397003, 0.3032984137535095, -0.5272032022476196, 0.33166131377220154, -0.1853839010000229, -0.16645003855228424, -0.08050833642482758, 0.3687116503715515, 0.2910924553871155, 0.011797476559877396, 0.11840634047985077, -0.28307297825813293, -0.4017428755760193, 0.28426891565322876, -0.1751938760280609, 0.19536781311035156, 0.09312794357538223, 0.09361518919467926, 0.06491699814796448, 0.15035001933574677, -0.3362129330635071, 0.3249773383140564, -0.38678890466690063, -0.07984648644924164, -0.20901241898536682, -0.07204193621873856, 0.2278006225824356, -0.11506383121013641, 0.11925917863845825, 0.42695969343185425, -0.26718270778656006, -0.21558493375778198, -0.2603864371776581, 0.11076340824365616, -0.032945796847343445, -0.04960617423057556, 0.09299014508724213, 0.15312524139881134, -0.07181279361248016, -0.17572319507598877, 0.2101060003042221, 0.24179255962371826, 0.18269720673561096, 0.25419336557388306, 0.42425408959388733, -0.10056217759847641, 0.16936293244361877, 0.012775406241416931, 0.31276559829711914, 0.3213547468185425, -0.1602393537759781, 0.0821804329752922, -0.21896745264530182, -0.07317899912595749, 0.011453902348876, 0.3004700243473053, 0.04340016096830368, -0.03305254876613617, 0.020284879952669144, -0.12536802887916565, -0.20041167736053467, 0.12427781522274017, 0.46983152627944946, 0.06130680441856384, -0.3290020823478699, 0.0042756665498018265, 0.15599161386489868, 0.2073802649974823, -0.25898757576942444, -0.16074751317501068, 0.22111238539218903, -0.016113027930259705, 0.01920131966471672, 0.21897020936012268, 0.1979159712791443, 0.05676649510860443, 0.19071334600448608, 0.0711975172162056, 0.17952463030815125, -0.06513296812772751, 0.1174771785736084, 0.235343798995018, -0.0854923278093338, -0.11400997638702393, 0.32187947630882263, 0.059036895632743835, 0.3523416817188263, 0.5697306990623474, -0.3480817973613739, 0.2966875433921814, -0.4005855321884155, -0.03567017987370491, 0.46787387132644653, -0.5337770581245422, 0.17089888453483582, 0.116327203810215, -0.1366358995437622, 0.07163003087043762, -0.2632673978805542, 0.47507238388061523, -0.40466779470443726, -0.3167381286621094, -0.25165486335754395, -0.04002165421843529, -0.3411595821380615, -0.13020265102386475, 0.3370123505592346, -0.1793089210987091, -0.2843259572982788, -0.011967925354838371, -0.039058852940797806, -0.2612575888633728, 0.19953198730945587, -0.18116648495197296, -0.13772310316562653, -0.2941572070121765, 0.015547020360827446, 0.29454097151756287, 0.2267237901687622, -0.28121158480644226, 0.20722411572933197, 0.39812612533569336, -0.0445704460144043, 0.10949350893497467, 0.5412570238113403, 0.47692546248435974, 0.17048996686935425, 0.002252833917737007, 0.10934103280305862, 0.08206158876419067, 0.0985625833272934, -0.07016058266162872, 0.03755023702979088, 0.11699046194553375, 0.3187955915927887, 0.4076593816280365, 0.11667211353778839, -0.20736996829509735, 0.02354641817510128, -0.14245153963565826, 0.42876699566841125, -0.38966843485832214, 0.3129049241542816, -0.439007043838501, 0.14100772142410278, 0.004080204293131828, 0.08992433547973633, -0.6673996448516846, -0.0603923425078392, 0.12275421619415283, 0.002743649994954467, 0.23800653219223022, -0.23826482892036438, 0.08398628234863281, 0.04709429293870926, 0.5631192326545715, 0.24456264078617096, -0.05452589690685272, -0.16049255430698395, -0.18129098415374756, -0.502889096736908, 0.19278386235237122, 0.04908868670463562, 0.0001973900943994522, 0.1304587572813034, 0.08280743658542633, -0.031021788716316223, -0.28002065420150757, 0.3240046501159668, -0.04967993497848511, 0.11314281076192856, -0.11140623688697815, -0.10181137919425964, -0.09754528105258942, 0.02780437469482422, -0.3653867840766907, 0.22966256737709045, -0.17667248845100403, 0.3321205675601959, -0.07300221920013428, 0.022454366087913513, -0.0515594407916069, 0.26541757583618164, 0.06259720027446747, -0.37935030460357666, 0.12672902643680573, 0.19323496520519257, 0.01317838579416275, -0.1904451549053192, -0.14098703861236572, -0.1950128972530365, -0.10512451082468033, -0.23678086698055267, -0.1418534517288208, 0.0024304091930389404, 0.5640730857849121, -0.2877597212791443, -0.5516729354858398, -0.23252199590206146, 0.2454569935798645, 0.08017419278621674, 0.051082026213407516, -0.009600123390555382, 0.44143304228782654, 0.01223408430814743, -0.07055655866861343, 0.223651722073555, 0.4789635241031647, -0.07215283811092377, 0.2750311493873596, -0.26943716406822205, -0.4529365003108978, 0.619759202003479, -0.12635090947151184, -0.2697228491306305, -0.1744885891675949, 0.3959294557571411, 0.4394240081310272, -0.5136658549308777, -0.6469372510910034, -0.09127707034349442, 0.21740062534809113, 0.2001359462738037, -0.3100565969944, 0.37116268277168274, -0.3209860026836395, -0.14555871486663818, 0.07568930089473724, 0.1494593322277069, 0.26257142424583435, -0.2122037708759308, 0.5300187468528748, -0.15941980481147766 ]
https://github.com/huggingface/datasets/issues/6446
Speech Commands v2 dataset doesn't match AST-v2 config
You can use `.align_labels_with_mapping` on the dataset to align the labels with the model config. Regarding the number of labels, only the special `_silence_` label corresponding to noise is missing, which is consistent with the model paper (reports training on 35 labels). You can run a `.filter` to drop it. PS: You should create a discussion on a model/dataset repo (on the Hub) for these kinds of questions
### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3
68
Speech Commands v2 dataset doesn't match AST-v2 config ### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3 You can use `.align_labels_with_mapping` on the dataset to align the labels with the model config. Regarding the number of labels, only the special `_silence_` label corresponding to noise is missing, which is consistent with the model paper (reports training on 35 labels). You can run a `.filter` to drop it. PS: You should create a discussion on a model/dataset repo (on the Hub) for these kinds of questions
[ -0.1874723881483078, -0.40251079201698303, -0.002486320212483406, 0.5321387052536011, 0.23339547216892242, 0.21374231576919556, 0.22850123047828674, 0.29725173115730286, -0.3711093068122864, -0.07165190577507019, -0.11736635863780975, 0.27156171202659607, -0.22551622986793518, -0.10736696422100067, 0.13778388500213623, -0.21275386214256287, -0.03241867572069168, -0.1579209566116333, 0.020023677498102188, -0.32153743505477905, 0.0682491883635521, 0.36392471194267273, -0.11825104057788849, 0.18401512503623962, -0.21402782201766968, 0.2367953509092331, 0.26778438687324524, 0.021139081567525864, 0.06792503595352173, -0.25001639127731323, 0.23720254004001617, -0.2993248403072357, 0.18559050559997559, 0.7066993117332458, -0.00011181063018739223, 0.03461947292089462, -0.14995542168617249, -0.2054494470357895, -0.23061220347881317, -0.18468408286571503, 0.29485371708869934, 0.16826649010181427, -0.10365667194128036, 0.10528977960348129, -0.4541127681732178, 0.04939508065581322, -0.03773356229066849, 0.1154019683599472, 0.18259763717651367, 0.3578493595123291, 0.19933801889419556, 0.060868583619594574, 0.08625079691410065, 0.037369050085544586, -0.04976219683885574, -0.1546822488307953, 0.09196572750806808, -0.008579442277550697, -0.04921676218509674, 0.20674249529838562, -0.059649206697940826, 0.3764401376247406, -0.019718900322914124, 0.023706795647740364, 0.13446743786334991, -0.20642440021038055, -0.2614489197731018, -0.3369351923465729, 0.07093435525894165, 0.2628128230571747, 0.3486270010471344, -0.34787458181381226, -0.22268053889274597, -0.25966402888298035, 0.01999484747648239, -0.20791026949882507, 0.03577243909239769, 0.15141494572162628, -0.04662022739648819, 0.37567150592803955, 0.006890108808875084, 0.050160832703113556, -0.3149614632129669, 0.07879707962274551, 0.17177215218544006, 0.23924799263477325, 0.005468266550451517, 0.07691041380167007, -0.1853434145450592, -0.22686509788036346, -0.13666094839572906, 0.2782282829284668, -0.05358819290995598, 0.205792635679245, -0.5201445817947388, -0.12859413027763367, 0.004721477627754211, -0.21186625957489014, 0.20866996049880981, -0.07009602338075638, 0.3701624572277069, 0.12863826751708984, -0.025193672627210617, -0.12624958157539368, -0.038686323910951614, 0.5110991597175598, 0.36846765875816345, 0.5599428415298462, -0.0398169681429863, -0.005548593122512102, -0.257739782333374, 0.15620046854019165, -0.14446288347244263, -0.20922145247459412, -0.04382918402552605, 0.041806891560554504, 0.01860598847270012, -0.3463193476200104, -0.509491503238678, 0.24356253445148468, -0.28857138752937317, -0.1067512258887291, 0.09892802685499191, 0.23411434888839722, -0.09588893502950668, 0.1295734941959381, 0.2651784420013428, -0.023061130195856094, -0.18521708250045776, -0.3946678936481476, -0.12286271154880524, -0.10080964863300323, -0.10272850096225739, -0.02858242206275463, -0.0035302750766277313, 0.14297926425933838, 0.43389126658439636, -0.006479380652308464, 0.11070270091295242, -0.008214712142944336, -0.29655683040618896, 0.11449600756168365, 0.16677218675613403, 0.20062123239040375, -0.32617348432540894, 0.21699674427509308, 0.05020623281598091, 0.22912733256816864, -0.02281390130519867, 0.009943503886461258, -0.2640879154205322, -0.04855935275554657, 0.04543197527527809, 0.24194444715976715, -0.028936628252267838, -0.17795270681381226, 0.3025106191635132, 0.3098267614841461, 0.41348668932914734, -0.09888529032468796, 0.11975663900375366, -0.38658684492111206, -0.3835849165916443, -0.16747932136058807, 0.08145231753587723, 0.12241852283477783, -0.26703590154647827, -0.29431140422821045, 0.27851423621177673, 0.2711247503757477, -0.0013166368007659912, 0.260315477848053, -0.044722214341163635, 0.27066051959991455, -0.15112245082855225, -0.047657400369644165, 0.3246663510799408, -0.29750552773475647, -0.678989589214325, -0.24532043933868408, -0.033043600618839264, 0.16498912870883942, 0.0744742900133133, 0.02970416657626629, 0.19152027368545532, -0.022291095927357674, 0.48981690406799316, 0.013244293630123138, 0.18720518052577972, -0.19115617871284485, -0.41421180963516235, -0.1304248720407486, 0.19006602466106415, 0.1676504909992218, -0.14964841306209564, -0.05224774032831192, -0.2445065677165985, -0.08443176001310349, 0.33189207315444946, -0.006104577332735062, -0.0993669405579567, 0.14810679852962494, -0.1535431444644928, 0.10736178606748581, 0.36177676916122437, -0.19590908288955688, -0.43227946758270264, 0.28171777725219727, 0.05213639885187149, 0.2161695510149002, 0.41168755292892456, 0.10634440183639526, -0.13713376224040985, -0.35510942339897156, -0.169317364692688, -0.45069605112075806, 0.16320228576660156, 0.3238028287887573, -0.04858233034610748, -0.41639629006385803, -0.23879672586917877, 0.2459978610277176, -0.3743211328983307, 0.1338035762310028, -0.09387344121932983, -0.0238842461258173, -0.21181805431842804, -0.07623285055160522, 0.03514403849840164, 0.15373337268829346, 0.26368799805641174, -0.09741287678480148, -0.05912601202726364, 0.25766974687576294, -0.07956252992153168, -0.28052961826324463, -0.37512820959091187, 0.18274055421352386, 0.2516777813434601, -0.42653340101242065, -0.1391361504793167, 0.35914427042007446, -0.0999806821346283, -0.018807854503393173, -0.033317022025585175, 0.33247143030166626, 0.38880908489227295, -0.16151568293571472, -0.024120915681123734, 0.060242608189582825, 0.09831023216247559, -0.028904305770993233, -0.17033149302005768, 0.07471330463886261, 0.4811880588531494, -0.2024364173412323, 0.16135507822036743, 0.10182573646306992, -0.47402119636535645, 0.265428751707077, 0.5754410028457642, -0.009575087577104568, 0.03951103240251541, 0.30594322085380554, -0.2503015995025635, 0.14103183150291443, -0.020727673545479774, -0.05951366573572159, 0.04694422334432602, 0.3015442490577698, -0.28387099504470825, 0.008005773648619652, -0.4834320843219757, -0.06987850368022919, 0.0818314328789711, -0.05504202842712402, -0.054859548807144165, 0.2542888820171356, 0.09591851383447647, 0.2127707600593567, -0.23139935731887817, -0.1120111495256424, -0.15888935327529907, 0.2725940942764282, -0.6390705108642578, 0.04636207967996597, -0.09651662409305573, 0.2441374957561493, -0.12991374731063843, -0.20568786561489105, -0.27273058891296387, 0.272354394197464, 0.2093723565340042, -0.15933530032634735, -0.07458334416151047, 0.397137314081192, 0.0711098164319992, 0.19569696485996246, 0.19242610037326813, -0.2543761134147644, 0.21384581923484802, -0.07733043283224106, -0.3447573482990265, 0.05173351243138313, 0.0782412737607956, -0.4440632462501526, 0.0736173689365387, -0.08874925225973129, -0.41558653116226196, 0.08322703838348389, -0.35133567452430725, 0.1575077772140503, -0.26012206077575684, 0.262629896402359, 0.18439051508903503, 0.028724804520606995, -0.06684161722660065, -0.05210473760962486, -0.08448539674282074, 0.047327734529972076, -0.3325464725494385, -0.10915035009384155, 0.11942518502473831, -0.19033664464950562, -0.04923760145902634, -0.6160710453987122, 0.16853460669517517, -0.22286686301231384, 0.013533636927604675, 0.1912689059972763, 0.30029410123825073, 0.6105599403381348, 0.022024784237146378, -0.018208228051662445, 0.09187435358762741, 0.4837002754211426, -0.4225393831729889, -0.2995116114616394, 0.26985326409339905, -0.048225805163383484, -0.3371678292751312, -0.24056804180145264, 0.13719168305397034, 0.1921941190958023, -0.11462677270174026, -0.14057794213294983, 0.04353152588009834, -0.23777489364147186, 0.178599014878273, -0.22889381647109985, -0.0019983667880296707, 0.3463228940963745, 0.03183272108435631, 0.14219188690185547, -0.3594570755958557, -0.4303467273712158, 0.6389918327331543, 0.30922746658325195, 0.30736222863197327, -0.25475800037384033, 0.15792477130889893, -0.12449291348457336, 0.5327120423316956, 0.15398834645748138, -0.4025740921497345, -0.10610906779766083, -0.10159493237733841, -0.020407389849424362, -0.04426533728837967, -0.23439453542232513, 0.2628772556781769, 0.06334657967090607, -0.02799905836582184, 0.41049134731292725, -0.15548014640808105, 0.04636959731578827, -0.06940213590860367, 0.19382786750793457, -0.17008474469184875, -0.03958176448941231, -0.028844820335507393, -0.20013344287872314, 0.10988010466098785, 0.03307719528675079, 0.33370184898376465, 0.07887691259384155, -0.07326303422451019, 0.28818467259407043, -0.06527560949325562, -0.09236719459295273, 0.12838873267173767, -0.405568391084671, 0.031832579523324966, -0.11045355349779129, 0.23206917941570282, 0.18012452125549316, 0.35010722279548645, -0.18844904005527496, -0.27942562103271484, -0.15296803414821625, 0.2535672187805176, 0.5257295966148376, -0.4384392499923706, 0.25092166662216187, 0.19532933831214905, 0.48513150215148926, -0.20916017889976501, -0.17733845114707947, -0.1078796535730362, -0.056814685463905334, 0.2817244231700897, 0.023252364248037338, -0.2003653198480606, -0.05875362455844879, 0.22501486539840698, 0.2245677262544632, -0.17522551119327545, 0.1962180733680725, -0.16321498155593872, 0.010286379605531693, -0.03357315808534622, 0.11101733148097992, 0.2534870207309723, 0.13700121641159058, -0.19475975632667542, 0.25290045142173767, 0.10101016610860825, -0.14494653046131134, 0.3617585301399231, 0.23349474370479584, 0.44503292441368103, 0.09647729247808456, 0.17447783052921295, 0.40271785855293274, 0.31147801876068115, 0.15362660586833954, 0.6320443153381348, -0.3047899007797241, -0.5308440923690796, -0.012398727238178253, 0.13576652109622955, 0.1477826088666916, 0.3082343339920044, 0.10069938004016876, -0.020370937883853912, -0.2021612524986267, 0.023600954562425613, 0.006346072070300579, 0.10394513607025146, 0.19152173399925232, 0.3463391661643982, -0.3271390497684479, -0.40482214093208313, 0.3001936376094818, -0.24853509664535522, -0.15572598576545715, 0.27144742012023926, -0.22536785900592804, -0.514008104801178, 0.4977107644081116, 0.06474463641643524, 0.9458175301551819, 0.31363850831985474, 0.25790122151374817, 0.10744494199752808, -0.10584560036659241, 0.2656972408294678, -0.2069849669933319, 0.3374846577644348, -0.34298813343048096, -0.04579529911279678, -0.0038903262466192245, 0.02405497059226036, -0.1380637288093567, 0.2588006556034088, -0.2322184145450592, 0.309702068567276, -0.09306026250123978, 0.10140202194452286, 0.2189643383026123, 0.04224497079849243, 0.4247738718986511, -0.10351704061031342, -0.04148652032017708, 0.1352035403251648, -0.15467269718647003, 0.3546368479728699, -0.013250291347503662, -0.04145600274205208, -0.2145126909017563, -0.33343714475631714, -0.36370527744293213, -0.003672949969768524, -0.5523010492324829, -0.18592387437820435, 0.13873423635959625, -0.35140150785446167, 0.22197462618350983, 0.33282470703125, 0.4275965690612793, 0.0030208565294742584, -0.056025661528110504, 0.29122114181518555, 0.21540597081184387, 0.2818811535835266, 0.19416113197803497, -0.10132517665624619, 0.566106915473938, 0.05246640741825104, -0.09004506468772888, 0.024862036108970642, 0.12331391870975494, -0.06793183833360672, -0.24061405658721924, -0.15043531358242035, 0.30133381485939026, -0.37447625398635864, 0.026702430099248886, 0.03189626336097717, -0.10592453181743622, -0.34506461024284363, 0.13663169741630554, -0.11825716495513916, -0.5008187890052795, 0.05343450605869293, 0.2906448245048523, -0.35922345519065857, -0.046267662197351456, 0.3829291760921478, 0.0483868308365345, -0.010964632034301758, 0.4170628488063812, 0.22907604277133942, 0.04323183745145798, -0.21739572286605835, -0.005714144557714462, 0.13402773439884186, -0.44442427158355713, 0.1328677535057068, -0.17794311046600342, -0.25012195110321045, -0.07606703788042068, 0.3356223404407501, 0.3807278871536255, 0.16999401152133942, -0.08066363632678986, -0.08444298803806305, -0.40943998098373413, -0.08901165425777435, -0.09090504050254822, 0.1369916796684265, -0.23710647225379944, 0.22911636531352997, 0.16382040083408356, -0.021897776052355766, -0.3707801401615143, -0.11201522499322891, 0.06361689418554306, 0.1862337738275528, 0.10505825281143188, -0.11286105960607529, 0.18681709468364716, -0.044767893850803375, 0.13544633984565735, -0.08871983736753464, 0.006142261903733015, -0.20423758029937744, -0.334195077419281, 0.05792173743247986, -0.037313006818294525, 0.12123963981866837, -0.16736574470996857, 0.023145072162151337, -0.08074821531772614, -0.04236100986599922, 0.09946061670780182, 0.22072982788085938, 0.14343899488449097, 0.5454069972038269, -0.2115212231874466, -0.16402828693389893, 0.24819882214069366, -0.24143674969673157, -0.0752871185541153, -0.05813886225223541, 0.2792859673500061, 0.11589638143777847, -0.10194287449121475, -0.06584036350250244, -0.02921035885810852, 0.21233844757080078, -0.1767340451478958, -0.02510978654026985, -0.11390987783670425, -0.21334265172481537, -0.058212630450725555, 0.30544015765190125, 0.09403417259454727, 0.1868475377559662, -0.3625422418117523, -0.19091972708702087, 0.08673732727766037, 0.22299440205097198, -0.32102614641189575, -0.15528342127799988, -0.03699864447116852, -0.14772547781467438, -0.07565285265445709, 0.15245100855827332, -0.08192463219165802, -0.031647760421037674, -0.16751858592033386, 0.24267619848251343, 0.2238588184118271, -0.12515993416309357, 0.38891762495040894, 0.6300967931747437, -0.013213977217674255, -0.0014847815036773682, 0.46087366342544556, -0.23339232802391052, 0.21860721707344055, 0.35830944776535034, 0.10365226119756699, 0.17515593767166138, 0.23973917961120605, 0.17979441583156586, 0.2179071307182312, -0.0423811636865139, -0.07957319915294647, 0.1620534211397171, 0.03233305364847183, 0.2464343011379242, -0.14517922699451447, 0.07989145815372467, -0.011869600974023342, -0.4321341812610626, -0.058075085282325745, -0.0407102145254612, -0.3667944669723511, -0.14810237288475037, -0.25075727701187134, -0.15770500898361206, -0.011477969586849213, -0.012584183365106583, -0.21623405814170837, -0.11155234277248383, 0.11464639753103256, -0.010778605937957764, -0.4425259828567505, -0.254434198141098, -0.3824928104877472, 0.16878250241279602, 0.072200708091259, -0.1938730776309967, 0.5081456899642944, 0.023154757916927338, -0.32812514901161194, 0.09654111415147781, 0.24354484677314758, 0.2006162703037262, 0.12581011652946472, -0.15797899663448334, -0.03007427230477333, 0.12327016890048981, 0.13329823315143585, -0.0076445844024419785, 0.17206351459026337, -0.03692111372947693, -0.3985975384712219, 0.2893161177635193, 0.08407715708017349, -0.13293449580669403, 0.15998999774456024, 0.0017903894186019897, 0.1165412962436676, -0.2430967539548874, 0.22067248821258545, -0.10221502184867859, -0.1185847744345665, -0.3021388351917267, 0.09629043936729431, -0.2569432854652405, -0.05084986612200737, 0.3596380650997162, 0.21621619164943695, 0.14708605408668518, -0.1464976817369461, 0.12010684609413147, 0.03074321523308754, 0.44073936343193054, 0.21591143310070038, -0.19378426671028137, -0.1370149552822113, 0.008255831897258759, -0.31161537766456604, 0.03151597082614899, 0.1790609210729599, -0.019934047013521194, 0.044054076075553894, 0.14520184695720673, 0.23795461654663086, -0.09593647718429565, 0.31836867332458496, -0.14525258541107178, -0.002611127682030201, 0.17329305410385132, -0.23273234069347382, 0.20898689329624176, -0.11876781284809113, 0.3971730172634125, 0.2685633897781372, -0.25129497051239014, -0.0016637705266475677, -0.07299508154392242, 0.0057478658854961395, -0.02369460090994835, 0.04750385880470276, 0.10782565176486969, -0.09277884662151337, 0.3215654492378235, 0.012712107971310616, 0.3375680446624756, -0.09768753498792648, -0.1016843318939209, -0.18653163313865662, -0.29642626643180847, -0.5026464462280273, 0.20269745588302612, -0.12379364669322968, 0.5800327062606812, -0.08923988789319992, -0.20606769621372223, -0.19132979214191437, 0.03812475875020027, 0.41297388076782227, -0.28089916706085205, -0.3800545334815979, 0.1765291392803192, -0.12255989015102386, -0.003902984084561467, 0.06794370710849762, 0.429164856672287, -0.07805120944976807, 0.06363612413406372, -0.4130867123603821, -0.48456740379333496, 0.677059531211853, -0.2093379646539688, -0.17181077599525452, -0.04731656610965729, 0.25346776843070984, 0.2111448049545288, -0.14826825261116028, -0.65752112865448, -0.12531490623950958, 0.4363803565502167, -0.08841370046138763, -0.3597204089164734, 0.247611403465271, -0.10433155298233032, 0.07654550671577454, 0.03407813981175423, 0.2886316776275635, 0.2977706789970398, -0.3693062961101532, 0.09994758665561676, -0.3544815182685852 ]
https://github.com/huggingface/datasets/issues/6446
Speech Commands v2 dataset doesn't match AST-v2 config
Thanks, will keep that in mind. But I tried running `dataset_aligned = dataset.align_labels_with_mapping(model.config.id2label, 'label')`, and received this error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5928, in align_labels_with_mapping label2id = {k.lower(): v for k, v in label2id.items()} File "/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5928, in <dictcomp> label2id = {k.lower(): v for k, v in label2id.items()} AttributeError: 'int' object has no attribute 'lower' ``` My guess is that the dataset `label` column is purely an int ID, and I'm not sure there's a way to identify which class label the ID belongs to in the dataset easily.
### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3
101
Speech Commands v2 dataset doesn't match AST-v2 config ### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3 Thanks, will keep that in mind. But I tried running `dataset_aligned = dataset.align_labels_with_mapping(model.config.id2label, 'label')`, and received this error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5928, in align_labels_with_mapping label2id = {k.lower(): v for k, v in label2id.items()} File "/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5928, in <dictcomp> label2id = {k.lower(): v for k, v in label2id.items()} AttributeError: 'int' object has no attribute 'lower' ``` My guess is that the dataset `label` column is purely an int ID, and I'm not sure there's a way to identify which class label the ID belongs to in the dataset easily.
[ -0.1874723881483078, -0.40251079201698303, -0.002486320212483406, 0.5321387052536011, 0.23339547216892242, 0.21374231576919556, 0.22850123047828674, 0.29725173115730286, -0.3711093068122864, -0.07165190577507019, -0.11736635863780975, 0.27156171202659607, -0.22551622986793518, -0.10736696422100067, 0.13778388500213623, -0.21275386214256287, -0.03241867572069168, -0.1579209566116333, 0.020023677498102188, -0.32153743505477905, 0.0682491883635521, 0.36392471194267273, -0.11825104057788849, 0.18401512503623962, -0.21402782201766968, 0.2367953509092331, 0.26778438687324524, 0.021139081567525864, 0.06792503595352173, -0.25001639127731323, 0.23720254004001617, -0.2993248403072357, 0.18559050559997559, 0.7066993117332458, -0.00011181063018739223, 0.03461947292089462, -0.14995542168617249, -0.2054494470357895, -0.23061220347881317, -0.18468408286571503, 0.29485371708869934, 0.16826649010181427, -0.10365667194128036, 0.10528977960348129, -0.4541127681732178, 0.04939508065581322, -0.03773356229066849, 0.1154019683599472, 0.18259763717651367, 0.3578493595123291, 0.19933801889419556, 0.060868583619594574, 0.08625079691410065, 0.037369050085544586, -0.04976219683885574, -0.1546822488307953, 0.09196572750806808, -0.008579442277550697, -0.04921676218509674, 0.20674249529838562, -0.059649206697940826, 0.3764401376247406, -0.019718900322914124, 0.023706795647740364, 0.13446743786334991, -0.20642440021038055, -0.2614489197731018, -0.3369351923465729, 0.07093435525894165, 0.2628128230571747, 0.3486270010471344, -0.34787458181381226, -0.22268053889274597, -0.25966402888298035, 0.01999484747648239, -0.20791026949882507, 0.03577243909239769, 0.15141494572162628, -0.04662022739648819, 0.37567150592803955, 0.006890108808875084, 0.050160832703113556, -0.3149614632129669, 0.07879707962274551, 0.17177215218544006, 0.23924799263477325, 0.005468266550451517, 0.07691041380167007, -0.1853434145450592, -0.22686509788036346, -0.13666094839572906, 0.2782282829284668, -0.05358819290995598, 0.205792635679245, -0.5201445817947388, -0.12859413027763367, 0.004721477627754211, -0.21186625957489014, 0.20866996049880981, -0.07009602338075638, 0.3701624572277069, 0.12863826751708984, -0.025193672627210617, -0.12624958157539368, -0.038686323910951614, 0.5110991597175598, 0.36846765875816345, 0.5599428415298462, -0.0398169681429863, -0.005548593122512102, -0.257739782333374, 0.15620046854019165, -0.14446288347244263, -0.20922145247459412, -0.04382918402552605, 0.041806891560554504, 0.01860598847270012, -0.3463193476200104, -0.509491503238678, 0.24356253445148468, -0.28857138752937317, -0.1067512258887291, 0.09892802685499191, 0.23411434888839722, -0.09588893502950668, 0.1295734941959381, 0.2651784420013428, -0.023061130195856094, -0.18521708250045776, -0.3946678936481476, -0.12286271154880524, -0.10080964863300323, -0.10272850096225739, -0.02858242206275463, -0.0035302750766277313, 0.14297926425933838, 0.43389126658439636, -0.006479380652308464, 0.11070270091295242, -0.008214712142944336, -0.29655683040618896, 0.11449600756168365, 0.16677218675613403, 0.20062123239040375, -0.32617348432540894, 0.21699674427509308, 0.05020623281598091, 0.22912733256816864, -0.02281390130519867, 0.009943503886461258, -0.2640879154205322, -0.04855935275554657, 0.04543197527527809, 0.24194444715976715, -0.028936628252267838, -0.17795270681381226, 0.3025106191635132, 0.3098267614841461, 0.41348668932914734, -0.09888529032468796, 0.11975663900375366, -0.38658684492111206, -0.3835849165916443, -0.16747932136058807, 0.08145231753587723, 0.12241852283477783, -0.26703590154647827, -0.29431140422821045, 0.27851423621177673, 0.2711247503757477, -0.0013166368007659912, 0.260315477848053, -0.044722214341163635, 0.27066051959991455, -0.15112245082855225, -0.047657400369644165, 0.3246663510799408, -0.29750552773475647, -0.678989589214325, -0.24532043933868408, -0.033043600618839264, 0.16498912870883942, 0.0744742900133133, 0.02970416657626629, 0.19152027368545532, -0.022291095927357674, 0.48981690406799316, 0.013244293630123138, 0.18720518052577972, -0.19115617871284485, -0.41421180963516235, -0.1304248720407486, 0.19006602466106415, 0.1676504909992218, -0.14964841306209564, -0.05224774032831192, -0.2445065677165985, -0.08443176001310349, 0.33189207315444946, -0.006104577332735062, -0.0993669405579567, 0.14810679852962494, -0.1535431444644928, 0.10736178606748581, 0.36177676916122437, -0.19590908288955688, -0.43227946758270264, 0.28171777725219727, 0.05213639885187149, 0.2161695510149002, 0.41168755292892456, 0.10634440183639526, -0.13713376224040985, -0.35510942339897156, -0.169317364692688, -0.45069605112075806, 0.16320228576660156, 0.3238028287887573, -0.04858233034610748, -0.41639629006385803, -0.23879672586917877, 0.2459978610277176, -0.3743211328983307, 0.1338035762310028, -0.09387344121932983, -0.0238842461258173, -0.21181805431842804, -0.07623285055160522, 0.03514403849840164, 0.15373337268829346, 0.26368799805641174, -0.09741287678480148, -0.05912601202726364, 0.25766974687576294, -0.07956252992153168, -0.28052961826324463, -0.37512820959091187, 0.18274055421352386, 0.2516777813434601, -0.42653340101242065, -0.1391361504793167, 0.35914427042007446, -0.0999806821346283, -0.018807854503393173, -0.033317022025585175, 0.33247143030166626, 0.38880908489227295, -0.16151568293571472, -0.024120915681123734, 0.060242608189582825, 0.09831023216247559, -0.028904305770993233, -0.17033149302005768, 0.07471330463886261, 0.4811880588531494, -0.2024364173412323, 0.16135507822036743, 0.10182573646306992, -0.47402119636535645, 0.265428751707077, 0.5754410028457642, -0.009575087577104568, 0.03951103240251541, 0.30594322085380554, -0.2503015995025635, 0.14103183150291443, -0.020727673545479774, -0.05951366573572159, 0.04694422334432602, 0.3015442490577698, -0.28387099504470825, 0.008005773648619652, -0.4834320843219757, -0.06987850368022919, 0.0818314328789711, -0.05504202842712402, -0.054859548807144165, 0.2542888820171356, 0.09591851383447647, 0.2127707600593567, -0.23139935731887817, -0.1120111495256424, -0.15888935327529907, 0.2725940942764282, -0.6390705108642578, 0.04636207967996597, -0.09651662409305573, 0.2441374957561493, -0.12991374731063843, -0.20568786561489105, -0.27273058891296387, 0.272354394197464, 0.2093723565340042, -0.15933530032634735, -0.07458334416151047, 0.397137314081192, 0.0711098164319992, 0.19569696485996246, 0.19242610037326813, -0.2543761134147644, 0.21384581923484802, -0.07733043283224106, -0.3447573482990265, 0.05173351243138313, 0.0782412737607956, -0.4440632462501526, 0.0736173689365387, -0.08874925225973129, -0.41558653116226196, 0.08322703838348389, -0.35133567452430725, 0.1575077772140503, -0.26012206077575684, 0.262629896402359, 0.18439051508903503, 0.028724804520606995, -0.06684161722660065, -0.05210473760962486, -0.08448539674282074, 0.047327734529972076, -0.3325464725494385, -0.10915035009384155, 0.11942518502473831, -0.19033664464950562, -0.04923760145902634, -0.6160710453987122, 0.16853460669517517, -0.22286686301231384, 0.013533636927604675, 0.1912689059972763, 0.30029410123825073, 0.6105599403381348, 0.022024784237146378, -0.018208228051662445, 0.09187435358762741, 0.4837002754211426, -0.4225393831729889, -0.2995116114616394, 0.26985326409339905, -0.048225805163383484, -0.3371678292751312, -0.24056804180145264, 0.13719168305397034, 0.1921941190958023, -0.11462677270174026, -0.14057794213294983, 0.04353152588009834, -0.23777489364147186, 0.178599014878273, -0.22889381647109985, -0.0019983667880296707, 0.3463228940963745, 0.03183272108435631, 0.14219188690185547, -0.3594570755958557, -0.4303467273712158, 0.6389918327331543, 0.30922746658325195, 0.30736222863197327, -0.25475800037384033, 0.15792477130889893, -0.12449291348457336, 0.5327120423316956, 0.15398834645748138, -0.4025740921497345, -0.10610906779766083, -0.10159493237733841, -0.020407389849424362, -0.04426533728837967, -0.23439453542232513, 0.2628772556781769, 0.06334657967090607, -0.02799905836582184, 0.41049134731292725, -0.15548014640808105, 0.04636959731578827, -0.06940213590860367, 0.19382786750793457, -0.17008474469184875, -0.03958176448941231, -0.028844820335507393, -0.20013344287872314, 0.10988010466098785, 0.03307719528675079, 0.33370184898376465, 0.07887691259384155, -0.07326303422451019, 0.28818467259407043, -0.06527560949325562, -0.09236719459295273, 0.12838873267173767, -0.405568391084671, 0.031832579523324966, -0.11045355349779129, 0.23206917941570282, 0.18012452125549316, 0.35010722279548645, -0.18844904005527496, -0.27942562103271484, -0.15296803414821625, 0.2535672187805176, 0.5257295966148376, -0.4384392499923706, 0.25092166662216187, 0.19532933831214905, 0.48513150215148926, -0.20916017889976501, -0.17733845114707947, -0.1078796535730362, -0.056814685463905334, 0.2817244231700897, 0.023252364248037338, -0.2003653198480606, -0.05875362455844879, 0.22501486539840698, 0.2245677262544632, -0.17522551119327545, 0.1962180733680725, -0.16321498155593872, 0.010286379605531693, -0.03357315808534622, 0.11101733148097992, 0.2534870207309723, 0.13700121641159058, -0.19475975632667542, 0.25290045142173767, 0.10101016610860825, -0.14494653046131134, 0.3617585301399231, 0.23349474370479584, 0.44503292441368103, 0.09647729247808456, 0.17447783052921295, 0.40271785855293274, 0.31147801876068115, 0.15362660586833954, 0.6320443153381348, -0.3047899007797241, -0.5308440923690796, -0.012398727238178253, 0.13576652109622955, 0.1477826088666916, 0.3082343339920044, 0.10069938004016876, -0.020370937883853912, -0.2021612524986267, 0.023600954562425613, 0.006346072070300579, 0.10394513607025146, 0.19152173399925232, 0.3463391661643982, -0.3271390497684479, -0.40482214093208313, 0.3001936376094818, -0.24853509664535522, -0.15572598576545715, 0.27144742012023926, -0.22536785900592804, -0.514008104801178, 0.4977107644081116, 0.06474463641643524, 0.9458175301551819, 0.31363850831985474, 0.25790122151374817, 0.10744494199752808, -0.10584560036659241, 0.2656972408294678, -0.2069849669933319, 0.3374846577644348, -0.34298813343048096, -0.04579529911279678, -0.0038903262466192245, 0.02405497059226036, -0.1380637288093567, 0.2588006556034088, -0.2322184145450592, 0.309702068567276, -0.09306026250123978, 0.10140202194452286, 0.2189643383026123, 0.04224497079849243, 0.4247738718986511, -0.10351704061031342, -0.04148652032017708, 0.1352035403251648, -0.15467269718647003, 0.3546368479728699, -0.013250291347503662, -0.04145600274205208, -0.2145126909017563, -0.33343714475631714, -0.36370527744293213, -0.003672949969768524, -0.5523010492324829, -0.18592387437820435, 0.13873423635959625, -0.35140150785446167, 0.22197462618350983, 0.33282470703125, 0.4275965690612793, 0.0030208565294742584, -0.056025661528110504, 0.29122114181518555, 0.21540597081184387, 0.2818811535835266, 0.19416113197803497, -0.10132517665624619, 0.566106915473938, 0.05246640741825104, -0.09004506468772888, 0.024862036108970642, 0.12331391870975494, -0.06793183833360672, -0.24061405658721924, -0.15043531358242035, 0.30133381485939026, -0.37447625398635864, 0.026702430099248886, 0.03189626336097717, -0.10592453181743622, -0.34506461024284363, 0.13663169741630554, -0.11825716495513916, -0.5008187890052795, 0.05343450605869293, 0.2906448245048523, -0.35922345519065857, -0.046267662197351456, 0.3829291760921478, 0.0483868308365345, -0.010964632034301758, 0.4170628488063812, 0.22907604277133942, 0.04323183745145798, -0.21739572286605835, -0.005714144557714462, 0.13402773439884186, -0.44442427158355713, 0.1328677535057068, -0.17794311046600342, -0.25012195110321045, -0.07606703788042068, 0.3356223404407501, 0.3807278871536255, 0.16999401152133942, -0.08066363632678986, -0.08444298803806305, -0.40943998098373413, -0.08901165425777435, -0.09090504050254822, 0.1369916796684265, -0.23710647225379944, 0.22911636531352997, 0.16382040083408356, -0.021897776052355766, -0.3707801401615143, -0.11201522499322891, 0.06361689418554306, 0.1862337738275528, 0.10505825281143188, -0.11286105960607529, 0.18681709468364716, -0.044767893850803375, 0.13544633984565735, -0.08871983736753464, 0.006142261903733015, -0.20423758029937744, -0.334195077419281, 0.05792173743247986, -0.037313006818294525, 0.12123963981866837, -0.16736574470996857, 0.023145072162151337, -0.08074821531772614, -0.04236100986599922, 0.09946061670780182, 0.22072982788085938, 0.14343899488449097, 0.5454069972038269, -0.2115212231874466, -0.16402828693389893, 0.24819882214069366, -0.24143674969673157, -0.0752871185541153, -0.05813886225223541, 0.2792859673500061, 0.11589638143777847, -0.10194287449121475, -0.06584036350250244, -0.02921035885810852, 0.21233844757080078, -0.1767340451478958, -0.02510978654026985, -0.11390987783670425, -0.21334265172481537, -0.058212630450725555, 0.30544015765190125, 0.09403417259454727, 0.1868475377559662, -0.3625422418117523, -0.19091972708702087, 0.08673732727766037, 0.22299440205097198, -0.32102614641189575, -0.15528342127799988, -0.03699864447116852, -0.14772547781467438, -0.07565285265445709, 0.15245100855827332, -0.08192463219165802, -0.031647760421037674, -0.16751858592033386, 0.24267619848251343, 0.2238588184118271, -0.12515993416309357, 0.38891762495040894, 0.6300967931747437, -0.013213977217674255, -0.0014847815036773682, 0.46087366342544556, -0.23339232802391052, 0.21860721707344055, 0.35830944776535034, 0.10365226119756699, 0.17515593767166138, 0.23973917961120605, 0.17979441583156586, 0.2179071307182312, -0.0423811636865139, -0.07957319915294647, 0.1620534211397171, 0.03233305364847183, 0.2464343011379242, -0.14517922699451447, 0.07989145815372467, -0.011869600974023342, -0.4321341812610626, -0.058075085282325745, -0.0407102145254612, -0.3667944669723511, -0.14810237288475037, -0.25075727701187134, -0.15770500898361206, -0.011477969586849213, -0.012584183365106583, -0.21623405814170837, -0.11155234277248383, 0.11464639753103256, -0.010778605937957764, -0.4425259828567505, -0.254434198141098, -0.3824928104877472, 0.16878250241279602, 0.072200708091259, -0.1938730776309967, 0.5081456899642944, 0.023154757916927338, -0.32812514901161194, 0.09654111415147781, 0.24354484677314758, 0.2006162703037262, 0.12581011652946472, -0.15797899663448334, -0.03007427230477333, 0.12327016890048981, 0.13329823315143585, -0.0076445844024419785, 0.17206351459026337, -0.03692111372947693, -0.3985975384712219, 0.2893161177635193, 0.08407715708017349, -0.13293449580669403, 0.15998999774456024, 0.0017903894186019897, 0.1165412962436676, -0.2430967539548874, 0.22067248821258545, -0.10221502184867859, -0.1185847744345665, -0.3021388351917267, 0.09629043936729431, -0.2569432854652405, -0.05084986612200737, 0.3596380650997162, 0.21621619164943695, 0.14708605408668518, -0.1464976817369461, 0.12010684609413147, 0.03074321523308754, 0.44073936343193054, 0.21591143310070038, -0.19378426671028137, -0.1370149552822113, 0.008255831897258759, -0.31161537766456604, 0.03151597082614899, 0.1790609210729599, -0.019934047013521194, 0.044054076075553894, 0.14520184695720673, 0.23795461654663086, -0.09593647718429565, 0.31836867332458496, -0.14525258541107178, -0.002611127682030201, 0.17329305410385132, -0.23273234069347382, 0.20898689329624176, -0.11876781284809113, 0.3971730172634125, 0.2685633897781372, -0.25129497051239014, -0.0016637705266475677, -0.07299508154392242, 0.0057478658854961395, -0.02369460090994835, 0.04750385880470276, 0.10782565176486969, -0.09277884662151337, 0.3215654492378235, 0.012712107971310616, 0.3375680446624756, -0.09768753498792648, -0.1016843318939209, -0.18653163313865662, -0.29642626643180847, -0.5026464462280273, 0.20269745588302612, -0.12379364669322968, 0.5800327062606812, -0.08923988789319992, -0.20606769621372223, -0.19132979214191437, 0.03812475875020027, 0.41297388076782227, -0.28089916706085205, -0.3800545334815979, 0.1765291392803192, -0.12255989015102386, -0.003902984084561467, 0.06794370710849762, 0.429164856672287, -0.07805120944976807, 0.06363612413406372, -0.4130867123603821, -0.48456740379333496, 0.677059531211853, -0.2093379646539688, -0.17181077599525452, -0.04731656610965729, 0.25346776843070984, 0.2111448049545288, -0.14826825261116028, -0.65752112865448, -0.12531490623950958, 0.4363803565502167, -0.08841370046138763, -0.3597204089164734, 0.247611403465271, -0.10433155298233032, 0.07654550671577454, 0.03407813981175423, 0.2886316776275635, 0.2977706789970398, -0.3693062961101532, 0.09994758665561676, -0.3544815182685852 ]
https://github.com/huggingface/datasets/issues/6446
Speech Commands v2 dataset doesn't match AST-v2 config
Replacing `model.config.id2label` with `model.config.label2id` should fix the issue. So, the full code to align the labels with the model config is as follows: ```python from datasets import load_dataset from transformers import AutoFeatureExtractor, AutoModelForAudioClassification # extractor = AutoFeatureExtractor.from_pretrained("MIT/ast-finetuned-speech-commands-v2") model = AutoModelForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") ds = load_dataset("speech_commands", "v0.02") ds = ds.filter(lambda label: label != ds["train"].features["label"].str2int("_silence_"), input_columns="label") ds = ds.align_labels_with_mapping(model.config.label2id, "label") ```
### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3
57
Speech Commands v2 dataset doesn't match AST-v2 config ### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3 Replacing `model.config.id2label` with `model.config.label2id` should fix the issue. So, the full code to align the labels with the model config is as follows: ```python from datasets import load_dataset from transformers import AutoFeatureExtractor, AutoModelForAudioClassification # extractor = AutoFeatureExtractor.from_pretrained("MIT/ast-finetuned-speech-commands-v2") model = AutoModelForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") ds = load_dataset("speech_commands", "v0.02") ds = ds.filter(lambda label: label != ds["train"].features["label"].str2int("_silence_"), input_columns="label") ds = ds.align_labels_with_mapping(model.config.label2id, "label") ```
[ -0.1874723881483078, -0.40251079201698303, -0.002486320212483406, 0.5321387052536011, 0.23339547216892242, 0.21374231576919556, 0.22850123047828674, 0.29725173115730286, -0.3711093068122864, -0.07165190577507019, -0.11736635863780975, 0.27156171202659607, -0.22551622986793518, -0.10736696422100067, 0.13778388500213623, -0.21275386214256287, -0.03241867572069168, -0.1579209566116333, 0.020023677498102188, -0.32153743505477905, 0.0682491883635521, 0.36392471194267273, -0.11825104057788849, 0.18401512503623962, -0.21402782201766968, 0.2367953509092331, 0.26778438687324524, 0.021139081567525864, 0.06792503595352173, -0.25001639127731323, 0.23720254004001617, -0.2993248403072357, 0.18559050559997559, 0.7066993117332458, -0.00011181063018739223, 0.03461947292089462, -0.14995542168617249, -0.2054494470357895, -0.23061220347881317, -0.18468408286571503, 0.29485371708869934, 0.16826649010181427, -0.10365667194128036, 0.10528977960348129, -0.4541127681732178, 0.04939508065581322, -0.03773356229066849, 0.1154019683599472, 0.18259763717651367, 0.3578493595123291, 0.19933801889419556, 0.060868583619594574, 0.08625079691410065, 0.037369050085544586, -0.04976219683885574, -0.1546822488307953, 0.09196572750806808, -0.008579442277550697, -0.04921676218509674, 0.20674249529838562, -0.059649206697940826, 0.3764401376247406, -0.019718900322914124, 0.023706795647740364, 0.13446743786334991, -0.20642440021038055, -0.2614489197731018, -0.3369351923465729, 0.07093435525894165, 0.2628128230571747, 0.3486270010471344, -0.34787458181381226, -0.22268053889274597, -0.25966402888298035, 0.01999484747648239, -0.20791026949882507, 0.03577243909239769, 0.15141494572162628, -0.04662022739648819, 0.37567150592803955, 0.006890108808875084, 0.050160832703113556, -0.3149614632129669, 0.07879707962274551, 0.17177215218544006, 0.23924799263477325, 0.005468266550451517, 0.07691041380167007, -0.1853434145450592, -0.22686509788036346, -0.13666094839572906, 0.2782282829284668, -0.05358819290995598, 0.205792635679245, -0.5201445817947388, -0.12859413027763367, 0.004721477627754211, -0.21186625957489014, 0.20866996049880981, -0.07009602338075638, 0.3701624572277069, 0.12863826751708984, -0.025193672627210617, -0.12624958157539368, -0.038686323910951614, 0.5110991597175598, 0.36846765875816345, 0.5599428415298462, -0.0398169681429863, -0.005548593122512102, -0.257739782333374, 0.15620046854019165, -0.14446288347244263, -0.20922145247459412, -0.04382918402552605, 0.041806891560554504, 0.01860598847270012, -0.3463193476200104, -0.509491503238678, 0.24356253445148468, -0.28857138752937317, -0.1067512258887291, 0.09892802685499191, 0.23411434888839722, -0.09588893502950668, 0.1295734941959381, 0.2651784420013428, -0.023061130195856094, -0.18521708250045776, -0.3946678936481476, -0.12286271154880524, -0.10080964863300323, -0.10272850096225739, -0.02858242206275463, -0.0035302750766277313, 0.14297926425933838, 0.43389126658439636, -0.006479380652308464, 0.11070270091295242, -0.008214712142944336, -0.29655683040618896, 0.11449600756168365, 0.16677218675613403, 0.20062123239040375, -0.32617348432540894, 0.21699674427509308, 0.05020623281598091, 0.22912733256816864, -0.02281390130519867, 0.009943503886461258, -0.2640879154205322, -0.04855935275554657, 0.04543197527527809, 0.24194444715976715, -0.028936628252267838, -0.17795270681381226, 0.3025106191635132, 0.3098267614841461, 0.41348668932914734, -0.09888529032468796, 0.11975663900375366, -0.38658684492111206, -0.3835849165916443, -0.16747932136058807, 0.08145231753587723, 0.12241852283477783, -0.26703590154647827, -0.29431140422821045, 0.27851423621177673, 0.2711247503757477, -0.0013166368007659912, 0.260315477848053, -0.044722214341163635, 0.27066051959991455, -0.15112245082855225, -0.047657400369644165, 0.3246663510799408, -0.29750552773475647, -0.678989589214325, -0.24532043933868408, -0.033043600618839264, 0.16498912870883942, 0.0744742900133133, 0.02970416657626629, 0.19152027368545532, -0.022291095927357674, 0.48981690406799316, 0.013244293630123138, 0.18720518052577972, -0.19115617871284485, -0.41421180963516235, -0.1304248720407486, 0.19006602466106415, 0.1676504909992218, -0.14964841306209564, -0.05224774032831192, -0.2445065677165985, -0.08443176001310349, 0.33189207315444946, -0.006104577332735062, -0.0993669405579567, 0.14810679852962494, -0.1535431444644928, 0.10736178606748581, 0.36177676916122437, -0.19590908288955688, -0.43227946758270264, 0.28171777725219727, 0.05213639885187149, 0.2161695510149002, 0.41168755292892456, 0.10634440183639526, -0.13713376224040985, -0.35510942339897156, -0.169317364692688, -0.45069605112075806, 0.16320228576660156, 0.3238028287887573, -0.04858233034610748, -0.41639629006385803, -0.23879672586917877, 0.2459978610277176, -0.3743211328983307, 0.1338035762310028, -0.09387344121932983, -0.0238842461258173, -0.21181805431842804, -0.07623285055160522, 0.03514403849840164, 0.15373337268829346, 0.26368799805641174, -0.09741287678480148, -0.05912601202726364, 0.25766974687576294, -0.07956252992153168, -0.28052961826324463, -0.37512820959091187, 0.18274055421352386, 0.2516777813434601, -0.42653340101242065, -0.1391361504793167, 0.35914427042007446, -0.0999806821346283, -0.018807854503393173, -0.033317022025585175, 0.33247143030166626, 0.38880908489227295, -0.16151568293571472, -0.024120915681123734, 0.060242608189582825, 0.09831023216247559, -0.028904305770993233, -0.17033149302005768, 0.07471330463886261, 0.4811880588531494, -0.2024364173412323, 0.16135507822036743, 0.10182573646306992, -0.47402119636535645, 0.265428751707077, 0.5754410028457642, -0.009575087577104568, 0.03951103240251541, 0.30594322085380554, -0.2503015995025635, 0.14103183150291443, -0.020727673545479774, -0.05951366573572159, 0.04694422334432602, 0.3015442490577698, -0.28387099504470825, 0.008005773648619652, -0.4834320843219757, -0.06987850368022919, 0.0818314328789711, -0.05504202842712402, -0.054859548807144165, 0.2542888820171356, 0.09591851383447647, 0.2127707600593567, -0.23139935731887817, -0.1120111495256424, -0.15888935327529907, 0.2725940942764282, -0.6390705108642578, 0.04636207967996597, -0.09651662409305573, 0.2441374957561493, -0.12991374731063843, -0.20568786561489105, -0.27273058891296387, 0.272354394197464, 0.2093723565340042, -0.15933530032634735, -0.07458334416151047, 0.397137314081192, 0.0711098164319992, 0.19569696485996246, 0.19242610037326813, -0.2543761134147644, 0.21384581923484802, -0.07733043283224106, -0.3447573482990265, 0.05173351243138313, 0.0782412737607956, -0.4440632462501526, 0.0736173689365387, -0.08874925225973129, -0.41558653116226196, 0.08322703838348389, -0.35133567452430725, 0.1575077772140503, -0.26012206077575684, 0.262629896402359, 0.18439051508903503, 0.028724804520606995, -0.06684161722660065, -0.05210473760962486, -0.08448539674282074, 0.047327734529972076, -0.3325464725494385, -0.10915035009384155, 0.11942518502473831, -0.19033664464950562, -0.04923760145902634, -0.6160710453987122, 0.16853460669517517, -0.22286686301231384, 0.013533636927604675, 0.1912689059972763, 0.30029410123825073, 0.6105599403381348, 0.022024784237146378, -0.018208228051662445, 0.09187435358762741, 0.4837002754211426, -0.4225393831729889, -0.2995116114616394, 0.26985326409339905, -0.048225805163383484, -0.3371678292751312, -0.24056804180145264, 0.13719168305397034, 0.1921941190958023, -0.11462677270174026, -0.14057794213294983, 0.04353152588009834, -0.23777489364147186, 0.178599014878273, -0.22889381647109985, -0.0019983667880296707, 0.3463228940963745, 0.03183272108435631, 0.14219188690185547, -0.3594570755958557, -0.4303467273712158, 0.6389918327331543, 0.30922746658325195, 0.30736222863197327, -0.25475800037384033, 0.15792477130889893, -0.12449291348457336, 0.5327120423316956, 0.15398834645748138, -0.4025740921497345, -0.10610906779766083, -0.10159493237733841, -0.020407389849424362, -0.04426533728837967, -0.23439453542232513, 0.2628772556781769, 0.06334657967090607, -0.02799905836582184, 0.41049134731292725, -0.15548014640808105, 0.04636959731578827, -0.06940213590860367, 0.19382786750793457, -0.17008474469184875, -0.03958176448941231, -0.028844820335507393, -0.20013344287872314, 0.10988010466098785, 0.03307719528675079, 0.33370184898376465, 0.07887691259384155, -0.07326303422451019, 0.28818467259407043, -0.06527560949325562, -0.09236719459295273, 0.12838873267173767, -0.405568391084671, 0.031832579523324966, -0.11045355349779129, 0.23206917941570282, 0.18012452125549316, 0.35010722279548645, -0.18844904005527496, -0.27942562103271484, -0.15296803414821625, 0.2535672187805176, 0.5257295966148376, -0.4384392499923706, 0.25092166662216187, 0.19532933831214905, 0.48513150215148926, -0.20916017889976501, -0.17733845114707947, -0.1078796535730362, -0.056814685463905334, 0.2817244231700897, 0.023252364248037338, -0.2003653198480606, -0.05875362455844879, 0.22501486539840698, 0.2245677262544632, -0.17522551119327545, 0.1962180733680725, -0.16321498155593872, 0.010286379605531693, -0.03357315808534622, 0.11101733148097992, 0.2534870207309723, 0.13700121641159058, -0.19475975632667542, 0.25290045142173767, 0.10101016610860825, -0.14494653046131134, 0.3617585301399231, 0.23349474370479584, 0.44503292441368103, 0.09647729247808456, 0.17447783052921295, 0.40271785855293274, 0.31147801876068115, 0.15362660586833954, 0.6320443153381348, -0.3047899007797241, -0.5308440923690796, -0.012398727238178253, 0.13576652109622955, 0.1477826088666916, 0.3082343339920044, 0.10069938004016876, -0.020370937883853912, -0.2021612524986267, 0.023600954562425613, 0.006346072070300579, 0.10394513607025146, 0.19152173399925232, 0.3463391661643982, -0.3271390497684479, -0.40482214093208313, 0.3001936376094818, -0.24853509664535522, -0.15572598576545715, 0.27144742012023926, -0.22536785900592804, -0.514008104801178, 0.4977107644081116, 0.06474463641643524, 0.9458175301551819, 0.31363850831985474, 0.25790122151374817, 0.10744494199752808, -0.10584560036659241, 0.2656972408294678, -0.2069849669933319, 0.3374846577644348, -0.34298813343048096, -0.04579529911279678, -0.0038903262466192245, 0.02405497059226036, -0.1380637288093567, 0.2588006556034088, -0.2322184145450592, 0.309702068567276, -0.09306026250123978, 0.10140202194452286, 0.2189643383026123, 0.04224497079849243, 0.4247738718986511, -0.10351704061031342, -0.04148652032017708, 0.1352035403251648, -0.15467269718647003, 0.3546368479728699, -0.013250291347503662, -0.04145600274205208, -0.2145126909017563, -0.33343714475631714, -0.36370527744293213, -0.003672949969768524, -0.5523010492324829, -0.18592387437820435, 0.13873423635959625, -0.35140150785446167, 0.22197462618350983, 0.33282470703125, 0.4275965690612793, 0.0030208565294742584, -0.056025661528110504, 0.29122114181518555, 0.21540597081184387, 0.2818811535835266, 0.19416113197803497, -0.10132517665624619, 0.566106915473938, 0.05246640741825104, -0.09004506468772888, 0.024862036108970642, 0.12331391870975494, -0.06793183833360672, -0.24061405658721924, -0.15043531358242035, 0.30133381485939026, -0.37447625398635864, 0.026702430099248886, 0.03189626336097717, -0.10592453181743622, -0.34506461024284363, 0.13663169741630554, -0.11825716495513916, -0.5008187890052795, 0.05343450605869293, 0.2906448245048523, -0.35922345519065857, -0.046267662197351456, 0.3829291760921478, 0.0483868308365345, -0.010964632034301758, 0.4170628488063812, 0.22907604277133942, 0.04323183745145798, -0.21739572286605835, -0.005714144557714462, 0.13402773439884186, -0.44442427158355713, 0.1328677535057068, -0.17794311046600342, -0.25012195110321045, -0.07606703788042068, 0.3356223404407501, 0.3807278871536255, 0.16999401152133942, -0.08066363632678986, -0.08444298803806305, -0.40943998098373413, -0.08901165425777435, -0.09090504050254822, 0.1369916796684265, -0.23710647225379944, 0.22911636531352997, 0.16382040083408356, -0.021897776052355766, -0.3707801401615143, -0.11201522499322891, 0.06361689418554306, 0.1862337738275528, 0.10505825281143188, -0.11286105960607529, 0.18681709468364716, -0.044767893850803375, 0.13544633984565735, -0.08871983736753464, 0.006142261903733015, -0.20423758029937744, -0.334195077419281, 0.05792173743247986, -0.037313006818294525, 0.12123963981866837, -0.16736574470996857, 0.023145072162151337, -0.08074821531772614, -0.04236100986599922, 0.09946061670780182, 0.22072982788085938, 0.14343899488449097, 0.5454069972038269, -0.2115212231874466, -0.16402828693389893, 0.24819882214069366, -0.24143674969673157, -0.0752871185541153, -0.05813886225223541, 0.2792859673500061, 0.11589638143777847, -0.10194287449121475, -0.06584036350250244, -0.02921035885810852, 0.21233844757080078, -0.1767340451478958, -0.02510978654026985, -0.11390987783670425, -0.21334265172481537, -0.058212630450725555, 0.30544015765190125, 0.09403417259454727, 0.1868475377559662, -0.3625422418117523, -0.19091972708702087, 0.08673732727766037, 0.22299440205097198, -0.32102614641189575, -0.15528342127799988, -0.03699864447116852, -0.14772547781467438, -0.07565285265445709, 0.15245100855827332, -0.08192463219165802, -0.031647760421037674, -0.16751858592033386, 0.24267619848251343, 0.2238588184118271, -0.12515993416309357, 0.38891762495040894, 0.6300967931747437, -0.013213977217674255, -0.0014847815036773682, 0.46087366342544556, -0.23339232802391052, 0.21860721707344055, 0.35830944776535034, 0.10365226119756699, 0.17515593767166138, 0.23973917961120605, 0.17979441583156586, 0.2179071307182312, -0.0423811636865139, -0.07957319915294647, 0.1620534211397171, 0.03233305364847183, 0.2464343011379242, -0.14517922699451447, 0.07989145815372467, -0.011869600974023342, -0.4321341812610626, -0.058075085282325745, -0.0407102145254612, -0.3667944669723511, -0.14810237288475037, -0.25075727701187134, -0.15770500898361206, -0.011477969586849213, -0.012584183365106583, -0.21623405814170837, -0.11155234277248383, 0.11464639753103256, -0.010778605937957764, -0.4425259828567505, -0.254434198141098, -0.3824928104877472, 0.16878250241279602, 0.072200708091259, -0.1938730776309967, 0.5081456899642944, 0.023154757916927338, -0.32812514901161194, 0.09654111415147781, 0.24354484677314758, 0.2006162703037262, 0.12581011652946472, -0.15797899663448334, -0.03007427230477333, 0.12327016890048981, 0.13329823315143585, -0.0076445844024419785, 0.17206351459026337, -0.03692111372947693, -0.3985975384712219, 0.2893161177635193, 0.08407715708017349, -0.13293449580669403, 0.15998999774456024, 0.0017903894186019897, 0.1165412962436676, -0.2430967539548874, 0.22067248821258545, -0.10221502184867859, -0.1185847744345665, -0.3021388351917267, 0.09629043936729431, -0.2569432854652405, -0.05084986612200737, 0.3596380650997162, 0.21621619164943695, 0.14708605408668518, -0.1464976817369461, 0.12010684609413147, 0.03074321523308754, 0.44073936343193054, 0.21591143310070038, -0.19378426671028137, -0.1370149552822113, 0.008255831897258759, -0.31161537766456604, 0.03151597082614899, 0.1790609210729599, -0.019934047013521194, 0.044054076075553894, 0.14520184695720673, 0.23795461654663086, -0.09593647718429565, 0.31836867332458496, -0.14525258541107178, -0.002611127682030201, 0.17329305410385132, -0.23273234069347382, 0.20898689329624176, -0.11876781284809113, 0.3971730172634125, 0.2685633897781372, -0.25129497051239014, -0.0016637705266475677, -0.07299508154392242, 0.0057478658854961395, -0.02369460090994835, 0.04750385880470276, 0.10782565176486969, -0.09277884662151337, 0.3215654492378235, 0.012712107971310616, 0.3375680446624756, -0.09768753498792648, -0.1016843318939209, -0.18653163313865662, -0.29642626643180847, -0.5026464462280273, 0.20269745588302612, -0.12379364669322968, 0.5800327062606812, -0.08923988789319992, -0.20606769621372223, -0.19132979214191437, 0.03812475875020027, 0.41297388076782227, -0.28089916706085205, -0.3800545334815979, 0.1765291392803192, -0.12255989015102386, -0.003902984084561467, 0.06794370710849762, 0.429164856672287, -0.07805120944976807, 0.06363612413406372, -0.4130867123603821, -0.48456740379333496, 0.677059531211853, -0.2093379646539688, -0.17181077599525452, -0.04731656610965729, 0.25346776843070984, 0.2111448049545288, -0.14826825261116028, -0.65752112865448, -0.12531490623950958, 0.4363803565502167, -0.08841370046138763, -0.3597204089164734, 0.247611403465271, -0.10433155298233032, 0.07654550671577454, 0.03407813981175423, 0.2886316776275635, 0.2977706789970398, -0.3693062961101532, 0.09994758665561676, -0.3544815182685852 ]
https://github.com/huggingface/datasets/issues/6443
Trouble loading files defined in YAML explicitly
There is a typo in one of the file names - `data/edf.csv` should be renamed to `data/def.csv` 🙂.
Look at https://huggingface.co/datasets/severo/doc-yaml-2 It's a reproduction of the example given in the docs at https://huggingface.co/docs/hub/datasets-manual-configuration ``` You can select multiple files per split using a list of paths: my_dataset_repository/ ├── README.md ├── data/ │ ├── abc.csv │ └── def.csv └── holdout/ └── ghi.csv --- configs: - config_name: default data_files: - split: train path: - "data/abc.csv" - "data/def.csv" - split: test path: "holdout/ghi.csv" --- ``` It raises the following error: ``` Error code: ConfigNamesError Exception: FileNotFoundError Message: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1507, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ```
18
Trouble loading files defined in YAML explicitly Look at https://huggingface.co/datasets/severo/doc-yaml-2 It's a reproduction of the example given in the docs at https://huggingface.co/docs/hub/datasets-manual-configuration ``` You can select multiple files per split using a list of paths: my_dataset_repository/ ├── README.md ├── data/ │ ├── abc.csv │ └── def.csv └── holdout/ └── ghi.csv --- configs: - config_name: default data_files: - split: train path: - "data/abc.csv" - "data/def.csv" - split: test path: "holdout/ghi.csv" --- ``` It raises the following error: ``` Error code: ConfigNamesError Exception: FileNotFoundError Message: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1507, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ``` There is a typo in one of the file names - `data/edf.csv` should be renamed to `data/def.csv` 🙂.
[ -0.057436753064394, -0.38541874289512634, 0.05792003497481346, 0.3542959690093994, 0.27944880723953247, 0.10894999653100967, 0.41074323654174805, 0.30620765686035156, 0.45095735788345337, 0.07631485909223557, -0.22288596630096436, -0.10569406300783157, 0.04646483436226845, 0.23681877553462982, 0.23977167904376984, 0.19313636422157288, -0.12197759002447128, 0.027714282274246216, -0.12581631541252136, -0.04288746416568756, -0.25666940212249756, 0.3503956198692322, 0.06507907807826996, 0.21023298799991608, -0.5011444687843323, 0.06847407668828964, -0.14979253709316254, 0.5480916500091553, -0.221276193857193, -0.19144712388515472, 0.427914559841156, 0.2900598645210266, 0.11630663275718689, 0.24300140142440796, -0.00012101399624953046, 0.14960898458957672, 0.1706387996673584, -0.17922896146774292, -0.13317328691482544, -0.24597539007663727, -0.2747751474380493, -0.2895318865776062, 0.22113797068595886, -0.17717143893241882, 0.0788164734840393, 0.11275692284107208, 0.02793075516819954, -0.2697960138320923, 0.47990429401397705, 0.21741202473640442, 0.10502904653549194, 0.21660837531089783, 0.06056877598166466, -0.2901768684387207, 0.37168988585472107, 0.2878161668777466, -0.18656785786151886, 0.10371297597885132, 0.39428606629371643, -0.3181924819946289, -0.0070820823311805725, 0.03661524876952171, -0.10472115129232407, -0.20518994331359863, 0.24231308698654175, 0.13775211572647095, 0.19326069951057434, -0.42836233973503113, 0.11776658147573471, 0.48396697640419006, 0.3721814751625061, -0.19691136479377747, -0.43047386407852173, -0.5513537526130676, -0.20505228638648987, -0.0004110783338546753, 0.1543515920639038, 0.24594105780124664, -0.02288186550140381, 0.19005681574344635, -0.2223728448152542, -0.29922670125961304, -0.13951563835144043, 0.3337087035179138, 0.13100939989089966, -0.0808965265750885, -0.08981934934854507, 0.018212851136922836, 0.2839414179325104, 0.032144468277692795, 0.0508374385535717, 0.1425575315952301, -0.02630932256579399, 0.3056505024433136, -0.09184698760509491, 0.1821436733007431, -0.23715656995773315, 0.1833713948726654, 0.47644877433776855, 0.19695822894573212, 0.03420516848564148, 0.09142647683620453, 0.09758874028921127, 0.2593943774700165, 0.3017616868019104, 0.3103305995464325, 0.145158052444458, 0.2236378937959671, 0.11400267481803894, 0.4116436541080475, 0.21906021237373352, -0.1199621930718422, -0.3849954307079315, -0.4627626836299896, -0.3797786235809326, -0.259827584028244, 0.47860413789749146, -0.17886579036712646, -0.4996102452278137, -0.1902841329574585, -0.12446337193250656, -0.11108332127332687, 0.23500138521194458, 0.548258900642395, 0.10811484605073929, -0.24429625272750854, 0.019258055835962296, 0.42603814601898193, -0.4163321554660797, 0.08355645835399628, -0.13417552411556244, 0.34081152081489563, -0.10273067653179169, 0.32962390780448914, 0.3018918037414551, -0.2826635241508484, 0.4809994399547577, -0.0005125114694237709, 0.34133851528167725, -0.3269059956073761, -0.05747772008180618, 0.09137803316116333, -0.09801746159791946, 0.15745484828948975, 0.19742856919765472, 0.11152688413858414, 0.30501610040664673, -0.1355035901069641, -0.10289709270000458, -0.12814009189605713, -0.3908753991127014, -0.515038788318634, 0.29739701747894287, 0.05384916439652443, -0.22871121764183044, 0.22456428408622742, -0.09727085381746292, 0.04282134398818016, 0.13922612369060516, -0.10362736880779266, -0.07535215467214584, -0.06810915470123291, 0.028966505080461502, -0.04524404555559158, 0.48898401856422424, 0.7281074523925781, -0.1487363576889038, -0.19445641338825226, -0.005258555524051189, 0.028114162385463715, -0.2547285556793213, 0.12169782817363739, -0.3434390723705292, -0.06495804339647293, -0.44696950912475586, 0.6147979497909546, 0.20916323363780975, -0.6512788534164429, -0.050934359431266785, 0.21187400817871094, 0.0696868747472763, 0.28403693437576294, 0.2860743999481201, -0.332393616437912, 0.3427557945251465, -0.25075027346611023, -0.05885951220989227, 0.07523621618747711, -0.0016771908849477768, -0.2566642463207245, -0.1882382035255432, -0.16367466747760773, -0.30444085597991943, 0.1868627816438675, 0.013200901448726654, -0.10971047729253769, 0.27011245489120483, 0.3149000108242035, 0.17130319774150848, -0.11053933203220367, 0.2031315118074417, 0.33113664388656616, 0.06864678859710693, 0.4062166213989258, 0.10109581798315048, 0.1791360080242157, -0.5725526213645935, 0.31782227754592896, 0.04992101341485977, -0.10025031864643097, -0.24428240954875946, -0.08751754462718964, -0.3428584933280945, -0.01599627174437046, -0.5308025479316711, -0.2483954131603241, 0.011649999767541885, 0.13382142782211304, 0.0486503429710865, 0.11429205536842346, -0.19823938608169556, 0.4537550210952759, 0.044198162853717804, 0.29813751578330994, -0.39076554775238037, 0.36228781938552856, 0.025013815611600876, -0.015146973542869091, 0.09259888529777527, 0.33189186453819275, 0.19435596466064453, -0.27744820713996887, 0.19830313324928284, 0.4668472707271576, 0.04996480792760849, 0.19986477494239807, 0.27873143553733826, 0.09318830817937851, 0.23584136366844177, -0.16114456951618195, 0.13862018287181854, -0.1687174290418625, -0.04149901494383812, -0.009168203920125961, -0.2070598602294922, 0.28081029653549194, -0.4477580487728119, 0.3045139014720917, 0.1755397766828537, 0.08590785413980484, 0.2024819254875183, -0.022278064861893654, -0.39339372515678406, -0.44495081901550293, 0.40117672085762024, -0.24422727525234222, 0.34463056921958923, -0.1023537814617157, -0.07723759859800339, -0.08544164150953293, 0.2814203202724457, -0.11090749502182007, -0.0220501646399498, 0.026012852787971497, -0.11045794934034348, 0.16166427731513977, -0.12804794311523438, 0.05883723869919777, 0.23423495888710022, 0.14503532648086548, -0.23097360134124756, 0.0008927509188652039, -0.049939654767513275, -0.23350554704666138, 0.11742184311151505, 0.25290608406066895, 0.3445291519165039, 0.3143397867679596, -0.21384331583976746, -0.20656093955039978, -0.3418002426624298, -0.11818304657936096, 0.1458226442337036, 0.04154110327363014, -0.3344838321208954, -0.007226857356727123, -0.17368872463703156, 0.044263727962970734, -0.0683942437171936, -0.373746395111084, -0.3551844358444214, -0.36022359132766724, 0.12028250843286514, 0.23296988010406494, 0.08201229572296143, -0.029239511117339134, -0.08263760805130005, 0.07147157192230225, -0.017551206052303314, 0.008025821298360825, -0.16677263379096985, 0.1435663104057312, 0.013800747692584991, -0.06350070238113403, 0.33265388011932373, -0.018156658858060837, 0.1774560809135437, -0.27052220702171326, 0.03238588571548462, -0.28724056482315063, -0.15420737862586975, 0.2054954171180725, -0.19359223544597626, 0.4828365445137024, 0.1885889768600464, 0.28550028800964355, 0.10617700219154358, -0.1784963607788086, 0.29357051849365234, 0.23274895548820496, -0.061620816588401794, 0.14418891072273254, 0.15495267510414124, -0.12128343433141708, -0.14518845081329346, -0.4688589870929718, -0.31456422805786133, -0.3794766962528229, 0.2025996446609497, 0.273614764213562, -0.011339940130710602, 0.1523115634918213, 0.02648020163178444, 0.13200698792934418, -0.22046810388565063, -0.014362908899784088, -0.05505478009581566, -0.03437035530805588, 0.4924759864807129, -0.33055710792541504, -0.15131308138370514, 0.3221200108528137, 0.07270054519176483, 0.1370631754398346, -0.039666030555963516, -0.26347729563713074, -0.06395887583494186, 0.10864083468914032, -0.14395253360271454, 0.14071345329284668, -0.22042331099510193, 0.29473328590393066, 0.15603327751159668, 0.1587718427181244, -0.19130820035934448, -0.1449524611234665, 0.3142729699611664, -0.06563359498977661, -0.13900473713874817, 0.009661266580224037, 0.12229139357805252, 0.07056795060634613, 0.28249552845954895, 0.1525307148694992, 0.454665869474411, 0.40391454100608826, -0.1621054708957672, 0.28033843636512756, -0.14748725295066833, -0.3229612112045288, -0.22780022025108337, -0.10362470149993896, 0.07482834160327911, 0.3415931165218353, 0.35757356882095337, 0.37817588448524475, -0.1430222988128662, -0.001876380294561386, -0.28293749690055847, -0.31887346506118774, -0.16721415519714355, -0.02493731677532196, -0.07944444566965103, 0.10811212658882141, 0.15307602286338806, 0.13810274004936218, -0.0916406437754631, 0.021682843565940857, 0.6047893762588501, 0.2731609642505646, 0.2648332715034485, -0.035265691578388214, 0.1585230976343155, -0.28883910179138184, 0.21614868938922882, -0.20418277382850647, -0.19730441272258759, -0.1738685518503189, -0.04007260128855705, 0.2937202453613281, -0.1175939217209816, 0.6280377507209778, -0.02280370332300663, -0.06953413784503937, 0.03517534211277962, -0.5607802271842957, -0.34710681438446045, -0.13116033375263214, 0.012154802680015564, 0.01822178065776825, 0.14071819186210632, 0.6017816662788391, -0.41682711243629456, -0.3729954957962036, -0.011717766523361206, 0.15212976932525635, -0.13124269247055054, -0.0058588688261806965, -0.019453488290309906, -0.2965722978115082, -0.4227290451526642, -0.319050669670105, 0.0070954579859972, 0.16634339094161987, -0.12588493525981903, -0.006773378700017929, 0.13583484292030334, -0.08263144642114639, 0.17375558614730835, 0.046020958572626114, 0.5043087005615234, -0.4406714141368866, 0.09541939198970795, 0.6041157245635986, 0.5181639194488525, 0.6353330016136169, 0.42411887645721436, -0.13708187639713287, -0.33380767703056335, -0.06171069294214249, -0.36200034618377686, 0.24203768372535706, 0.4200279712677002, -0.09108466655015945, -0.012577824294567108, 0.049729108810424805, 0.0780104398727417, -0.08919752389192581, 0.07419055700302124, 0.4791705310344696, -0.1277807652950287, -0.32171568274497986, -0.335965096950531, 0.23259124159812927, 0.04986711964011192, -0.021113499999046326, 0.11163000762462616, 0.4506686329841614, -0.4871196746826172, 0.052253782749176025, -0.19148263335227966, 0.907617449760437, -0.21860657632350922, 0.12411294877529144, 0.33946672081947327, 0.2426747828722, 0.16849590837955475, -0.5172117948532104, 0.019793424755334854, -0.33374255895614624, -0.09634475409984589, -0.0733444094657898, 0.006832435727119446, 0.25313881039619446, 0.08069411665201187, -0.25741851329803467, 0.23858405649662018, -0.10587705671787262, 0.26908066868782043, -0.20173336565494537, -0.035481229424476624, -0.15279395878314972, -0.23044626414775848, -0.02193037047982216, -0.0007789283990859985, 0.16485413908958435, 0.39727771282196045, 0.025905806571245193, -0.23799359798431396, -0.23191316425800323, -0.24187852442264557, -0.10336992144584656, 0.08614316582679749, -0.30407416820526123, -0.06340865045785904, -0.12766659259796143, -0.10647866129875183, 0.0824446827173233, 0.3553835153579712, 0.17145532369613647, 0.02291162684559822, -0.4294074475765228, 0.05705166980624199, -0.07897626608610153, -0.26455432176589966, -0.20926500856876373, -0.08872627466917038, 0.07537742704153061, -0.05193862318992615, -0.11566206067800522, -0.14032647013664246, -0.21003371477127075, -0.07448963820934296, -0.4451417326927185, -0.07223856449127197, 0.05569969490170479, -0.4549092948436737, -0.24774032831192017, -0.14641068875789642, -0.005577007308602333, -0.29471373558044434, 0.05024404078722, -0.008624553680419922, -0.08454751968383789, -0.07870206981897354, 0.17951296269893646, -0.17871595919132233, -0.12910538911819458, 0.17782005667686462, -0.4107109606266022, 0.020086321979761124, 0.5086671113967896, 0.1122664362192154, -0.20194587111473083, -0.20281246304512024, 0.09667440503835678, 0.4547880291938782, -0.7091993689537048, -0.14465156197547913, 0.24121496081352234, 0.013778001070022583, 0.2471013069152832, 0.31720054149627686, 0.31768500804901123, -0.26408666372299194, -0.013397496193647385, -0.7198349833488464, 0.14025229215621948, 0.4613439440727234, -0.07534745335578918, 0.12657509744167328, -0.12703388929367065, -0.07587695121765137, -0.12487679719924927, 0.01126062497496605, -0.20320913195610046, 0.12636806070804596, -0.09743009507656097, -0.019567325711250305, 0.4054815471172333, 0.04607493802905083, 0.44736161828041077, 0.038540229201316833, 0.03821244835853577, -0.029635831713676453, -0.24217665195465088, 0.0029363855719566345, -0.07671612501144409, 0.18696951866149902, -0.17344588041305542, -0.08224530518054962, -0.0004580751992762089, -0.03442768007516861, -0.017678268253803253, -0.43032363057136536, 0.24705109000205994, 0.27328041195869446, 0.03704380244016647, -0.33054614067077637, 0.07734572887420654, -0.0028031468391418457, -0.2933574914932251, 0.05317830294370651, -0.15745435655117035, 0.23051434755325317, -0.007359264884144068, 0.032238394021987915, -0.35430023074150085, -0.06011977046728134, 0.052456941455602646, 0.32301250100135803, 0.23718996345996857, 0.001783173531293869, 0.2706177532672882, -0.297277569770813, 0.28667324781417847, 0.05893488973379135, 0.5560176372528076, 0.36640316247940063, -0.08311566710472107, 0.14700785279273987, 0.019661718979477882, 0.05382629856467247, -0.16041220724582672, -0.023963462561368942, 0.3730998635292053, -0.2987436354160309, -0.007779758423566818, 0.4269823133945465, 0.38935792446136475, -0.15640145540237427, -0.055649369955062866, 0.05792547017335892, 0.610359787940979, -0.011496450752019882, 0.21453739702701569, 0.6446017026901245, -0.2162303328514099, 0.2687671482563019, -0.010668372735381126, 0.03035968728363514, 0.20550432801246643, 0.41157424449920654, -0.47882241010665894, 0.03087971732020378, -0.2077808678150177, 0.16448886692523956, -0.10240618139505386, -0.5829746127128601, -0.13192933797836304, 0.12304969131946564, 0.02931242436170578, -0.12050320953130722, -0.34448209404945374, 0.6675323247909546, -0.034386906772851944, 0.04310229793190956, -0.36208438873291016, 0.24252000451087952, -0.05024125427007675, -0.06526505947113037, 0.12272156774997711, -0.44647592306137085, -0.2228909134864807, -0.13985727727413177, -0.019210468977689743, -0.26986294984817505, 0.07308026403188705, -0.10850898921489716, 0.04545165225863457, 0.007102791219949722, 0.4125537574291229, -0.1791839599609375, -0.05990985780954361, -0.23685790598392487, 0.24856004118919373, 0.04808218032121658, -0.0344105139374733, 0.16989050805568695, 0.08188208192586899, 0.33121931552886963, 0.24901743233203888, 0.08445873856544495, -0.028333492577075958, -0.11620353162288666, -0.030733399093151093, 0.10734033584594727, -0.00409197062253952, -0.10154016315937042, -0.12024557590484619, 0.2930024266242981, 0.06643582880496979, -0.10685160756111145, 0.04151981696486473, -0.01186530664563179, 0.19094260036945343, 0.0367664135992527, -0.038985855877399445, -0.2007790356874466, -0.08027991652488708, -0.010830357670783997, -0.13001477718353271, -0.347870796918869, -0.27291202545166016, 0.31992095708847046, 0.0670180693268776, 0.1600411832332611, 0.05936286970973015, 0.0328621082007885, 0.05112177133560181, 0.2133936882019043, 0.17021070420742035, -0.2889724373817444, -0.24886766076087952, -0.07155019044876099, -0.4389135241508484, 0.04285478591918945, -0.29596146941185, -0.30929774045944214, 0.03676820546388626, -0.00954411644488573, 0.08785086125135422, -0.25970304012298584, 0.21377140283584595, -0.17859821021556854, 0.474122554063797, 0.009425971657037735, -0.16089531779289246, -0.14726175367832184, 0.19219210743904114, 0.13452579081058502, 0.06359964609146118, -0.2137327790260315, 0.0737287849187851, -0.3862689733505249, -0.030242418870329857, 0.08793573826551437, 0.5211361646652222, 0.13244123756885529, -0.03396415710449219, -0.07277901470661163, -0.15929223597049713, 0.28560522198677063, -0.1290336549282074, -0.019771937280893326, -0.31183797121047974, -0.24816547334194183, -0.09737393260002136, 0.3343292474746704, 0.016176875680685043, 0.08621229976415634, -0.3720378279685974, -0.5555410981178284, -0.2942063808441162, 0.13069775700569153, -0.05800505727529526, 0.11008935421705246, -0.0016748039051890373, 0.1086239293217659, -0.030111586675047874, -0.049309153109788895, 0.2621619701385498, 0.03300505504012108, -0.09100417792797089, 0.0351925864815712, -0.042062267661094666, -0.23820888996124268, 0.6437877416610718, -0.22203423082828522, 0.01496955007314682, 0.13108742237091064, 0.1569187194108963, 0.4328494369983673, -0.16047713160514832, -0.20066168904304504, 0.023231476545333862, 0.2645878195762634, 0.20759057998657227, -0.2877901792526245, 0.11304226517677307, 0.0006913710385560989, -0.38246557116508484, 0.09432607889175415, 0.05899546295404434, 0.4284675717353821, -0.2550433874130249, 0.12364761531352997, 0.023533713072538376 ]
https://github.com/huggingface/datasets/issues/6443
Trouble loading files defined in YAML explicitly
wow, I reviewed it twice to avoid being ashamed like that, but... I didn't notice the typo. --- Besides this: do you think we would be able to improve the error message to make this clearer?
Look at https://huggingface.co/datasets/severo/doc-yaml-2 It's a reproduction of the example given in the docs at https://huggingface.co/docs/hub/datasets-manual-configuration ``` You can select multiple files per split using a list of paths: my_dataset_repository/ ├── README.md ├── data/ │ ├── abc.csv │ └── def.csv └── holdout/ └── ghi.csv --- configs: - config_name: default data_files: - split: train path: - "data/abc.csv" - "data/def.csv" - split: test path: "holdout/ghi.csv" --- ``` It raises the following error: ``` Error code: ConfigNamesError Exception: FileNotFoundError Message: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1507, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ```
36
Trouble loading files defined in YAML explicitly Look at https://huggingface.co/datasets/severo/doc-yaml-2 It's a reproduction of the example given in the docs at https://huggingface.co/docs/hub/datasets-manual-configuration ``` You can select multiple files per split using a list of paths: my_dataset_repository/ ├── README.md ├── data/ │ ├── abc.csv │ └── def.csv └── holdout/ └── ghi.csv --- configs: - config_name: default data_files: - split: train path: - "data/abc.csv" - "data/def.csv" - split: test path: "holdout/ghi.csv" --- ``` It raises the following error: ``` Error code: ConfigNamesError Exception: FileNotFoundError Message: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1507, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ``` wow, I reviewed it twice to avoid being ashamed like that, but... I didn't notice the typo. --- Besides this: do you think we would be able to improve the error message to make this clearer?
[ -0.057436753064394, -0.38541874289512634, 0.05792003497481346, 0.3542959690093994, 0.27944880723953247, 0.10894999653100967, 0.41074323654174805, 0.30620765686035156, 0.45095735788345337, 0.07631485909223557, -0.22288596630096436, -0.10569406300783157, 0.04646483436226845, 0.23681877553462982, 0.23977167904376984, 0.19313636422157288, -0.12197759002447128, 0.027714282274246216, -0.12581631541252136, -0.04288746416568756, -0.25666940212249756, 0.3503956198692322, 0.06507907807826996, 0.21023298799991608, -0.5011444687843323, 0.06847407668828964, -0.14979253709316254, 0.5480916500091553, -0.221276193857193, -0.19144712388515472, 0.427914559841156, 0.2900598645210266, 0.11630663275718689, 0.24300140142440796, -0.00012101399624953046, 0.14960898458957672, 0.1706387996673584, -0.17922896146774292, -0.13317328691482544, -0.24597539007663727, -0.2747751474380493, -0.2895318865776062, 0.22113797068595886, -0.17717143893241882, 0.0788164734840393, 0.11275692284107208, 0.02793075516819954, -0.2697960138320923, 0.47990429401397705, 0.21741202473640442, 0.10502904653549194, 0.21660837531089783, 0.06056877598166466, -0.2901768684387207, 0.37168988585472107, 0.2878161668777466, -0.18656785786151886, 0.10371297597885132, 0.39428606629371643, -0.3181924819946289, -0.0070820823311805725, 0.03661524876952171, -0.10472115129232407, -0.20518994331359863, 0.24231308698654175, 0.13775211572647095, 0.19326069951057434, -0.42836233973503113, 0.11776658147573471, 0.48396697640419006, 0.3721814751625061, -0.19691136479377747, -0.43047386407852173, -0.5513537526130676, -0.20505228638648987, -0.0004110783338546753, 0.1543515920639038, 0.24594105780124664, -0.02288186550140381, 0.19005681574344635, -0.2223728448152542, -0.29922670125961304, -0.13951563835144043, 0.3337087035179138, 0.13100939989089966, -0.0808965265750885, -0.08981934934854507, 0.018212851136922836, 0.2839414179325104, 0.032144468277692795, 0.0508374385535717, 0.1425575315952301, -0.02630932256579399, 0.3056505024433136, -0.09184698760509491, 0.1821436733007431, -0.23715656995773315, 0.1833713948726654, 0.47644877433776855, 0.19695822894573212, 0.03420516848564148, 0.09142647683620453, 0.09758874028921127, 0.2593943774700165, 0.3017616868019104, 0.3103305995464325, 0.145158052444458, 0.2236378937959671, 0.11400267481803894, 0.4116436541080475, 0.21906021237373352, -0.1199621930718422, -0.3849954307079315, -0.4627626836299896, -0.3797786235809326, -0.259827584028244, 0.47860413789749146, -0.17886579036712646, -0.4996102452278137, -0.1902841329574585, -0.12446337193250656, -0.11108332127332687, 0.23500138521194458, 0.548258900642395, 0.10811484605073929, -0.24429625272750854, 0.019258055835962296, 0.42603814601898193, -0.4163321554660797, 0.08355645835399628, -0.13417552411556244, 0.34081152081489563, -0.10273067653179169, 0.32962390780448914, 0.3018918037414551, -0.2826635241508484, 0.4809994399547577, -0.0005125114694237709, 0.34133851528167725, -0.3269059956073761, -0.05747772008180618, 0.09137803316116333, -0.09801746159791946, 0.15745484828948975, 0.19742856919765472, 0.11152688413858414, 0.30501610040664673, -0.1355035901069641, -0.10289709270000458, -0.12814009189605713, -0.3908753991127014, -0.515038788318634, 0.29739701747894287, 0.05384916439652443, -0.22871121764183044, 0.22456428408622742, -0.09727085381746292, 0.04282134398818016, 0.13922612369060516, -0.10362736880779266, -0.07535215467214584, -0.06810915470123291, 0.028966505080461502, -0.04524404555559158, 0.48898401856422424, 0.7281074523925781, -0.1487363576889038, -0.19445641338825226, -0.005258555524051189, 0.028114162385463715, -0.2547285556793213, 0.12169782817363739, -0.3434390723705292, -0.06495804339647293, -0.44696950912475586, 0.6147979497909546, 0.20916323363780975, -0.6512788534164429, -0.050934359431266785, 0.21187400817871094, 0.0696868747472763, 0.28403693437576294, 0.2860743999481201, -0.332393616437912, 0.3427557945251465, -0.25075027346611023, -0.05885951220989227, 0.07523621618747711, -0.0016771908849477768, -0.2566642463207245, -0.1882382035255432, -0.16367466747760773, -0.30444085597991943, 0.1868627816438675, 0.013200901448726654, -0.10971047729253769, 0.27011245489120483, 0.3149000108242035, 0.17130319774150848, -0.11053933203220367, 0.2031315118074417, 0.33113664388656616, 0.06864678859710693, 0.4062166213989258, 0.10109581798315048, 0.1791360080242157, -0.5725526213645935, 0.31782227754592896, 0.04992101341485977, -0.10025031864643097, -0.24428240954875946, -0.08751754462718964, -0.3428584933280945, -0.01599627174437046, -0.5308025479316711, -0.2483954131603241, 0.011649999767541885, 0.13382142782211304, 0.0486503429710865, 0.11429205536842346, -0.19823938608169556, 0.4537550210952759, 0.044198162853717804, 0.29813751578330994, -0.39076554775238037, 0.36228781938552856, 0.025013815611600876, -0.015146973542869091, 0.09259888529777527, 0.33189186453819275, 0.19435596466064453, -0.27744820713996887, 0.19830313324928284, 0.4668472707271576, 0.04996480792760849, 0.19986477494239807, 0.27873143553733826, 0.09318830817937851, 0.23584136366844177, -0.16114456951618195, 0.13862018287181854, -0.1687174290418625, -0.04149901494383812, -0.009168203920125961, -0.2070598602294922, 0.28081029653549194, -0.4477580487728119, 0.3045139014720917, 0.1755397766828537, 0.08590785413980484, 0.2024819254875183, -0.022278064861893654, -0.39339372515678406, -0.44495081901550293, 0.40117672085762024, -0.24422727525234222, 0.34463056921958923, -0.1023537814617157, -0.07723759859800339, -0.08544164150953293, 0.2814203202724457, -0.11090749502182007, -0.0220501646399498, 0.026012852787971497, -0.11045794934034348, 0.16166427731513977, -0.12804794311523438, 0.05883723869919777, 0.23423495888710022, 0.14503532648086548, -0.23097360134124756, 0.0008927509188652039, -0.049939654767513275, -0.23350554704666138, 0.11742184311151505, 0.25290608406066895, 0.3445291519165039, 0.3143397867679596, -0.21384331583976746, -0.20656093955039978, -0.3418002426624298, -0.11818304657936096, 0.1458226442337036, 0.04154110327363014, -0.3344838321208954, -0.007226857356727123, -0.17368872463703156, 0.044263727962970734, -0.0683942437171936, -0.373746395111084, -0.3551844358444214, -0.36022359132766724, 0.12028250843286514, 0.23296988010406494, 0.08201229572296143, -0.029239511117339134, -0.08263760805130005, 0.07147157192230225, -0.017551206052303314, 0.008025821298360825, -0.16677263379096985, 0.1435663104057312, 0.013800747692584991, -0.06350070238113403, 0.33265388011932373, -0.018156658858060837, 0.1774560809135437, -0.27052220702171326, 0.03238588571548462, -0.28724056482315063, -0.15420737862586975, 0.2054954171180725, -0.19359223544597626, 0.4828365445137024, 0.1885889768600464, 0.28550028800964355, 0.10617700219154358, -0.1784963607788086, 0.29357051849365234, 0.23274895548820496, -0.061620816588401794, 0.14418891072273254, 0.15495267510414124, -0.12128343433141708, -0.14518845081329346, -0.4688589870929718, -0.31456422805786133, -0.3794766962528229, 0.2025996446609497, 0.273614764213562, -0.011339940130710602, 0.1523115634918213, 0.02648020163178444, 0.13200698792934418, -0.22046810388565063, -0.014362908899784088, -0.05505478009581566, -0.03437035530805588, 0.4924759864807129, -0.33055710792541504, -0.15131308138370514, 0.3221200108528137, 0.07270054519176483, 0.1370631754398346, -0.039666030555963516, -0.26347729563713074, -0.06395887583494186, 0.10864083468914032, -0.14395253360271454, 0.14071345329284668, -0.22042331099510193, 0.29473328590393066, 0.15603327751159668, 0.1587718427181244, -0.19130820035934448, -0.1449524611234665, 0.3142729699611664, -0.06563359498977661, -0.13900473713874817, 0.009661266580224037, 0.12229139357805252, 0.07056795060634613, 0.28249552845954895, 0.1525307148694992, 0.454665869474411, 0.40391454100608826, -0.1621054708957672, 0.28033843636512756, -0.14748725295066833, -0.3229612112045288, -0.22780022025108337, -0.10362470149993896, 0.07482834160327911, 0.3415931165218353, 0.35757356882095337, 0.37817588448524475, -0.1430222988128662, -0.001876380294561386, -0.28293749690055847, -0.31887346506118774, -0.16721415519714355, -0.02493731677532196, -0.07944444566965103, 0.10811212658882141, 0.15307602286338806, 0.13810274004936218, -0.0916406437754631, 0.021682843565940857, 0.6047893762588501, 0.2731609642505646, 0.2648332715034485, -0.035265691578388214, 0.1585230976343155, -0.28883910179138184, 0.21614868938922882, -0.20418277382850647, -0.19730441272258759, -0.1738685518503189, -0.04007260128855705, 0.2937202453613281, -0.1175939217209816, 0.6280377507209778, -0.02280370332300663, -0.06953413784503937, 0.03517534211277962, -0.5607802271842957, -0.34710681438446045, -0.13116033375263214, 0.012154802680015564, 0.01822178065776825, 0.14071819186210632, 0.6017816662788391, -0.41682711243629456, -0.3729954957962036, -0.011717766523361206, 0.15212976932525635, -0.13124269247055054, -0.0058588688261806965, -0.019453488290309906, -0.2965722978115082, -0.4227290451526642, -0.319050669670105, 0.0070954579859972, 0.16634339094161987, -0.12588493525981903, -0.006773378700017929, 0.13583484292030334, -0.08263144642114639, 0.17375558614730835, 0.046020958572626114, 0.5043087005615234, -0.4406714141368866, 0.09541939198970795, 0.6041157245635986, 0.5181639194488525, 0.6353330016136169, 0.42411887645721436, -0.13708187639713287, -0.33380767703056335, -0.06171069294214249, -0.36200034618377686, 0.24203768372535706, 0.4200279712677002, -0.09108466655015945, -0.012577824294567108, 0.049729108810424805, 0.0780104398727417, -0.08919752389192581, 0.07419055700302124, 0.4791705310344696, -0.1277807652950287, -0.32171568274497986, -0.335965096950531, 0.23259124159812927, 0.04986711964011192, -0.021113499999046326, 0.11163000762462616, 0.4506686329841614, -0.4871196746826172, 0.052253782749176025, -0.19148263335227966, 0.907617449760437, -0.21860657632350922, 0.12411294877529144, 0.33946672081947327, 0.2426747828722, 0.16849590837955475, -0.5172117948532104, 0.019793424755334854, -0.33374255895614624, -0.09634475409984589, -0.0733444094657898, 0.006832435727119446, 0.25313881039619446, 0.08069411665201187, -0.25741851329803467, 0.23858405649662018, -0.10587705671787262, 0.26908066868782043, -0.20173336565494537, -0.035481229424476624, -0.15279395878314972, -0.23044626414775848, -0.02193037047982216, -0.0007789283990859985, 0.16485413908958435, 0.39727771282196045, 0.025905806571245193, -0.23799359798431396, -0.23191316425800323, -0.24187852442264557, -0.10336992144584656, 0.08614316582679749, -0.30407416820526123, -0.06340865045785904, -0.12766659259796143, -0.10647866129875183, 0.0824446827173233, 0.3553835153579712, 0.17145532369613647, 0.02291162684559822, -0.4294074475765228, 0.05705166980624199, -0.07897626608610153, -0.26455432176589966, -0.20926500856876373, -0.08872627466917038, 0.07537742704153061, -0.05193862318992615, -0.11566206067800522, -0.14032647013664246, -0.21003371477127075, -0.07448963820934296, -0.4451417326927185, -0.07223856449127197, 0.05569969490170479, -0.4549092948436737, -0.24774032831192017, -0.14641068875789642, -0.005577007308602333, -0.29471373558044434, 0.05024404078722, -0.008624553680419922, -0.08454751968383789, -0.07870206981897354, 0.17951296269893646, -0.17871595919132233, -0.12910538911819458, 0.17782005667686462, -0.4107109606266022, 0.020086321979761124, 0.5086671113967896, 0.1122664362192154, -0.20194587111473083, -0.20281246304512024, 0.09667440503835678, 0.4547880291938782, -0.7091993689537048, -0.14465156197547913, 0.24121496081352234, 0.013778001070022583, 0.2471013069152832, 0.31720054149627686, 0.31768500804901123, -0.26408666372299194, -0.013397496193647385, -0.7198349833488464, 0.14025229215621948, 0.4613439440727234, -0.07534745335578918, 0.12657509744167328, -0.12703388929367065, -0.07587695121765137, -0.12487679719924927, 0.01126062497496605, -0.20320913195610046, 0.12636806070804596, -0.09743009507656097, -0.019567325711250305, 0.4054815471172333, 0.04607493802905083, 0.44736161828041077, 0.038540229201316833, 0.03821244835853577, -0.029635831713676453, -0.24217665195465088, 0.0029363855719566345, -0.07671612501144409, 0.18696951866149902, -0.17344588041305542, -0.08224530518054962, -0.0004580751992762089, -0.03442768007516861, -0.017678268253803253, -0.43032363057136536, 0.24705109000205994, 0.27328041195869446, 0.03704380244016647, -0.33054614067077637, 0.07734572887420654, -0.0028031468391418457, -0.2933574914932251, 0.05317830294370651, -0.15745435655117035, 0.23051434755325317, -0.007359264884144068, 0.032238394021987915, -0.35430023074150085, -0.06011977046728134, 0.052456941455602646, 0.32301250100135803, 0.23718996345996857, 0.001783173531293869, 0.2706177532672882, -0.297277569770813, 0.28667324781417847, 0.05893488973379135, 0.5560176372528076, 0.36640316247940063, -0.08311566710472107, 0.14700785279273987, 0.019661718979477882, 0.05382629856467247, -0.16041220724582672, -0.023963462561368942, 0.3730998635292053, -0.2987436354160309, -0.007779758423566818, 0.4269823133945465, 0.38935792446136475, -0.15640145540237427, -0.055649369955062866, 0.05792547017335892, 0.610359787940979, -0.011496450752019882, 0.21453739702701569, 0.6446017026901245, -0.2162303328514099, 0.2687671482563019, -0.010668372735381126, 0.03035968728363514, 0.20550432801246643, 0.41157424449920654, -0.47882241010665894, 0.03087971732020378, -0.2077808678150177, 0.16448886692523956, -0.10240618139505386, -0.5829746127128601, -0.13192933797836304, 0.12304969131946564, 0.02931242436170578, -0.12050320953130722, -0.34448209404945374, 0.6675323247909546, -0.034386906772851944, 0.04310229793190956, -0.36208438873291016, 0.24252000451087952, -0.05024125427007675, -0.06526505947113037, 0.12272156774997711, -0.44647592306137085, -0.2228909134864807, -0.13985727727413177, -0.019210468977689743, -0.26986294984817505, 0.07308026403188705, -0.10850898921489716, 0.04545165225863457, 0.007102791219949722, 0.4125537574291229, -0.1791839599609375, -0.05990985780954361, -0.23685790598392487, 0.24856004118919373, 0.04808218032121658, -0.0344105139374733, 0.16989050805568695, 0.08188208192586899, 0.33121931552886963, 0.24901743233203888, 0.08445873856544495, -0.028333492577075958, -0.11620353162288666, -0.030733399093151093, 0.10734033584594727, -0.00409197062253952, -0.10154016315937042, -0.12024557590484619, 0.2930024266242981, 0.06643582880496979, -0.10685160756111145, 0.04151981696486473, -0.01186530664563179, 0.19094260036945343, 0.0367664135992527, -0.038985855877399445, -0.2007790356874466, -0.08027991652488708, -0.010830357670783997, -0.13001477718353271, -0.347870796918869, -0.27291202545166016, 0.31992095708847046, 0.0670180693268776, 0.1600411832332611, 0.05936286970973015, 0.0328621082007885, 0.05112177133560181, 0.2133936882019043, 0.17021070420742035, -0.2889724373817444, -0.24886766076087952, -0.07155019044876099, -0.4389135241508484, 0.04285478591918945, -0.29596146941185, -0.30929774045944214, 0.03676820546388626, -0.00954411644488573, 0.08785086125135422, -0.25970304012298584, 0.21377140283584595, -0.17859821021556854, 0.474122554063797, 0.009425971657037735, -0.16089531779289246, -0.14726175367832184, 0.19219210743904114, 0.13452579081058502, 0.06359964609146118, -0.2137327790260315, 0.0737287849187851, -0.3862689733505249, -0.030242418870329857, 0.08793573826551437, 0.5211361646652222, 0.13244123756885529, -0.03396415710449219, -0.07277901470661163, -0.15929223597049713, 0.28560522198677063, -0.1290336549282074, -0.019771937280893326, -0.31183797121047974, -0.24816547334194183, -0.09737393260002136, 0.3343292474746704, 0.016176875680685043, 0.08621229976415634, -0.3720378279685974, -0.5555410981178284, -0.2942063808441162, 0.13069775700569153, -0.05800505727529526, 0.11008935421705246, -0.0016748039051890373, 0.1086239293217659, -0.030111586675047874, -0.049309153109788895, 0.2621619701385498, 0.03300505504012108, -0.09100417792797089, 0.0351925864815712, -0.042062267661094666, -0.23820888996124268, 0.6437877416610718, -0.22203423082828522, 0.01496955007314682, 0.13108742237091064, 0.1569187194108963, 0.4328494369983673, -0.16047713160514832, -0.20066168904304504, 0.023231476545333862, 0.2645878195762634, 0.20759057998657227, -0.2877901792526245, 0.11304226517677307, 0.0006913710385560989, -0.38246557116508484, 0.09432607889175415, 0.05899546295404434, 0.4284675717353821, -0.2550433874130249, 0.12364761531352997, 0.023533713072538376 ]
https://github.com/huggingface/datasets/issues/6442
Trouble loading image folder with additional features - metadata file ignored
I reproduced too: - root: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-3) - data/ dir: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-4) - train/ dir: works (https://huggingface.co/datasets/severo/doc-image-5)
### Describe the bug Loading image folder with a caption column using `load_dataset(<image_folder_path>)` doesn't load the captions. When loading a local image folder with captions using `datasets==2.13.0` ``` from datasets import load_dataset data = load_dataset(<image_folder_path>) data.column_names ``` yields `{'train': ['image', 'prompt']}` but when using `datasets==2.15.0` yeilds `{'train': ['image']}` Putting the images and `metadata.jsonl` file into a nested `train` folder **or** loading with `load_dataset("imagefolder", data_dir=<image_folder_path>)` solves the issue and yields `{'train': ['image', 'prompt']}` ### Steps to reproduce the bug 1. create a folder `<image_folder_path>` that contains images and a metadata file with additional features- e.g. "prompt" 2. run: ``` from datasets import load_dataset data = load_dataset("<image_folder_path>") data.column_names ``` ### Expected behavior `{'train': ['image', 'prompt']}` ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.6.0
23
Trouble loading image folder with additional features - metadata file ignored ### Describe the bug Loading image folder with a caption column using `load_dataset(<image_folder_path>)` doesn't load the captions. When loading a local image folder with captions using `datasets==2.13.0` ``` from datasets import load_dataset data = load_dataset(<image_folder_path>) data.column_names ``` yields `{'train': ['image', 'prompt']}` but when using `datasets==2.15.0` yeilds `{'train': ['image']}` Putting the images and `metadata.jsonl` file into a nested `train` folder **or** loading with `load_dataset("imagefolder", data_dir=<image_folder_path>)` solves the issue and yields `{'train': ['image', 'prompt']}` ### Steps to reproduce the bug 1. create a folder `<image_folder_path>` that contains images and a metadata file with additional features- e.g. "prompt" 2. run: ``` from datasets import load_dataset data = load_dataset("<image_folder_path>") data.column_names ``` ### Expected behavior `{'train': ['image', 'prompt']}` ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.6.0 I reproduced too: - root: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-3) - data/ dir: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-4) - train/ dir: works (https://huggingface.co/datasets/severo/doc-image-5)
[ -0.005256209522485733, 0.07954877614974976, 0.025517839938402176, 0.6268144845962524, 0.45238280296325684, 0.11177971214056015, 0.42082488536834717, 0.046340666711330414, 0.2590239942073822, 0.058994848281145096, -0.07752703875303268, 0.4900437891483307, -0.20371156930923462, 0.14985060691833496, -0.17331646382808685, -0.1383177936077118, 0.021797597408294678, 0.042789846658706665, -0.22840923070907593, -0.003542862832546234, -0.4590626358985901, 0.17551973462104797, -0.09534440189599991, 0.00665958970785141, -0.3808327317237854, 0.4376205801963806, -0.2151687741279602, 0.38303619623184204, -0.16716668009757996, -0.26390811800956726, 0.14523637294769287, 0.17550107836723328, 0.3442878723144531, 0.42101743817329407, -0.0001264211314264685, 0.008451998233795166, 0.2881329655647278, -0.13259394466876984, -0.16754324734210968, -0.3373393416404724, -0.0033742189407348633, -0.10108907520771027, 0.11942453682422638, -0.253641813993454, -0.004283184185624123, -0.17952488362789154, -0.02828451804816723, 0.12327231466770172, -0.04859358072280884, 0.03710482642054558, 0.13092735409736633, 0.13358932733535767, -0.12164419889450073, 0.11397087574005127, 0.25091809034347534, 0.4693337678909302, -0.17520491778850555, 0.4916820228099823, 0.17594213783740997, -0.43891218304634094, -0.08677598088979721, 0.26944947242736816, 0.015348641201853752, -0.01218818873167038, 0.5086032748222351, 0.15114976465702057, 0.3312271237373352, -0.033414654433727264, 0.06315041333436966, 0.13176119327545166, 0.521652102470398, 0.13292372226715088, -0.3816273808479309, -0.32081830501556396, -0.17549322545528412, -0.1493367701768875, 0.33150574564933777, 0.0226285420358181, -0.003445175476372242, 0.039037998765707016, -0.04239966347813606, -0.10374931246042252, -0.3622538149356842, 0.25568217039108276, -0.0835416167974472, 0.22516201436519623, 0.10403487086296082, 0.06624402850866318, 0.06470590084791183, -0.1858060210943222, -0.01681310310959816, -0.138729527592659, -0.06777307391166687, 0.3951038420200348, -0.03897141292691231, 0.24298930168151855, 0.16061168909072876, -0.09769300371408463, 0.22609958052635193, 0.4434928297996521, -0.15908971428871155, 0.009862856939435005, -0.43951529264450073, 0.20050475001335144, 0.18514549732208252, 0.006855897605419159, 0.04259409382939339, 0.5006033778190613, 0.15671059489250183, 0.5379087328910828, -0.21058359742164612, -0.10737176984548569, -0.35414737462997437, 0.061824552714824677, -0.09830564260482788, -0.23869973421096802, 0.1856570988893509, -0.18230685591697693, -0.05197043716907501, -0.044474564492702484, -0.05351325497031212, -0.16176295280456543, 0.16157935559749603, 0.16238047182559967, 0.04262453690171242, 0.14591142535209656, 0.0441824272274971, 0.377535343170166, -0.031429581344127655, 0.4242372214794159, -0.18906939029693604, -0.059192050248384476, -0.09203869849443436, 0.23992501199245453, 0.24132804572582245, 0.018203474581241608, 0.42990490794181824, 0.01598692685365677, -0.12421627342700958, 0.1138356626033783, -0.25232088565826416, -0.14359280467033386, -0.11584756523370743, 0.19492115080356598, -0.16631287336349487, 0.2781830132007599, 0.041300587356090546, 0.08207052946090698, -0.0347708985209465, 0.10389147698879242, -0.35707348585128784, -0.38575291633605957, 0.1175047904253006, 0.07774592936038971, -0.28975051641464233, -0.16910682618618011, -0.6241306066513062, 0.05496751517057419, -0.35983264446258545, -0.309395968914032, 0.11456742137670517, 0.05567679554224014, -0.36504432559013367, -0.1927362084388733, 0.22638115286827087, 0.6767813563346863, -0.0773419737815857, -0.1917319893836975, 0.14692655205726624, -0.15722686052322388, 0.07104107737541199, 0.0810091495513916, -0.21319031715393066, 0.0447041355073452, -0.5148175954818726, 0.06983104348182678, -0.006891094148159027, -0.6675130724906921, -0.37303468585014343, 0.31643715500831604, 0.11857184767723083, 0.516222357749939, 0.20565766096115112, 0.08293630927801132, -0.11109623312950134, -0.04748420789837837, -0.04738689959049225, 0.48582154512405396, 0.08017297089099884, -0.0346883088350296, -0.03146756440401077, -0.24665838479995728, 0.23291563987731934, 0.360333651304245, 0.12759430706501007, 0.29120054841041565, 0.11432518810033798, 0.0012066569179296494, 0.2233681082725525, -0.08060981333255768, -0.008639495819807053, 0.3300684690475464, 0.19077076017856598, 0.31768935918807983, 0.0859123170375824, -0.13790921866893768, -0.43038517236709595, 0.47469720244407654, 0.03395261615514755, 0.03433007746934891, -0.42667925357818604, 0.07765770703554153, -0.2365606129169464, -0.13171140849590302, -0.4497661292552948, -0.2893229126930237, -0.04988052695989609, 0.19341719150543213, -0.13810425996780396, -0.01758626475930214, -0.0724085345864296, 0.5357828140258789, -0.11518758535385132, 0.303375244140625, 0.1161816418170929, 0.3975003957748413, 0.09090060740709305, -0.22285327315330505, -0.11864334344863892, 0.09655824303627014, 0.23590180277824402, -0.36441683769226074, -0.22412800788879395, 0.5061908960342407, 0.00762943085283041, 0.35032355785369873, -0.0888422355055809, 0.10877387225627899, 0.30746734142303467, -0.0405755341053009, -0.20817092061042786, -0.1473737210035324, 0.17767757177352905, -0.1637442409992218, -0.43416547775268555, 0.1794825792312622, -0.06752276420593262, 0.37309208512306213, 0.15082772076129913, -0.13601715862751007, 0.04119610786437988, 0.012923497706651688, -0.19722196459770203, -0.2740415334701538, 0.09922836720943451, 0.4403233528137207, 0.13280059397220612, 0.19164222478866577, -0.19700127840042114, -0.09843515604734421, 0.22148838639259338, 0.17785479128360748, -0.1591673195362091, 0.12877660989761353, -0.01831844449043274, 0.1547938585281372, 0.09881165623664856, -0.1499541699886322, 0.35699263215065, 0.16911280155181885, -0.18398001790046692, 0.09583831578493118, -0.10379113256931305, 0.01220068708062172, 0.08368660509586334, 0.11553223431110382, 0.1319105625152588, 0.26371657848358154, 0.30231401324272156, 0.11241945624351501, -0.24751827120780945, -0.15981146693229675, 0.09503521025180817, 0.11239076405763626, -0.25158149003982544, 0.13153472542762756, -0.4057629108428955, -0.23272275924682617, 0.06375116854906082, -0.30266672372817993, -0.332940012216568, -0.024292275309562683, -0.23351795971393585, 0.4098517894744873, -0.059732258319854736, 0.07944049686193466, -0.2341516762971878, 0.061284035444259644, 0.07161231338977814, -0.47766298055648804, -0.2689451575279236, 0.16127744317054749, -0.146134614944458, -0.10484114289283752, 0.19508926570415497, -0.13882644474506378, 0.1513996422290802, -0.026392299681901932, 0.1074955090880394, -0.4862297773361206, -0.4854041337966919, 0.1682082861661911, -0.15998564660549164, 0.3886664807796478, -0.021690182387828827, 0.11341950297355652, 0.1866430640220642, 0.12019214034080505, 0.5118621587753296, 0.18697451055049896, -0.03234776854515076, -0.07322348654270172, 0.11213479191064835, 0.14029856026172638, -0.43109428882598877, -0.2770012617111206, -0.059929490089416504, -0.38055774569511414, 0.17918959259986877, 0.24089239537715912, 0.044564686715602875, 0.3490210473537445, -0.04612133651971817, -0.07222798466682434, 0.14325323700904846, 0.010819653980433941, -0.14280562102794647, -0.44324856996536255, 0.4906804859638214, -0.1716340333223343, -0.21037687361240387, -0.06249019503593445, -0.04445384815335274, 0.0914381891489029, 0.13277903199195862, -0.45140886306762695, -0.47263267636299133, -0.16644790768623352, 0.3080497086048126, 0.006664805114269257, -0.05802864581346512, 0.24578739702701569, -0.031194811686873436, 0.15793949365615845, -0.23527419567108154, -0.25942111015319824, 0.2657603323459625, 0.17199400067329407, -0.026426605880260468, -0.039654962718486786, 0.46095970273017883, -0.09805533289909363, 0.23934993147850037, -0.24522635340690613, 0.27482423186302185, 0.7151583433151245, -0.3624371290206909, 0.4651331901550293, -0.17764762043952942, -0.27384519577026367, -0.07916942238807678, -0.03747135400772095, 0.28022903203964233, 0.1914430856704712, 0.2550223171710968, 0.21444372832775116, -0.18337279558181763, -0.08156056702136993, -0.14839643239974976, 0.04306020215153694, -0.0032965149730443954, 0.14115449786186218, 0.2300100028514862, 0.027731794863939285, 0.012101635336875916, -0.13541100919246674, -0.13250982761383057, 0.23511117696762085, 0.5616044402122498, 0.40035927295684814, 0.1829710602760315, -0.21173040568828583, 0.040089599788188934, 0.05159822851419449, -0.14426429569721222, 0.15206612646579742, 0.1195269227027893, -0.042494036257267, -0.008006678894162178, 0.06213200464844704, -0.15020312368869781, 0.7809885740280151, -0.082175612449646, 0.18523995578289032, 0.05082147940993309, -0.1853359192609787, -0.7131801247596741, -0.36948704719543457, -0.043416667729616165, -0.33024412393569946, -0.13393321633338928, 1.053446888923645, -0.20961007475852966, -0.2271931767463684, 0.22323229908943176, 0.10300097614526749, -0.2271541804075241, -0.31999140977859497, -0.20217829942703247, -0.07747350633144379, -0.28709912300109863, -0.22697779536247253, 0.014686359092593193, 0.33439046144485474, 0.09517104923725128, -0.07451515644788742, 0.09683723002672195, -0.29705023765563965, -0.022772401571273804, 0.08643859624862671, 0.24057260155677795, -0.08501327037811279, 0.3519437313079834, 0.25525885820388794, 0.17454305291175842, 0.45958322286605835, 0.9005557298660278, -0.0707969069480896, -0.5130006074905396, -0.006780292838811874, -0.4399486780166626, 0.1298462450504303, 0.1815396249294281, -0.0588679313659668, 0.03316621482372284, -0.3408872187137604, -0.20516739785671234, -0.592757523059845, 0.2666976749897003, 0.4544968008995056, -0.0756535455584526, 0.05049261823296547, -0.2986465394496918, 0.5498539209365845, 0.3082052767276764, -0.18177035450935364, -0.1099419891834259, 0.3222019076347351, -0.542104184627533, 0.1591431051492691, -0.3369639217853546, 0.620441734790802, 0.10131126642227173, 0.165725976228714, 0.41686564683914185, -0.23500581085681915, 0.06421907991170883, -0.08521868288516998, -0.050613515079021454, -0.12576380372047424, -0.28179219365119934, 0.051171429455280304, -0.08973704278469086, 0.21386444568634033, 0.2303723692893982, 0.19366757571697235, 0.37386810779571533, -0.2584272623062134, -0.008746020495891571, 0.015540453605353832, 0.13888974487781525, -0.009326232597231865, -0.2715962827205658, -0.06174393743276596, 0.0018074586987495422, 0.27520114183425903, 0.30221498012542725, -0.0684690773487091, -0.010826831683516502, -0.2198071926832199, -0.41213494539260864, -0.1313198208808899, 0.27957379817962646, -0.0799529105424881, -0.05757514387369156, 0.1676252782344818, 0.015165582299232483, 0.0595928393304348, 0.012493569403886795, -0.08786877989768982, -0.15652644634246826, -0.147003173828125, 0.08552509546279907, -0.22197771072387695, 0.19743353128433228, -0.2177519053220749, -0.03192310407757759, 0.36569488048553467, -0.005402367562055588, -0.054016172885894775, -0.23847347497940063, -0.2358371764421463, -0.19777731597423553, -0.4347880184650421, -0.06752137839794159, 0.17377212643623352, -0.1499728113412857, -0.23071956634521484, -0.2693440616130829, 0.14484065771102905, -0.2449466586112976, 0.04554129019379616, -0.054786570370197296, 0.1820421665906906, 0.121339350938797, -0.10871709883213043, -0.2352798581123352, -0.15948708355426788, 0.3629878759384155, -0.2542797029018402, -0.07097143679857254, 0.5877811908721924, 0.09041422605514526, 0.053181640803813934, -0.047728683799505234, 0.051922060549259186, 0.259468138217926, -0.43596988916397095, 0.10983782261610031, 0.3546902537345886, -0.09686689078807831, 0.14273802936077118, 0.1729663908481598, 0.06334935128688812, -0.458229124546051, -0.07240259647369385, -0.48957642912864685, -0.1848839819431305, 0.12018758058547974, -0.3215971887111664, -0.014616068452596664, -0.36059683561325073, 0.03877265751361847, -0.052895382046699524, -0.17711186408996582, -0.14651215076446533, 0.22637633979320526, 0.07231700420379639, 0.20786753296852112, 0.5708094835281372, 0.22543352842330933, 0.1533586084842682, 0.04364193230867386, 0.09077078849077225, 0.07353667914867401, 0.052488237619400024, 0.020103219896554947, -0.5126923322677612, 0.19145044684410095, 0.145835280418396, -0.0006120428442955017, -0.08670121431350708, -0.24497772753238678, -0.0986429750919342, -0.13356880843639374, 0.24201270937919617, 0.137485533952713, -0.013137973845005035, 0.30925342440605164, -0.14400701224803925, 0.362177312374115, 0.00424613431096077, 0.30857235193252563, -0.2727525234222412, 0.4930795431137085, 0.18174122273921967, -0.05553273856639862, -0.11385457962751389, -0.029679186642169952, -0.25155624747276306, -0.03760812431573868, -0.1275254786014557, 0.22077593207359314, 0.40236982703208923, -0.029375240206718445, 0.3614591360092163, 0.17429344356060028, 0.20445044338703156, 0.03127555549144745, -0.1280559003353119, -0.16469493508338928, 0.20817038416862488, 0.15281817317008972, -0.3069624900817871, -0.31399837136268616, -0.061468373984098434, -0.15036800503730774, 0.1319720298051834, 0.19571208953857422, 0.0955568253993988, 0.06162738800048828, -0.10439637303352356, -0.017381316050887108, 0.48820260167121887, 0.35147154331207275, -0.000760294497013092, 0.4573054611682892, -0.11136278510093689, 0.1216401606798172, 0.24142621457576752, 0.08543998003005981, 0.0759572759270668, 0.5056771039962769, -0.08695945888757706, -0.018336674198508263, 0.097833052277565, 0.19736674427986145, 0.33125001192092896, -0.4580880403518677, -0.3763516843318939, -0.14738449454307556, 0.13697516918182373, 0.3284594416618347, -0.27696874737739563, 0.2673085331916809, -0.15087087452411652, 0.03711630403995514, 0.04094960540533066, -0.016920682042837143, -0.08225515484809875, -0.23327893018722534, -0.22261834144592285, -0.3154884874820709, -0.24344028532505035, 0.18142595887184143, -0.18470081686973572, -0.18464802205562592, -0.00045987218618392944, -0.002661973237991333, -0.13279058039188385, -0.17949995398521423, -0.21653690934181213, 0.13554856181144714, -0.006777845323085785, -0.13380201160907745, 0.2756589651107788, 0.12881658971309662, -0.35229671001434326, 0.5360906720161438, 0.16219069063663483, 0.2298600673675537, 0.18492937088012695, 0.2248179018497467, -0.03126085177063942, -0.38421696424484253, 0.08319957554340363, -0.11468921601772308, 0.3046201467514038, -0.06035810708999634, -0.11023636162281036, 0.038868796080350876, 0.04295664280653, -0.158338263630867, 0.14215807616710663, 0.012744355946779251, 0.1495516449213028, -0.4806826114654541, 0.36632484197616577, -0.07036826014518738, -0.033078864216804504, 0.010719450190663338, 0.11095359921455383, -0.12401305139064789, -0.35582321882247925, 0.3514198362827301, 0.3562667667865753, 0.08462769538164139, 0.17699161171913147, 0.010461604222655296, -0.11683154106140137, 0.3343724012374878, 0.5173894166946411, -0.2945604920387268, -0.10952701419591904, 0.09218420088291168, -0.800961971282959, 0.10257066041231155, 0.18004098534584045, -0.3376619815826416, 0.08186759799718857, 0.006318291649222374, 0.08798105269670486, -0.3177751302719116, 0.21614916622638702, -0.03113708086311817, 0.1640838235616684, -0.06562118232250214, -0.40809112787246704, -0.06623126566410065, 0.02345249429345131, 0.05812503397464752, -0.18219061195850372, -0.3013135492801666, 0.05559791997075081, -0.27500370144844055, 0.008398931473493576, 0.031083807349205017, -0.08199559152126312, -0.22011221945285797, 0.16490212082862854, 0.38565900921821594, -0.001957923173904419, 0.2932606637477875, -0.03028346784412861, -0.17928792536258698, -0.42892324924468994, -0.2462015002965927, -0.024481501430273056, 0.10945592820644379, -0.018689218908548355, 0.4833548367023468, -0.35223644971847534, -0.020893048495054245, -0.4672740399837494, 0.13142509758472443, -0.07694623619318008, -0.24578438699245453, -0.2359085977077484, 0.4166887402534485, -0.09406237304210663, -0.05330056697130203, -0.09154872596263885, 0.2524953782558441, 0.016182154417037964, -0.0821084976196289, -0.08045230805873871, -0.42522895336151123, 0.49765872955322266, -0.19270631670951843, -0.25425848364830017, -0.010381806641817093, 0.13768161833286285, -0.08391975611448288, 0.15139031410217285, -0.37975189089775085, -0.03557997941970825, 0.352160781621933, 0.15608248114585876, -0.29094067215919495, 0.1907886117696762, 0.09149254858493805, 0.004571434110403061, -0.13053087890148163, -0.24817025661468506, 0.061027273535728455, -0.05369170755147934, 0.2758110463619232, 0.020449820905923843 ]
https://github.com/huggingface/datasets/issues/6441
Trouble Loading a Gated Dataset For User with Granted Permission
> Also when they try to click the url link for the dataset they get a 404 error. This seems to be a Hub error then (cc @SBrandeis)
### Describe the bug I have granted permissions to several users to access a gated huggingface dataset. The users accepted the invite and when trying to load the dataset using their access token they get `FileNotFoundError: Couldn't find a dataset script at .....` . Also when they try to click the url link for the dataset they get a 404 error. ### Steps to reproduce the bug 1. Grant access to gated dataset for specific users 2. Users accept invitation 3. Users login to hugging face hub using cli login 4. Users run load_dataset ### Expected behavior Dataset is loaded normally for users who were granted access to the gated dataset. ### Environment info datasets==2.15.0
28
Trouble Loading a Gated Dataset For User with Granted Permission ### Describe the bug I have granted permissions to several users to access a gated huggingface dataset. The users accepted the invite and when trying to load the dataset using their access token they get `FileNotFoundError: Couldn't find a dataset script at .....` . Also when they try to click the url link for the dataset they get a 404 error. ### Steps to reproduce the bug 1. Grant access to gated dataset for specific users 2. Users accept invitation 3. Users login to hugging face hub using cli login 4. Users run load_dataset ### Expected behavior Dataset is loaded normally for users who were granted access to the gated dataset. ### Environment info datasets==2.15.0 > Also when they try to click the url link for the dataset they get a 404 error. This seems to be a Hub error then (cc @SBrandeis)
[ -0.292269229888916, -0.2370852530002594, 0.05975010618567467, 0.5143926739692688, -0.0005606077611446381, 0.010804109275341034, 0.43759822845458984, 0.015283184126019478, 0.49582844972610474, 0.22912399470806122, -0.24911528825759888, -0.12773165106773376, -0.1121755912899971, 0.1138853207230568, 0.03840217739343643, 0.13969391584396362, 0.15380680561065674, -0.06201869249343872, 0.01506880670785904, -0.1095394492149353, -0.38197243213653564, 0.040588729083538055, -0.3344864249229431, 0.41202837228775024, -0.3849259316921234, 0.2090611606836319, 0.016049599274992943, 0.6451939344406128, 0.17586126923561096, -0.07203236222267151, 0.18494132161140442, 0.20293419063091278, 0.3615216016769409, 0.5117639303207397, -0.00012318439257796854, -0.13569346070289612, 0.3899410367012024, 0.162506103515625, -0.26679420471191406, -0.2580399513244629, -0.31815844774246216, -0.10354755073785782, -0.07885804772377014, -0.015886865556240082, -0.1330091953277588, -0.15558210015296936, 0.16678451001644135, -0.01987772434949875, 0.30436739325523376, -0.13929401338100433, 0.1028636246919632, 0.09418275207281113, -0.15431849658489227, -0.20870313048362732, -0.04210808873176575, 0.06975656002759933, 0.0245638620108366, 0.28782451152801514, 0.3993363678455353, -0.2904375493526459, -0.050246067345142365, -0.023890499025583267, -0.05591540038585663, -0.22390274703502655, 0.8815986514091492, -0.20027607679367065, -0.3073635399341583, -0.16790249943733215, 0.06540336459875107, 0.20937815308570862, 0.3068407475948334, 0.18095025420188904, -0.3168744742870331, -0.3862684369087219, -0.03773563727736473, 0.13491038978099823, 0.41104641556739807, 0.1281500607728958, -0.23668503761291504, 0.26680585741996765, -0.45249611139297485, -0.3177824020385742, -0.22121137380599976, 0.10379545390605927, -0.0484214648604393, 0.36618176102638245, 0.16678956151008606, 0.17669233679771423, -0.2626802623271942, -0.20097790658473969, 0.16586916148662567, -0.00028187595307826996, -0.1417669802904129, 0.3519361913204193, -0.08447688817977905, 0.24757546186447144, 0.2540619373321533, 0.6010993123054504, 0.09580791741609573, 0.6005032062530518, -0.3287264406681061, 0.2586814761161804, -0.2561015188694, 0.07643924653530121, 0.3444533944129944, 0.017146149650216103, 0.19035375118255615, 0.18352454900741577, 0.45358502864837646, 0.387877494096756, -0.02450811117887497, 0.021032240241765976, -0.3654264807701111, -0.1090954840183258, -0.15642991662025452, -0.17578727006912231, 0.25305038690567017, -0.2187371701002121, -0.33498692512512207, 0.06137315183877945, 0.1769922971725464, 0.029535969719290733, 0.2144477814435959, 0.677811861038208, 0.05181503668427467, -0.4585024416446686, 0.07802177965641022, 0.0905757024884224, -0.1382552683353424, -0.30730825662612915, -0.2326492816209793, -0.19119645655155182, -0.17864975333213806, 0.38046348094940186, 0.02993442490696907, -0.14515192806720734, 0.1903601586818695, -0.16525231301784515, 0.027739398181438446, -0.09205461293458939, -0.18067963421344757, 0.25865834951400757, -0.002306632697582245, 0.16059280931949615, 0.36536067724227905, 0.10888449102640152, 0.06358431279659271, -0.26586273312568665, 0.04947587102651596, 0.12800106406211853, -0.27531030774116516, -0.31168267130851746, 0.20328377187252045, -0.0402458980679512, -0.4837060570716858, 0.1097458079457283, -0.1042904481291771, 0.05824241042137146, -0.181499183177948, -0.16599468886852264, -0.19750097393989563, 0.22497957944869995, -0.19919995963573456, -0.2902938425540924, 0.35962197184562683, 0.8837186694145203, 0.10983702540397644, -0.2502673864364624, 0.018322179093956947, -0.19341251254081726, -0.2556629478931427, 0.32641950249671936, -0.20434029400348663, 0.2497667372226715, -0.4542505145072937, 0.38927823305130005, -0.22888624668121338, -0.5264032483100891, -0.5202938914299011, 0.03324359655380249, -0.19403880834579468, 0.29738497734069824, -0.05282223969697952, 0.08713916689157486, 0.17495739459991455, -0.18440553545951843, 0.43480291962623596, 0.2903130054473877, 0.25521916151046753, -0.1891281008720398, -0.0008801482617855072, -0.21010401844978333, 0.053228311240673065, 0.21678279340267181, 0.1717943251132965, 0.19591352343559265, 0.3920241594314575, -0.007836570963263512, 0.3885306417942047, -0.18373845517635345, 0.044107623398303986, 0.15989503264427185, 0.27934256196022034, 0.07470283657312393, 0.10259252041578293, -0.1659274399280548, -0.1835118532180786, 0.329795777797699, -0.04432060569524765, -0.14020974934101105, 0.07597144693136215, -0.057073552161455154, -0.334427148103714, 0.11298681050539017, -0.3406115472316742, 0.14657855033874512, -0.030382221564650536, -0.012718714773654938, -0.22951143980026245, -0.17007684707641602, -0.23104503750801086, 0.526102602481842, -0.1740713268518448, 0.21044902503490448, -0.23729316890239716, 0.347375750541687, 0.15675964951515198, -0.2189001888036728, 0.17478768527507782, 0.2813261151313782, 0.36318156123161316, -0.15500226616859436, -0.050461288541555405, 0.4263507127761841, -0.0728454738855362, 0.06672565639019012, 0.10193076729774475, -0.08110804855823517, 0.096275195479393, -0.09423172473907471, -0.028273673728108406, -0.2194496989250183, 0.02721736952662468, -0.06602364778518677, 0.0013493262231349945, 0.3552153706550598, -0.05537968501448631, 0.06296384334564209, 0.037319451570510864, 0.15498261153697968, -0.06249836087226868, -0.05580544471740723, -0.10370910167694092, -0.07010402530431747, 0.43581515550613403, 0.0915311723947525, -0.20212769508361816, 0.004114596173167229, 0.04230296611785889, -0.06336253136396408, 0.020794633775949478, -0.05963554605841637, 0.10081358999013901, -0.07764419168233871, -0.0436461940407753, 0.08803742378950119, 0.383955717086792, 0.1589779406785965, 0.19029739499092102, 0.030386097729206085, -0.2004120945930481, 0.05519123747944832, 0.22826258838176727, -0.05306791514158249, 0.06871829926967621, -0.1890842467546463, -0.1399788111448288, 0.11131924390792847, -0.2819195091724396, -0.09765926748514175, -0.17593780159950256, -0.28382787108421326, 0.07369612157344818, 0.2861432135105133, -0.5047140121459961, -0.23092378675937653, -0.08477816730737686, -0.0998665988445282, 0.3399638831615448, -0.2857459783554077, -0.414181113243103, -0.021577859297394753, -0.17682549357414246, 0.4167942404747009, 0.07525397837162018, 0.06710341572761536, -0.2728460133075714, 0.4546734690666199, -0.1002739816904068, 0.16263139247894287, -0.3460069000720978, 0.11529234796762466, -0.25263428688049316, -0.07097622752189636, 0.413646936416626, 0.0009773941710591316, 0.10380836576223373, -0.20342913269996643, 0.35378754138946533, -0.6152340769767761, -0.21762943267822266, -0.0670405700802803, -0.1239563524723053, 0.5687903761863708, 0.02449505776166916, 0.22484485805034637, 0.00534723699092865, 0.021316848695278168, 0.08829136192798615, 0.09655202180147171, -0.028858182951807976, -0.03231154754757881, -0.021830158308148384, -0.379576712846756, -0.04891034588217735, 0.008403502404689789, -0.01648302935063839, -0.2622300088405609, 0.28076013922691345, 0.10805504024028778, 0.09140963852405548, 0.2452300786972046, 0.009301167912781239, 0.037185776978731155, -0.08621326833963394, -0.17831823229789734, -0.08351898193359375, -0.39511847496032715, 0.2969583570957184, -0.23320966958999634, -0.3859345614910126, 0.16687338054180145, 0.2028769552707672, 0.15856029093265533, -0.06853843480348587, -0.4187757968902588, -0.008812632411718369, -0.15027345716953278, 0.1410834640264511, -0.1376054286956787, -0.2605196535587311, -0.06993824243545532, -0.24986201524734497, 0.23853187263011932, -0.0873183012008667, -0.3001388907432556, 0.29536429047584534, -0.0020569078624248505, 0.10776589065790176, 0.018924323841929436, -0.005874071270227432, -0.10469755530357361, 0.22091913223266602, 0.11754104495048523, 0.5642310380935669, 0.4000738561153412, 0.0656837448477745, 0.40926593542099, 0.08254629373550415, -0.2695022523403168, 0.23395702242851257, 0.344078004360199, -0.13931895792484283, 0.2238677442073822, 0.29841962456703186, 0.036554113030433655, -0.2375974953174591, -0.7047708034515381, -0.09419083595275879, -0.23746436834335327, -0.3754023015499115, 0.0178225040435791, 0.014590691775083542, 0.3820757567882538, 0.25013482570648193, -0.2629082202911377, -0.2975202798843384, 0.1743999719619751, 0.45933306217193604, 0.5946388840675354, -0.0031775531824678183, -0.33609792590141296, -0.29096829891204834, -0.2600592374801636, 0.19355589151382446, -0.11959829926490784, 0.19822612404823303, -0.35671600699424744, 0.11790149658918381, 0.19748596847057343, 0.13262835144996643, 0.4923097491264343, -0.2652333080768585, 0.4821593761444092, -0.2705216407775879, 0.16100558638572693, -0.4070633053779602, -0.11723308265209198, 0.2737888991832733, 0.1496436893939972, 0.07003623992204666, 0.6922134160995483, 0.0033883675932884216, -0.17545823752880096, 0.05743660032749176, -0.2925551235675812, -0.28965750336647034, -0.4696984887123108, -0.14196720719337463, -0.26450350880622864, -0.3497329652309418, 0.04712013155221939, 0.007182037457823753, 0.2146119773387909, 0.0807274654507637, -0.2699688971042633, -0.07934848964214325, 0.16373956203460693, 0.00866459310054779, 0.2036444991827011, 0.3209308385848999, -0.039395369589328766, 0.1950986534357071, 0.38654908537864685, 0.1817377805709839, 0.20079109072685242, 0.5768281817436218, 0.3269498646259308, -0.33327516913414, 0.14491930603981018, -0.17647501826286316, 0.0702471137046814, 0.5914222598075867, -0.1679680198431015, -0.025076575577259064, 0.4457911550998688, 0.1060454249382019, -0.16914615035057068, -0.11466797441244125, -0.052881352603435516, 0.05594363063573837, -0.4125923812389374, -0.23128512501716614, 0.021976377815008163, -0.03994229808449745, -0.05941222608089447, 0.378601610660553, 0.5778247117996216, -0.20120979845523834, 0.2563205361366272, -0.04246867448091507, 1.1067276000976562, -0.1394272893667221, 0.16773462295532227, 0.39533597230911255, -0.06714316457509995, -0.10815753787755966, -0.15397384762763977, -0.13071022927761078, -0.4379100203514099, -0.3357463777065277, -0.08382548391819, -0.06028085574507713, -0.004372172057628632, 0.09439679980278015, 0.31464001536369324, 0.2237585335969925, -0.14671212434768677, -0.024812426418066025, 0.1266554296016693, -0.006238430738449097, -0.35866954922676086, 0.010171996429562569, 0.10038476437330246, -0.05388420820236206, 0.15377485752105713, 0.31076058745384216, -0.22951436042785645, -0.11379653960466385, -0.46445947885513306, -0.11364413052797318, -0.30902373790740967, 0.1460014283657074, 0.008473578840494156, -0.15381906926631927, 0.12086306512355804, -0.03661530837416649, 0.17687000334262848, 0.3337622880935669, 0.08798609673976898, 0.015141244977712631, -0.4528804123401642, 0.2094956487417221, -0.26315441727638245, -0.12449462711811066, -0.13560982048511505, 0.19136929512023926, 0.39358410239219666, -0.04060119763016701, -0.33872470259666443, -0.02165938913822174, -0.12129255384206772, -0.21527309715747833, -0.4663851261138916, 0.2792833149433136, 0.0123235322535038, -0.2902132570743561, -0.21418426930904388, -0.14168840646743774, 0.12641121447086334, -0.058363303542137146, -0.013521354645490646, 0.11770179867744446, 0.1369645893573761, -0.16921821236610413, 0.40629827976226807, -0.3170044422149658, 0.028028057888150215, 0.35312697291374207, -0.29524457454681396, -0.19870617985725403, 0.46917596459388733, 0.07221272587776184, -0.014301126822829247, -0.014925582334399223, -0.07926462590694427, 0.46701812744140625, -0.4838476777076721, -0.17672878503799438, -0.03440719097852707, 0.25608891248703003, -0.03464970365166664, 0.07059793174266815, 0.2955239415168762, -0.36840537190437317, 0.025102052837610245, -0.46682074666023254, -0.09555210918188095, 0.10322918742895126, -0.3579435646533966, -0.11585871875286102, -0.039462506771087646, -0.19284287095069885, 0.025800766423344612, -0.28256896138191223, -0.12866470217704773, -0.12018940597772598, -0.15597008168697357, -0.20003792643547058, 0.21125082671642303, 0.2060840129852295, -0.12518352270126343, -0.24687856435775757, -0.012399890460073948, -0.12367478013038635, -0.10173635184764862, 0.01097961887717247, -0.1369713395833969, 0.23372513055801392, 0.21267804503440857, -0.198443204164505, -0.21384210884571075, -0.22689132392406464, 0.056130748242139816, -0.18232175707817078, 0.036000899970531464, 0.38375595211982727, 0.10450760275125504, -0.366034597158432, 0.3249564468860626, 0.1476798951625824, -0.28262943029403687, 0.4647201597690582, 0.08121084421873093, 0.0037201792001724243, -0.2513151168823242, 0.02200447954237461, -0.1461164802312851, -0.027722444385290146, 0.041650209575891495, 0.1342165172100067, 0.3268277049064636, 0.24583613872528076, 0.3931427299976349, -0.2625530958175659, 0.28783634305000305, 0.1604149490594864, 0.2514251470565796, 0.027188509702682495, -0.20454104244709015, -0.0660746693611145, 0.06741776317358017, 0.0486888661980629, -0.028258834034204483, 0.011328659020364285, 0.2415645569562912, 0.06404660642147064, -0.33703839778900146, 0.22379057109355927, -0.07206597179174423, -0.2744824290275574, -0.1906583160161972, 0.02329861745238304, 0.3589901924133301, 0.23796753585338593, 0.042782481759786606, 0.08479220420122147, -0.14892995357513428, 0.1416100263595581, 0.30608513951301575, 0.053678229451179504, -0.01234457641839981, 0.7479059100151062, -0.16947519779205322, -0.05856498330831528, -0.07559175789356232, 0.49242687225341797, -0.05870889872312546, -0.7070969343185425, -0.107166588306427, -0.12787485122680664, -0.03856019675731659, -0.09802784770727158, -0.29500508308410645, 0.24938446283340454, -0.1299353688955307, -0.10656676441431046, -0.1464853584766388, 0.14774416387081146, -0.23846158385276794, 0.07745862007141113, -0.03303183242678642, -0.12261535227298737, -0.01568615809082985, -0.13834014534950256, -0.07245218753814697, -0.33040082454681396, -0.4162648618221283, 0.0983394980430603, -0.040922194719314575, -0.16289985179901123, 0.14460425078868866, 0.4447726607322693, -0.008275441825389862, -0.1864427775144577, 0.12085645645856857, -0.19561268389225006, 0.04359002411365509, 0.6892473101615906, -0.03139998018741608, 0.3926355242729187, 0.2936888635158539, 0.19938036799430847, 0.3836267292499542, -0.021431468427181244, 0.060800209641456604, -0.00723215751349926, 0.42595645785331726, 0.14450408518314362, 0.5137655138969421, 0.07384881377220154, 0.05210521072149277, 0.003498743288218975, -0.0966370552778244, -0.011399071663618088, 0.13911116123199463, -0.2912287712097168, 0.35600945353507996, -0.48397377133369446, -0.2802932858467102, -0.21964943408966064, -0.1737384796142578, -0.11431228369474411, 0.12977048754692078, 0.13381148874759674, 0.1648966521024704, 0.1308426558971405, -0.39461541175842285, -0.04721025377511978, -0.07969605922698975, 0.15074126422405243, 0.4428568184375763, 0.15264931321144104, -0.11148636788129807, -0.388552188873291, -0.6714116334915161, 0.4537392556667328, 0.1554262787103653, -0.08052880316972733, 0.19019721448421478, -0.12132980674505234, -0.2726757228374481, -0.43009644746780396, 0.3905310034751892, 0.3023129105567932, 0.1858084350824356, 0.2726895213127136, -0.12613825500011444, -0.10092537105083466, 0.024108190089464188, 0.27129513025283813, -0.32912153005599976, 0.058579444885253906, 0.42951107025146484, -0.17468991875648499, -0.15579423308372498, 0.2000463455915451, -0.15009501576423645, 0.048164378851652145, -0.003857135772705078, 0.43700724840164185, -0.1598058044910431, 0.5608198642730713, 0.15932697057724, 0.14487721025943756, -0.6401887536048889, -0.10512132197618484, -0.17354924976825714, 0.16621090471744537, -0.08320936560630798, 0.043372444808483124, -0.12607362866401672, -0.046407703310251236, -0.08209287375211716, 0.46091708540916443, -0.05355238541960716, 0.19794398546218872, -0.12855614721775055, 0.06266918778419495, -0.1724153757095337, 0.19767895340919495, 0.24729280173778534, -0.09087488800287247, -0.08699321746826172, 0.21670345962047577, -0.13875561952590942, -0.08981658518314362, 0.6664198637008667, -0.46311691403388977, -0.11408478021621704, 0.11793015152215958, 0.42937129735946655, 0.0857672467827797, -0.5171616077423096, -0.10966237634420395, -0.0569184310734272, 0.22583748400211334, 0.12336135655641556, 0.1194913387298584, 0.09290502965450287, -0.3313146233558655, 0.05253177508711815, -0.045634761452674866, 0.039897993206977844, 0.055650901049375534, -0.25457069277763367, 0.5924634337425232, 0.09936933219432831 ]
https://github.com/huggingface/datasets/issues/6441
Trouble Loading a Gated Dataset For User with Granted Permission
Could you report this to https://discuss.huggingface.co/c/hub/23, providing the URL of the dataset, or at least if the dataset is public or private?
### Describe the bug I have granted permissions to several users to access a gated huggingface dataset. The users accepted the invite and when trying to load the dataset using their access token they get `FileNotFoundError: Couldn't find a dataset script at .....` . Also when they try to click the url link for the dataset they get a 404 error. ### Steps to reproduce the bug 1. Grant access to gated dataset for specific users 2. Users accept invitation 3. Users login to hugging face hub using cli login 4. Users run load_dataset ### Expected behavior Dataset is loaded normally for users who were granted access to the gated dataset. ### Environment info datasets==2.15.0
22
Trouble Loading a Gated Dataset For User with Granted Permission ### Describe the bug I have granted permissions to several users to access a gated huggingface dataset. The users accepted the invite and when trying to load the dataset using their access token they get `FileNotFoundError: Couldn't find a dataset script at .....` . Also when they try to click the url link for the dataset they get a 404 error. ### Steps to reproduce the bug 1. Grant access to gated dataset for specific users 2. Users accept invitation 3. Users login to hugging face hub using cli login 4. Users run load_dataset ### Expected behavior Dataset is loaded normally for users who were granted access to the gated dataset. ### Environment info datasets==2.15.0 Could you report this to https://discuss.huggingface.co/c/hub/23, providing the URL of the dataset, or at least if the dataset is public or private?
[ -0.19479356706142426, -0.2718205153942108, 0.054994452744722366, 0.56523197889328, -0.0011483952403068542, 0.013401970267295837, 0.4236220717430115, -0.05075959488749504, 0.4011136293411255, 0.14345961809158325, -0.20484744012355804, -0.15554076433181763, -0.1591774970293045, 0.2002500742673874, 0.15222042798995972, 0.17857429385185242, 0.15123796463012695, -0.06239640712738037, -0.028129659593105316, -0.1068631261587143, -0.3404425084590912, 0.15602396428585052, -0.25788167119026184, 0.43954652547836304, -0.3505610525608063, 0.19939516484737396, 0.03151681274175644, 0.6065978407859802, 0.21317841112613678, -0.14902372658252716, 0.2797446846961975, 0.1416103094816208, 0.22244662046432495, 0.5309412479400635, -0.0001244534651050344, -0.11745432019233704, 0.32287800312042236, 0.10955013334751129, -0.2144305258989334, -0.2542186975479126, -0.22866925597190857, -0.1682434380054474, -0.06253556907176971, 0.016980648040771484, -0.1279141902923584, -0.25325068831443787, 0.1609487533569336, -0.05591477081179619, 0.3430842161178589, -0.04366329312324524, 0.0784965455532074, 0.1605871170759201, -0.12441743910312653, -0.0972161516547203, -0.05268099159002304, 0.14910641312599182, 0.04996544122695923, 0.3586176037788391, 0.3664611279964447, -0.20578069984912872, -0.004695206880569458, 0.026514044031500816, -0.06825046241283417, -0.22630955278873444, 0.7994069457054138, -0.15148192644119263, -0.37396910786628723, -0.23637861013412476, 0.14212831854820251, 0.23642468452453613, 0.24063950777053833, 0.04009264335036278, -0.3666795790195465, -0.41021549701690674, 0.011351342312991619, 0.15276210010051727, 0.4350978136062622, 0.21010613441467285, -0.19059735536575317, 0.26478898525238037, -0.48505860567092896, -0.31852373480796814, -0.18546585738658905, 0.055876702070236206, -0.031069161370396614, 0.2937185764312744, 0.0306885726749897, 0.1485079526901245, -0.26777517795562744, -0.27014362812042236, 0.0004920875653624535, 0.014385325834155083, -0.07210348546504974, 0.3548804223537445, -0.0750255435705185, 0.15181899070739746, 0.23604902625083923, 0.49958235025405884, 0.17232486605644226, 0.5132896304130554, -0.30561500787734985, 0.20335236191749573, -0.28707632422447205, 0.059149302542209625, 0.40704652667045593, 0.030551709234714508, 0.18081718683242798, 0.1411525458097458, 0.3995494842529297, 0.4890197217464447, 0.018921520560979843, 0.03586142137646675, -0.31322622299194336, -0.06263811141252518, -0.1801440268754959, -0.22093355655670166, 0.32845646142959595, -0.21928967535495758, -0.4588133990764618, 0.1409836709499359, 0.12723863124847412, 0.021269308403134346, 0.19977393746376038, 0.6849765181541443, 0.00025598006322979927, -0.41565650701522827, 0.12665139138698578, 0.01584751345217228, -0.046219922602176666, -0.2875204384326935, -0.18120872974395752, -0.11968876421451569, -0.2157725691795349, 0.4502629041671753, -0.03675336390733719, -0.18113398551940918, 0.18776467442512512, -0.15045596659183502, 0.03981468826532364, -0.11953970789909363, -0.2321404367685318, 0.3240031599998474, 0.006625443696975708, 0.23247338831424713, 0.27548184990882874, 0.09201645851135254, 0.08652222901582718, -0.17597751319408417, -0.01643262803554535, 0.07152242958545685, -0.3129052519798279, -0.3150283098220825, 0.10387051105499268, -0.049983758479356766, -0.4764931797981262, 0.1440282166004181, -0.09615281969308853, 0.10676977038383484, -0.21767061948776245, -0.15219774842262268, -0.08911243826150894, 0.24385811388492584, -0.23801904916763306, -0.301505446434021, 0.46604886651039124, 0.9472725987434387, 0.10655255615711212, -0.32605624198913574, 0.029220454394817352, -0.21239973604679108, -0.11472725123167038, 0.3381790518760681, -0.20592515170574188, 0.18928217887878418, -0.5056836605072021, 0.3333749771118164, -0.24500107765197754, -0.4599060118198395, -0.4288613200187683, 0.004237049259245396, -0.2750551104545593, 0.3434966504573822, -0.03582645207643509, 0.08031801879405975, 0.04455934092402458, -0.13074412941932678, 0.41710346937179565, 0.2603105902671814, 0.25128769874572754, -0.08203787356615067, -0.020487040281295776, -0.23657479882240295, 0.07436960935592651, 0.24110467731952667, 0.0576559379696846, 0.16597336530685425, 0.36613115668296814, -0.07788495719432831, 0.36127418279647827, -0.15753798186779022, -0.10641582310199738, 0.08066606521606445, 0.29095548391342163, 0.22696863114833832, 0.07125665247440338, -0.13151001930236816, -0.17452910542488098, 0.2812809646129608, 0.00719853863120079, -0.18629465997219086, 0.07210095226764679, -0.20652520656585693, -0.3797805607318878, 0.25799041986465454, -0.2828589081764221, -0.020177055150270462, -0.06302042305469513, 0.005750447511672974, -0.1832684725522995, -0.0231306329369545, -0.2991565465927124, 0.5035672187805176, -0.29039910435676575, 0.2377040982246399, -0.2820100486278534, 0.2331661432981491, 0.24130533635616302, -0.13851402699947357, 0.1988922506570816, 0.28636157512664795, 0.35380417108535767, -0.10576175153255463, 0.04998049885034561, 0.4050721824169159, -0.12123759090900421, 0.16839689016342163, 0.11727440357208252, -0.017435669898986816, 0.09837089478969574, -0.1714310646057129, -0.06466261297464371, -0.11210335791110992, -0.025911953300237656, 0.023077264428138733, -0.014757268130779266, 0.44675755500793457, -0.01155228540301323, 0.04060836508870125, 0.052423641085624695, 0.19980217516422272, -0.07959166169166565, -0.10403037071228027, -0.1474374681711197, -0.06482719630002975, 0.4284977912902832, 0.06076405569911003, -0.050954315811395645, 0.014320644550025463, -0.08436566591262817, -0.027368448674678802, 0.055814117193222046, -0.09034030139446259, 0.0972251147031784, 0.023941855877637863, -0.12651410698890686, 0.10646932572126389, 0.4046732783317566, 0.1937665194272995, 0.18181170523166656, 0.029086071997880936, -0.19816097617149353, 0.08874429762363434, 0.2100544571876526, -0.008932825177907944, 0.07270538061857224, -0.19660063087940216, -0.17613999545574188, 0.1472267508506775, -0.18370786309242249, -0.1113201156258583, -0.24284735321998596, -0.23505377769470215, -0.0971362516283989, 0.22317223250865936, -0.5771141648292542, -0.1318105012178421, -0.04700513184070587, -0.11582602560520172, 0.20712676644325256, -0.27060192823410034, -0.4165739119052887, -0.01052885502576828, -0.1912662386894226, 0.3317132592201233, 0.06057041510939598, 0.005535753909498453, -0.3504047095775604, 0.5005035996437073, -0.14711497724056244, 0.2110111266374588, -0.2934095561504364, 0.20241568982601166, -0.20579618215560913, -0.1007811427116394, 0.3828895688056946, -0.04434346780180931, 0.2267955094575882, -0.26219937205314636, 0.3049162030220032, -0.6684065461158752, -0.24527886509895325, -0.05875229090452194, -0.01912345364689827, 0.6139770746231079, 0.11568840593099594, 0.20169663429260254, -0.020694950595498085, -0.07250001281499863, 0.07905640453100204, 0.07617609947919846, -0.035393424332141876, -0.0601557232439518, -0.03699396178126335, -0.26866614818573, -0.07212445139884949, -0.004424631595611572, -0.041980594396591187, -0.19057638943195343, 0.41458994150161743, -0.014621905982494354, 0.1660839468240738, 0.2537054717540741, -0.006888553500175476, 0.1707659512758255, -0.2316492795944214, -0.150755375623703, -0.1329011768102646, -0.5117908120155334, 0.3187078535556793, -0.18521875143051147, -0.4085277020931244, 0.1375700980424881, 0.19228161871433258, 0.08867014944553375, -0.07497575879096985, -0.4323054552078247, -0.05768432095646858, -0.1558675915002823, 0.08190752565860748, -0.10749904811382294, -0.2219896763563156, -0.07790161669254303, -0.28800296783447266, 0.2126060575246811, -0.0861278772354126, -0.3792402446269989, 0.16078457236289978, -0.10145842283964157, 0.057674456387758255, 0.09195123612880707, 0.0720577985048294, -0.06308721005916595, 0.3632921576499939, 0.19638796150684357, 0.45964255928993225, 0.40550798177719116, 0.006982138380408287, 0.4267938733100891, 0.1938735693693161, -0.3849802017211914, 0.13115347921848297, 0.33786892890930176, -0.16317398846149445, 0.21740351617336273, 0.27571046352386475, 0.17687204480171204, -0.22107744216918945, -0.6246183514595032, -0.15997818112373352, -0.18075525760650635, -0.36261555552482605, 0.1458704024553299, 0.14636331796646118, 0.2680015563964844, 0.21680304408073425, -0.19071201980113983, -0.26572567224502563, 0.12315168976783752, 0.5667980909347534, 0.5822439193725586, 0.03608095645904541, -0.3045200705528259, -0.35575515031814575, -0.28179723024368286, 0.1625221073627472, -0.1420004665851593, 0.24111931025981903, -0.3956698775291443, 0.08605878800153732, 0.2591583728790283, 0.09655183553695679, 0.5307019948959351, -0.19557197391986847, 0.5012332201004028, -0.26648372411727905, 0.09009554982185364, -0.37116819620132446, -0.08473028242588043, 0.24145635962486267, 0.1819056272506714, 0.10902592539787292, 0.701671838760376, -0.0707945004105568, -0.10233456641435623, 0.13782042264938354, -0.34805044531822205, -0.27487221360206604, -0.38635706901550293, -0.21762047708034515, -0.28740498423576355, -0.3049570620059967, 0.07842054963111877, 0.019370919093489647, 0.14828327298164368, 0.10556981712579727, -0.2478119134902954, -0.024337155744433403, 0.2542089521884918, 0.0844828188419342, 0.24958167970180511, 0.2639504075050354, 0.042075641453266144, 0.144069105386734, 0.39214280247688293, 0.1443469524383545, 0.173262819647789, 0.6597055792808533, 0.39099591970443726, -0.3935675024986267, 0.08987000584602356, -0.007959735579788685, 0.15601983666419983, 0.6420345306396484, -0.24252548813819885, -0.053103528916835785, 0.3909030258655548, 0.16781730949878693, -0.1778082251548767, -0.05165644735097885, 0.06652265042066574, 0.06616432964801788, -0.34688353538513184, -0.2102149873971939, 0.07909176498651505, 0.03229412063956261, -0.09165994822978973, 0.3667689263820648, 0.6229575872421265, -0.20572176575660706, 0.06898973882198334, -0.09553010016679764, 1.1396474838256836, -0.14669229090213776, 0.23914125561714172, 0.38609766960144043, -0.1220756247639656, 0.013001659885048866, -0.09859330952167511, -0.15719950199127197, -0.37436792254447937, -0.23995356261730194, -0.08019737899303436, -0.11489106714725494, 0.01907387375831604, -0.0222613662481308, 0.28409087657928467, 0.2655908167362213, -0.16312837600708008, -0.03622157499194145, 0.12215430289506912, 0.0728827640414238, -0.35722899436950684, 0.0075340187177062035, -0.06254712492227554, -0.058353252708911896, 0.09051923453807831, 0.38607096672058105, -0.19665852189064026, -0.13001956045627594, -0.3647979497909546, -0.1327328085899353, -0.42125368118286133, 0.12630268931388855, -0.09286679327487946, -0.25798410177230835, 0.17072409391403198, -0.098054438829422, 0.23072707653045654, 0.33560264110565186, 0.02534356340765953, -0.05080866441130638, -0.4491861164569855, 0.18667811155319214, -0.34095272421836853, -0.13661859929561615, -0.1471427083015442, 0.16331622004508972, 0.33807867765426636, -0.025601260364055634, -0.1778486669063568, 0.02144419029355049, -0.08043476194143295, -0.17152023315429688, -0.44798901677131653, 0.29337942600250244, -0.02846185863018036, -0.32143649458885193, -0.22150999307632446, -0.17057880759239197, 0.18684223294258118, -0.017407475039362907, -0.025464750826358795, 0.1498599499464035, 0.12025532871484756, -0.31288379430770874, 0.4178405702114105, -0.2409820854663849, 0.021169546991586685, 0.35193783044815063, -0.2717387080192566, -0.15360084176063538, 0.41956061124801636, 0.11792604625225067, -0.011588368564844131, 0.03341927379369736, -0.044385991990566254, 0.466311514377594, -0.506330668926239, -0.15488170087337494, 0.0038047246634960175, 0.301585853099823, -0.15899087488651276, 0.06742542237043381, 0.3037319779396057, -0.36136651039123535, 0.05423792079091072, -0.4350156784057617, -0.140732079744339, 0.1451314091682434, -0.34741827845573425, -0.14886389672756195, -0.025184154510498047, -0.0852532684803009, 0.048103079199790955, -0.27099373936653137, -0.11573877930641174, -0.05268361419439316, -0.18177011609077454, -0.33752933144569397, 0.35407495498657227, 0.29888519644737244, -0.010235268622636795, -0.18635176122188568, -0.04028841480612755, -0.08579330146312714, -0.08139152824878693, 0.027163587510585785, -0.14678923785686493, 0.26823514699935913, 0.16550475358963013, -0.18805287778377533, -0.15396681427955627, -0.16202114522457123, 0.10240978002548218, -0.14252883195877075, 0.052763644605875015, 0.42854568362236023, 0.1786879599094391, -0.3516148328781128, 0.18233326077461243, 0.11326010525226593, -0.29179614782333374, 0.3376237154006958, 0.10099068284034729, 0.05865399166941643, -0.19048012793064117, -0.028726845979690552, -0.17637857794761658, -0.06112254410982132, 0.04927599057555199, 0.15361365675926208, 0.3509754538536072, 0.20143717527389526, 0.41433921456336975, -0.208657369017601, 0.18843410909175873, 0.15873563289642334, 0.22540999948978424, -0.010109789669513702, -0.3541821241378784, 0.03861217945814133, 0.038807012140750885, -0.0008437149226665497, -0.04627281427383423, -0.018959762528538704, 0.20757630467414856, 0.005990646313875914, -0.38759690523147583, 0.20115655660629272, -0.07241169363260269, -0.20398977398872375, -0.04070066660642624, 0.0026654712855815887, 0.29764360189437866, 0.2611004710197449, 0.035290852189064026, 0.060046952217817307, -0.20362694561481476, 0.17335379123687744, 0.3726535737514496, 0.09577083587646484, 0.04986847937107086, 0.5785995125770569, -0.12060040980577469, -0.010237419977784157, -0.1537187099456787, 0.41174015402793884, -0.11120188981294632, -0.6744493246078491, -0.1602853238582611, -0.06777703762054443, 0.0062459856271743774, -0.027119971811771393, -0.315912127494812, 0.431227445602417, -0.16102463006973267, -0.07703594863414764, -0.16348175704479218, 0.19199447333812714, -0.24825957417488098, 0.06510913372039795, 0.054933108389377594, -0.10609390586614609, -0.08333149552345276, -0.06137366220355034, -0.08883990347385406, -0.358386754989624, -0.3407870829105377, 0.02735629677772522, -0.1257840394973755, -0.20554929971694946, 0.02799856849014759, 0.47020334005355835, 0.09576501697301865, -0.19492961466312408, 0.13669000566005707, -0.21577797830104828, 0.050205446779727936, 0.6254989504814148, 0.06624740362167358, 0.42522117495536804, 0.19258323311805725, 0.3361566662788391, 0.37298741936683655, -0.06542566418647766, 0.11469408869743347, 0.071571484208107, 0.4438435733318329, 0.05896543338894844, 0.4935532510280609, 0.003367161378264427, 0.02392958290874958, 0.004391609691083431, -0.1068706065416336, -0.05937151983380318, 0.21498706936836243, -0.42462044954299927, 0.29767102003097534, -0.6605888605117798, -0.2159678041934967, -0.26762518286705017, -0.14000409841537476, -0.1679353415966034, 0.11910398304462433, 0.11084878444671631, 0.2557082772254944, 0.10323923081159592, -0.4279194176197052, -0.05102425813674927, 0.021633919328451157, 0.09049124270677567, 0.42667344212532043, 0.19003871083259583, -0.060545600950717926, -0.4649290442466736, -0.7800233364105225, 0.43974825739860535, 0.21472452580928802, -0.08313155919313431, 0.24240189790725708, -0.1858547180891037, -0.2749025523662567, -0.35054582357406616, 0.2728155255317688, 0.20823603868484497, 0.10725120455026627, 0.2109319269657135, -0.038147542625665665, -0.13643619418144226, -0.12225131690502167, 0.2281714826822281, -0.24228468537330627, 0.10440463572740555, 0.4373970627784729, -0.2408425658941269, -0.17780014872550964, 0.19878444075584412, -0.0941317230463028, -0.04999973252415657, 0.0214452613145113, 0.49723562598228455, -0.11889398097991943, 0.4762663245201111, 0.08632984012365341, 0.0795312449336052, -0.5750811100006104, -0.12149041891098022, -0.13937908411026, 0.19032683968544006, -0.12334322929382324, 0.058049216866493225, -0.10346821695566177, -0.1401456743478775, -0.09872293472290039, 0.4877430498600006, 0.046344123780727386, 0.11450272798538208, -0.08060609549283981, 0.03018210269510746, -0.15615692734718323, 0.12842002511024475, 0.2125626504421234, -0.008181344717741013, -0.07934065163135529, 0.1708318144083023, -0.11536140739917755, -0.1133934035897255, 0.6758311986923218, -0.5638272762298584, -0.037739887833595276, 0.1365807056427002, 0.5133485794067383, 0.13574877381324768, -0.5497492551803589, -0.1750035583972931, -0.016351424157619476, 0.20384180545806885, 0.165318101644516, 0.14841602742671967, 0.11030693352222443, -0.4577295184135437, 0.046293821185827255, -0.04147873818874359, 0.1393563598394394, 0.0377352237701416, -0.2948598563671112, 0.6429998278617859, 0.08383554965257645 ]
https://github.com/huggingface/datasets/issues/6440
`.map` not hashing under python 3.9
Tried to upgrade Python to 3.11 - still get this message. A partial solution is to NOT use `num_proc` at all. It will be considerably longer to finish the job.
### Describe the bug The `.map` function cannot hash under python 3.9. Tried to use [the solution here](https://github.com/huggingface/datasets/issues/4521#issuecomment-1205166653), but still get the same message: `Parameter 'function'=<function map_to_pred at 0x7fa0b49ead30> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.` ### Steps to reproduce the bug ```python def map_to_pred(batch): """ Perform inference on an audio batch Parameters: batch (dict): A dictionary containing audio data and other related information. Returns: dict: The input batch dictionary with added prediction and transcription fields. """ audio = batch['audio'] input_features = processor( audio['array'], sampling_rate=audio['sampling_rate'], return_tensors="pt").input_features input_features = input_features.to('cuda') with torch.no_grad(): predicted_ids = model.generate(input_features) preds = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0] batch['prediction'] = processor.tokenizer._normalize(preds) batch["transcription"] = processor.tokenizer._normalize(batch['transcription']) return batch MODEL_CARD = "openai/whisper-small" MODEL_NAME = MODEL_CARD.rsplit('/', maxsplit=1)[-1] model = WhisperForConditionalGeneration.from_pretrained(MODEL_CARD) processor = AutoProcessor.from_pretrained( MODEL_CARD, language="english", task="transcribe") model = torch.compile(model) dt = load_dataset("audiofolder", data_dir=config['DATA']['dataset'], split="test") dt = dt.cast_column("audio", Audio(sampling_rate=16000)) result = coraal_dt.map(map_to_pred, num_proc=16) ``` ### Expected behavior Hashed and cached dataset starts inferencing ### Environment info - `transformers` version: 4.35.0 - Platform: Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - Safetensors version: 0.4.0 - Accelerate version: 0.24.1 - Accelerate config: not found - PyTorch version (GPU?): 2.1.0 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no
30
`.map` not hashing under python 3.9 ### Describe the bug The `.map` function cannot hash under python 3.9. Tried to use [the solution here](https://github.com/huggingface/datasets/issues/4521#issuecomment-1205166653), but still get the same message: `Parameter 'function'=<function map_to_pred at 0x7fa0b49ead30> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.` ### Steps to reproduce the bug ```python def map_to_pred(batch): """ Perform inference on an audio batch Parameters: batch (dict): A dictionary containing audio data and other related information. Returns: dict: The input batch dictionary with added prediction and transcription fields. """ audio = batch['audio'] input_features = processor( audio['array'], sampling_rate=audio['sampling_rate'], return_tensors="pt").input_features input_features = input_features.to('cuda') with torch.no_grad(): predicted_ids = model.generate(input_features) preds = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0] batch['prediction'] = processor.tokenizer._normalize(preds) batch["transcription"] = processor.tokenizer._normalize(batch['transcription']) return batch MODEL_CARD = "openai/whisper-small" MODEL_NAME = MODEL_CARD.rsplit('/', maxsplit=1)[-1] model = WhisperForConditionalGeneration.from_pretrained(MODEL_CARD) processor = AutoProcessor.from_pretrained( MODEL_CARD, language="english", task="transcribe") model = torch.compile(model) dt = load_dataset("audiofolder", data_dir=config['DATA']['dataset'], split="test") dt = dt.cast_column("audio", Audio(sampling_rate=16000)) result = coraal_dt.map(map_to_pred, num_proc=16) ``` ### Expected behavior Hashed and cached dataset starts inferencing ### Environment info - `transformers` version: 4.35.0 - Platform: Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - Safetensors version: 0.4.0 - Accelerate version: 0.24.1 - Accelerate config: not found - PyTorch version (GPU?): 2.1.0 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no Tried to upgrade Python to 3.11 - still get this message. A partial solution is to NOT use `num_proc` at all. It will be considerably longer to finish the job.
[ -0.2377936840057373, -0.5131181478500366, 0.03972356393933296, -0.023582398891448975, 0.33920472860336304, -0.013328537344932556, 0.28753432631492615, 0.2505492866039276, 0.0820208489894867, 0.08945101499557495, 0.005709229037165642, 0.4939454197883606, -0.383242666721344, 0.06804022192955017, 0.0063207754865288734, 0.06341549009084702, 0.28068113327026367, -0.03469231724739075, 0.05651270970702171, -0.17844422161579132, -0.38540247082710266, 0.10449321568012238, -0.30220362544059753, 0.1847689151763916, 0.0362987257540226, -0.17473204433918, -0.001307215541601181, -0.16289988160133362, -0.21855401992797852, -0.1724826544523239, 0.1444472074508667, -0.15313611924648285, 0.20234042406082153, 0.6602949500083923, -0.00011445349082350731, 0.062306031584739685, 0.26205259561538696, -0.21827387809753418, 0.026305127888917923, -0.3737853765487671, -0.5196269154548645, 0.10118246078491211, -0.1309431791305542, -0.09770647436380386, -0.009887803345918655, 0.06081804260611534, -0.1492505669593811, -0.33938926458358765, 0.4184091091156006, 0.16701045632362366, 0.1684652715921402, 0.29865890741348267, 0.201091930270195, 0.18940642476081848, 0.22041338682174683, 0.1466953158378601, -0.21592605113983154, 0.3094536364078522, 0.16646067798137665, -0.2240506410598755, 0.008276678621768951, 0.3457351624965668, -0.007852835580706596, -0.09392346441745758, 0.29023033380508423, 0.036509450525045395, 0.14229506254196167, -0.5928541421890259, -0.07146571576595306, 0.22314929962158203, -0.14243686199188232, -0.3026018738746643, -0.5795168280601501, 0.03677593916654587, -0.3189478814601898, -0.2944571375846863, 0.1964212954044342, 0.040803804993629456, -0.16432644426822662, -0.16132794320583344, -0.45124730467796326, 0.12315161526203156, 0.20301350951194763, 0.18192154169082642, 0.12321652472019196, 0.32739579677581787, -0.16571825742721558, 0.1287521868944168, 0.39787641167640686, -0.3764050006866455, -0.22150811553001404, -0.06488458812236786, 0.10648899525403976, 0.2808225154876709, -0.2113543301820755, -0.14596006274223328, -0.0584246888756752, -0.21897000074386597, 0.020623311400413513, -0.2375556081533432, 0.1711759716272354, 0.3573496639728546, -0.018073085695505142, 0.1569453626871109, 0.09947995841503143, 0.12637396156787872, 0.17249616980552673, 0.3694784939289093, 0.27337318658828735, 0.18262498080730438, 0.007670443505048752, -0.013947729021310806, 0.058743782341480255, -0.24886535108089447, 0.2754320502281189, 0.2112225890159607, 0.21809576451778412, 0.004047613590955734, 0.1882902830839157, -0.12915638089179993, -0.3511546552181244, -0.07120921462774277, 0.0075222402811050415, 0.14409863948822021, 0.26378560066223145, -0.12211432307958603, 0.23288019001483917, 0.30618274211883545, -0.10123477131128311, 0.39368659257888794, -0.08974411338567734, -0.1962292492389679, -0.2988050580024719, 0.21908468008041382, -0.10286620259284973, -0.22163143754005432, 0.39874884486198425, -0.16196805238723755, 0.1047082245349884, 0.144857719540596, -0.11886070668697357, 0.18429020047187805, 0.5930718779563904, 0.10903719067573547, -0.21532553434371948, 0.3271157443523407, -0.02026660367846489, 0.1687549501657486, -0.10764143615961075, 0.17813462018966675, -0.38182154297828674, -0.258258193731308, 0.23779058456420898, 0.10840415954589844, -0.1556071788072586, 0.3187638819217682, -0.3853497803211212, 0.20195482671260834, 0.3821260333061218, -0.1738557666540146, 0.18361958861351013, -0.3435003161430359, -0.3462943434715271, -0.28974440693855286, 0.3964841067790985, 0.013370759785175323, 0.12379594147205353, -0.009273439645767212, -0.050330325961112976, 0.026078255847096443, 0.05504366382956505, 0.24540242552757263, -0.19395333528518677, -0.2023726999759674, -0.28607216477394104, 0.39339345693588257, 0.38585758209228516, -0.33840006589889526, -0.3549332022666931, -0.016016513109207153, 0.12817825376987457, 0.009297316893935204, -0.25935348868370056, -0.13969159126281738, 0.0994119867682457, -0.2653590738773346, 0.11725190281867981, 0.14299824833869934, 0.11348816752433777, 0.10907862335443497, -0.1703108549118042, -0.1295064091682434, -0.0543350875377655, -0.3272201418876648, 0.0432293601334095, 0.0005083531141281128, -0.06216015666723251, -0.07654555141925812, 0.3525603711605072, -0.03704090788960457, 0.3255369961261749, 0.04623601213097572, 0.4874853789806366, -0.4256591200828552, -0.03800302743911743, -0.2148652970790863, -0.16715416312217712, 0.19443905353546143, -0.09444227814674377, 0.014928620308637619, -0.4964446425437927, 0.016825780272483826, 0.14366409182548523, 0.1247488483786583, -0.09427185356616974, -0.13068516552448273, 0.017534654587507248, -0.10316875576972961, 0.17536596953868866, -0.043604977428913116, -0.28049981594085693, -0.3713495135307312, 0.26308009028434753, -0.12220808863639832, -0.41725993156433105, -0.054276540875434875, -0.11333958059549332, -0.340021014213562, -0.03906606510281563, 0.21078145503997803, 0.25768953561782837, -0.05519706383347511, -0.15674281120300293, 0.16601552069187164, -0.20617949962615967, -0.15192623436450958, -0.39546266198158264, 0.3704549968242645, 0.17452450096607208, -0.4306299686431885, 0.08451390266418457, 0.1855340301990509, 0.2227001041173935, -0.0688808336853981, 0.11598162353038788, 0.48026639223098755, 0.4637163579463959, 0.09725204855203629, -0.07295127958059311, 0.09781045466661453, -0.025235241279006004, 0.04316205903887749, -0.17984646558761597, -0.27730774879455566, -0.37963318824768066, -0.0629081130027771, 0.3792981505393982, 0.166087344288826, 0.22824391722679138, -0.11415337771177292, 0.6678706407546997, -0.07787127792835236, 0.15509754419326782, 0.07739822566509247, -0.42872118949890137, -0.13333135843276978, -0.05001801997423172, -0.18801061809062958, 0.08136281371116638, -0.029225751757621765, 0.2752547860145569, 0.19669155776500702, 0.008402733132243156, -0.01541818119585514, 0.07746857404708862, 0.1925702840089798, 0.24232356250286102, 0.0625264048576355, 0.026762401685118675, -0.031876713037490845, -0.0687425434589386, 0.1345498412847519, 0.04304904490709305, 0.16555555164813995, -0.5193727612495422, 0.04329808056354523, -0.128689706325531, 0.3165604770183563, -0.09478183835744858, -0.5940592885017395, -0.3146185576915741, -0.3139340877532959, 0.07316027581691742, 0.1638055294752121, -0.2547347843647003, 0.4609087407588959, 0.325478732585907, -0.10859505832195282, 0.19958065450191498, -0.27975136041641235, -0.3332521617412567, -0.20667758584022522, -0.0032850615680217743, -0.02292376570403576, 0.027572471648454666, -0.27090784907341003, -0.1294238418340683, 0.20335450768470764, -0.13083887100219727, -0.4305639863014221, -0.20189234614372253, -0.149581640958786, -0.265852153301239, 0.3524155616760254, -0.07587495446205139, 0.06720676273107529, -0.10586631298065186, -0.2548282742500305, 0.3118799924850464, -0.43305733799934387, -0.2717995345592499, 0.11652234196662903, -0.006991268135607243, -0.09359756857156754, -0.0971146672964096, -0.16401860117912292, -0.05399508774280548, -0.3968866467475891, 0.2847639322280884, -0.33735015988349915, -0.020781464874744415, 0.24025748670101166, 0.303034245967865, 0.05454803258180618, -0.2112424671649933, -0.14642705023288727, -0.09231117367744446, -0.46456125378608704, 0.5462821125984192, -0.09208875894546509, -0.17064747214317322, -0.017435792833566666, -0.11057557910680771, 0.1701207011938095, 0.42110109329223633, -0.1340828239917755, -0.2716532349586487, -0.06257334351539612, 0.17571429908275604, 0.35175377130508423, 0.13835695385932922, 0.1399257481098175, 0.09267143905162811, -0.04902966693043709, -0.1913297176361084, -0.4589391350746155, 0.018764808773994446, 0.1829231083393097, 0.27906063199043274, 0.43370941281318665, 0.48626089096069336, -0.060887835919857025, 1.108398199081421, 0.3955044746398926, -0.5543603301048279, 0.28218382596969604, 0.06544192135334015, 0.060792475938797, 0.07609814405441284, -0.26944077014923096, -0.22319400310516357, -0.040633365511894226, 0.23709739744663239, -0.07015813887119293, 0.0038827555254101753, -0.1904720515012741, -0.14226609468460083, 0.02334042638540268, -0.4749276340007782, -0.43567347526550293, 0.1550312489271164, -0.2430228292942047, 0.14436295628547668, -0.019423263147473335, 0.29436415433883667, -0.1753358542919159, -0.12690886855125427, 0.3738851845264435, -0.0861317366361618, 0.33783039450645447, 0.05954090505838394, -0.12962745130062103, -0.07287456840276718, -0.3087999224662781, 0.3399234414100647, 0.17045575380325317, 0.6840858459472656, -0.06316017359495163, -0.37375348806381226, -0.2093508094549179, 0.0891801118850708, 0.5225722789764404, -0.4462679326534271, 0.19243720173835754, -0.08630409836769104, -0.3046846389770508, -0.23335148394107819, -0.10370872914791107, -0.09125997126102448, 0.1752283275127411, 0.0963917225599289, 0.5553183555603027, -0.08795182406902313, 0.01367618702352047, -0.09954734146595001, 0.01276419684290886, -0.04358987882733345, 0.07207009196281433, -0.3961217403411865, -0.28182074427604675, -0.173757866024971, 0.0718461275100708, 0.25276505947113037, -0.09035757929086685, 0.2094324678182602, -0.1429181545972824, 0.1574619561433792, -0.05906838923692703, 0.0402771458029747, 0.1525082290172577, 0.25761905312538147, 0.347956120967865, 0.17826448380947113, 0.06025118753314018, 0.040305063128471375, -0.10656116902828217, 0.4089033901691437, -0.07351036369800568, -0.5828572511672974, -0.18070510029792786, 0.14391133189201355, 0.28433918952941895, 0.3193140923976898, -0.08848536759614944, -0.059965841472148895, 0.44740504026412964, 0.14968909323215485, -0.3466983437538147, -0.09121378511190414, 0.5245766043663025, 0.1038045883178711, -0.4123072922229767, -0.1859409660100937, 0.43678125739097595, 0.3047797679901123, -0.12456894665956497, 0.4719858467578888, -0.25834405422210693, -0.23155450820922852, 0.5084343552589417, 0.13000915944576263, 0.8452115654945374, -0.3414616584777832, -0.019290145486593246, 0.05118314549326897, 0.24202968180179596, -0.16300997138023376, 0.18409846723079681, 0.10035829991102219, -0.27466076612472534, -0.2607084810733795, 0.05299966037273407, -0.1628766804933548, -0.05862341821193695, 0.12304357439279556, -0.043267957866191864, 0.13176853954792023, 0.15219499170780182, 0.27397972345352173, 0.020735835656523705, -0.15337467193603516, 0.23807266354560852, -0.11164167523384094, -0.13389216363430023, 0.1206078976392746, 0.2885870337486267, 0.08577398955821991, 0.10872507840394974, -0.20016661286354065, -0.07093916088342667, -0.3954175114631653, -0.19803383946418762, 0.2074795961380005, -0.5334349274635315, 0.16070351004600525, 0.09139309823513031, -0.19199064373970032, 0.09290049970149994, 0.21760906279087067, 0.05961674451828003, 0.10605120658874512, -0.26374709606170654, 0.06679677218198776, 0.565182626247406, 0.2061430811882019, -0.059144504368305206, -0.13891981542110443, 0.33748847246170044, 0.09150493890047073, -0.09260230511426926, 0.11881086230278015, -0.0898868516087532, -0.2944529354572296, -0.17260006070137024, 0.10753315687179565, -0.06705427169799805, -0.18413057923316956, 0.03806472197175026, -0.05616159737110138, -0.10223427414894104, -0.05670199543237686, 0.09106512367725372, 0.09046615660190582, -0.30127015709877014, 0.38666683435440063, 0.03938489407300949, -0.35849085450172424, 0.16174478828907013, 0.6495715379714966, -0.21438023447990417, 0.004337772727012634, 0.26990753412246704, -0.007698744535446167, -0.2421867400407791, -0.05383846536278725, -0.2483314871788025, 0.09341569989919662, -0.24735581874847412, 0.21616443991661072, 0.11446716636419296, 0.04165692627429962, 0.011371833272278309, 0.2452303171157837, 0.10980407148599625, -0.23595502972602844, -0.02449101023375988, -0.14306378364562988, -0.2752871811389923, 0.3329960107803345, -0.1848667860031128, 0.37659162282943726, -0.15535792708396912, -0.04556075856089592, 0.21695426106452942, 0.16398480534553528, -0.2958167791366577, 0.1537124067544937, 0.11930220574140549, 0.2476819008588791, -0.02339773252606392, 0.0660862997174263, 0.2925237715244293, 0.049062177538871765, 0.04198690503835678, 0.13710254430770874, -0.4975772500038147, -0.10468059033155441, -0.015483435243368149, 0.09945801645517349, 0.0942603200674057, -0.19737741351127625, 0.05837748572230339, -0.11096937954425812, -0.04269057884812355, -0.29259151220321655, 0.20998969674110413, 0.36615824699401855, 0.02380206808447838, 0.31907203793525696, 0.19192299246788025, -0.1596546769142151, 0.12317235767841339, -0.03532826155424118, -0.19849658012390137, 0.058549173176288605, 0.03224923834204674, -0.03583083301782608, -0.06483328342437744, -0.09729618579149246, 0.0036218210589140654, -0.14414173364639282, -0.0015268400311470032, 0.02767079323530197, 0.37662869691848755, -0.03821060061454773, -0.11674030125141144, 0.21441155672073364, 0.3566475212574005, 0.10558471083641052, -0.3537302315235138, -0.001050332561135292, 0.2076055109500885, 0.1230863630771637, -0.2721582055091858, 0.2213241308927536, 0.07151614129543304, 0.1589994579553604, 0.15212368965148926, 0.17786957323551178, -0.014746826142072678, -0.18881681561470032, 0.053444404155015945, -0.16576850414276123, 0.14189976453781128, -0.28590869903564453, 0.31274983286857605, 0.15639621019363403, -0.11787733435630798, 0.1820940375328064, 0.27234458923339844, -0.027757421135902405, 0.2205565720796585, 0.14887088537216187, -0.12751823663711548, 0.28340446949005127, -0.035350725054740906, 0.10307878255844116, -0.15126052498817444, -0.4114086329936981, 0.020999357104301453, 0.17503570020198822, -0.054236531257629395, 0.28982990980148315, 0.24815906584262848, 0.34425973892211914, -0.1829797774553299, -0.15015438199043274, 0.013343730941414833, 0.18937702476978302, -0.21786609292030334, -0.07786999642848969, 0.026442721486091614, -0.028633493930101395, -0.1475757360458374, 0.09359697997570038, -0.06741943955421448, 0.006540093570947647, 0.8534337282180786, 0.23704273998737335, -0.04838728904724121, 0.2984389066696167, -0.4437740743160248, 0.16776758432388306, 0.4356005787849426, -0.20677927136421204, 0.20154397189617157, -0.09967203438282013, -0.07890059053897858, 0.10120232403278351, 0.3839408755302429, 0.463306725025177, 0.23475925624370575, -0.16983747482299805, 0.5514410734176636, 0.12753327190876007, 0.04411734640598297, -0.013867831788957119, 0.3973239064216614, 0.26919248700141907, 0.20886337757110596, 0.13491828739643097, 0.1463729590177536, -0.07348470389842987, 0.069094717502594, -0.12797316908836365, 0.5555217266082764, 0.059954021126031876, 0.2462221384048462, -0.2796153724193573, -0.05469849705696106, -0.15895898640155792, -0.17322757840156555, -0.2542547583580017, 0.09002847969532013, 0.30028796195983887, -0.12437085062265396, 0.1956828534603119, -0.16247844696044922, 0.06698031723499298, 0.15357831120491028, 0.3528212010860443, 0.44389182329177856, -0.02880527824163437, -0.27907904982566833, 0.08637416362762451, -0.4634920656681061, 0.096609927713871, 0.10280043631792068, 0.30544957518577576, -0.20158179104328156, -0.050155073404312134, 0.27843502163887024, 0.14637136459350586, 0.012374095618724823, -0.335766077041626, -0.21198973059654236, 0.2546343207359314, -0.26994413137435913, -0.00018212199211120605, -0.3178730010986328, 0.17543631792068481, 0.3097180724143982, -0.21153438091278076, 0.08032270520925522, -0.17635904252529144, 0.06080779433250427, -0.2158721387386322, -0.18704645335674286, 0.020770128816366196, 0.30630242824554443, 0.7786955237388611, 0.06998889893293381, 0.1258217692375183, -0.19795849919319153, -0.10289566218852997, -0.1923382580280304, 0.04860145226120949, -0.0035032755695283413, 0.06941680610179901, -0.17427636682987213, 0.31027957797050476, -0.07760757952928543, -0.1007089763879776, -0.47425925731658936, -0.2693426311016083, -0.1944008618593216, -0.16726043820381165, -0.20371000468730927, 0.22683636844158173, -0.04215595871210098, -0.1998528093099594, 0.11640782654285431, 0.2179567515850067, -0.19635197520256042, 0.0735691636800766, -0.3028497099876404, -0.46572375297546387, 0.5503382682800293, -0.448560506105423, -0.1551886647939682, -0.022692285478115082, 0.1523509919643402, -0.4455023407936096, -0.04319154471158981, -0.8106878995895386, -0.03802487626671791, 0.1973816603422165, 0.025615008547902107, -0.26196742057800293, 0.05209033936262131, -0.19247324764728546, 0.033030200749635696, -0.19975414872169495, 0.594577431678772, 0.12023252248764038, -0.16990570724010468, 0.06747516989707947, -0.17000024020671844 ]
https://github.com/huggingface/datasets/issues/6440
`.map` not hashing under python 3.9
Hi! The `model = torch.compile(model)` line is problematic for our hashing logic. We would have to merge https://github.com/huggingface/datasets/pull/5867 to support hashing `torch.compile`-ed models/functions. I've started refactoring the hashing logic and plan to incorporate a fix for `torch.compile` as part of it, so this should be addressed soon (probably this or next week).
### Describe the bug The `.map` function cannot hash under python 3.9. Tried to use [the solution here](https://github.com/huggingface/datasets/issues/4521#issuecomment-1205166653), but still get the same message: `Parameter 'function'=<function map_to_pred at 0x7fa0b49ead30> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.` ### Steps to reproduce the bug ```python def map_to_pred(batch): """ Perform inference on an audio batch Parameters: batch (dict): A dictionary containing audio data and other related information. Returns: dict: The input batch dictionary with added prediction and transcription fields. """ audio = batch['audio'] input_features = processor( audio['array'], sampling_rate=audio['sampling_rate'], return_tensors="pt").input_features input_features = input_features.to('cuda') with torch.no_grad(): predicted_ids = model.generate(input_features) preds = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0] batch['prediction'] = processor.tokenizer._normalize(preds) batch["transcription"] = processor.tokenizer._normalize(batch['transcription']) return batch MODEL_CARD = "openai/whisper-small" MODEL_NAME = MODEL_CARD.rsplit('/', maxsplit=1)[-1] model = WhisperForConditionalGeneration.from_pretrained(MODEL_CARD) processor = AutoProcessor.from_pretrained( MODEL_CARD, language="english", task="transcribe") model = torch.compile(model) dt = load_dataset("audiofolder", data_dir=config['DATA']['dataset'], split="test") dt = dt.cast_column("audio", Audio(sampling_rate=16000)) result = coraal_dt.map(map_to_pred, num_proc=16) ``` ### Expected behavior Hashed and cached dataset starts inferencing ### Environment info - `transformers` version: 4.35.0 - Platform: Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - Safetensors version: 0.4.0 - Accelerate version: 0.24.1 - Accelerate config: not found - PyTorch version (GPU?): 2.1.0 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no
52
`.map` not hashing under python 3.9 ### Describe the bug The `.map` function cannot hash under python 3.9. Tried to use [the solution here](https://github.com/huggingface/datasets/issues/4521#issuecomment-1205166653), but still get the same message: `Parameter 'function'=<function map_to_pred at 0x7fa0b49ead30> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.` ### Steps to reproduce the bug ```python def map_to_pred(batch): """ Perform inference on an audio batch Parameters: batch (dict): A dictionary containing audio data and other related information. Returns: dict: The input batch dictionary with added prediction and transcription fields. """ audio = batch['audio'] input_features = processor( audio['array'], sampling_rate=audio['sampling_rate'], return_tensors="pt").input_features input_features = input_features.to('cuda') with torch.no_grad(): predicted_ids = model.generate(input_features) preds = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0] batch['prediction'] = processor.tokenizer._normalize(preds) batch["transcription"] = processor.tokenizer._normalize(batch['transcription']) return batch MODEL_CARD = "openai/whisper-small" MODEL_NAME = MODEL_CARD.rsplit('/', maxsplit=1)[-1] model = WhisperForConditionalGeneration.from_pretrained(MODEL_CARD) processor = AutoProcessor.from_pretrained( MODEL_CARD, language="english", task="transcribe") model = torch.compile(model) dt = load_dataset("audiofolder", data_dir=config['DATA']['dataset'], split="test") dt = dt.cast_column("audio", Audio(sampling_rate=16000)) result = coraal_dt.map(map_to_pred, num_proc=16) ``` ### Expected behavior Hashed and cached dataset starts inferencing ### Environment info - `transformers` version: 4.35.0 - Platform: Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - Safetensors version: 0.4.0 - Accelerate version: 0.24.1 - Accelerate config: not found - PyTorch version (GPU?): 2.1.0 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no Hi! The `model = torch.compile(model)` line is problematic for our hashing logic. We would have to merge https://github.com/huggingface/datasets/pull/5867 to support hashing `torch.compile`-ed models/functions. I've started refactoring the hashing logic and plan to incorporate a fix for `torch.compile` as part of it, so this should be addressed soon (probably this or next week).
[ -0.2377936840057373, -0.5131181478500366, 0.03972356393933296, -0.023582398891448975, 0.33920472860336304, -0.013328537344932556, 0.28753432631492615, 0.2505492866039276, 0.0820208489894867, 0.08945101499557495, 0.005709229037165642, 0.4939454197883606, -0.383242666721344, 0.06804022192955017, 0.0063207754865288734, 0.06341549009084702, 0.28068113327026367, -0.03469231724739075, 0.05651270970702171, -0.17844422161579132, -0.38540247082710266, 0.10449321568012238, -0.30220362544059753, 0.1847689151763916, 0.0362987257540226, -0.17473204433918, -0.001307215541601181, -0.16289988160133362, -0.21855401992797852, -0.1724826544523239, 0.1444472074508667, -0.15313611924648285, 0.20234042406082153, 0.6602949500083923, -0.00011445349082350731, 0.062306031584739685, 0.26205259561538696, -0.21827387809753418, 0.026305127888917923, -0.3737853765487671, -0.5196269154548645, 0.10118246078491211, -0.1309431791305542, -0.09770647436380386, -0.009887803345918655, 0.06081804260611534, -0.1492505669593811, -0.33938926458358765, 0.4184091091156006, 0.16701045632362366, 0.1684652715921402, 0.29865890741348267, 0.201091930270195, 0.18940642476081848, 0.22041338682174683, 0.1466953158378601, -0.21592605113983154, 0.3094536364078522, 0.16646067798137665, -0.2240506410598755, 0.008276678621768951, 0.3457351624965668, -0.007852835580706596, -0.09392346441745758, 0.29023033380508423, 0.036509450525045395, 0.14229506254196167, -0.5928541421890259, -0.07146571576595306, 0.22314929962158203, -0.14243686199188232, -0.3026018738746643, -0.5795168280601501, 0.03677593916654587, -0.3189478814601898, -0.2944571375846863, 0.1964212954044342, 0.040803804993629456, -0.16432644426822662, -0.16132794320583344, -0.45124730467796326, 0.12315161526203156, 0.20301350951194763, 0.18192154169082642, 0.12321652472019196, 0.32739579677581787, -0.16571825742721558, 0.1287521868944168, 0.39787641167640686, -0.3764050006866455, -0.22150811553001404, -0.06488458812236786, 0.10648899525403976, 0.2808225154876709, -0.2113543301820755, -0.14596006274223328, -0.0584246888756752, -0.21897000074386597, 0.020623311400413513, -0.2375556081533432, 0.1711759716272354, 0.3573496639728546, -0.018073085695505142, 0.1569453626871109, 0.09947995841503143, 0.12637396156787872, 0.17249616980552673, 0.3694784939289093, 0.27337318658828735, 0.18262498080730438, 0.007670443505048752, -0.013947729021310806, 0.058743782341480255, -0.24886535108089447, 0.2754320502281189, 0.2112225890159607, 0.21809576451778412, 0.004047613590955734, 0.1882902830839157, -0.12915638089179993, -0.3511546552181244, -0.07120921462774277, 0.0075222402811050415, 0.14409863948822021, 0.26378560066223145, -0.12211432307958603, 0.23288019001483917, 0.30618274211883545, -0.10123477131128311, 0.39368659257888794, -0.08974411338567734, -0.1962292492389679, -0.2988050580024719, 0.21908468008041382, -0.10286620259284973, -0.22163143754005432, 0.39874884486198425, -0.16196805238723755, 0.1047082245349884, 0.144857719540596, -0.11886070668697357, 0.18429020047187805, 0.5930718779563904, 0.10903719067573547, -0.21532553434371948, 0.3271157443523407, -0.02026660367846489, 0.1687549501657486, -0.10764143615961075, 0.17813462018966675, -0.38182154297828674, -0.258258193731308, 0.23779058456420898, 0.10840415954589844, -0.1556071788072586, 0.3187638819217682, -0.3853497803211212, 0.20195482671260834, 0.3821260333061218, -0.1738557666540146, 0.18361958861351013, -0.3435003161430359, -0.3462943434715271, -0.28974440693855286, 0.3964841067790985, 0.013370759785175323, 0.12379594147205353, -0.009273439645767212, -0.050330325961112976, 0.026078255847096443, 0.05504366382956505, 0.24540242552757263, -0.19395333528518677, -0.2023726999759674, -0.28607216477394104, 0.39339345693588257, 0.38585758209228516, -0.33840006589889526, -0.3549332022666931, -0.016016513109207153, 0.12817825376987457, 0.009297316893935204, -0.25935348868370056, -0.13969159126281738, 0.0994119867682457, -0.2653590738773346, 0.11725190281867981, 0.14299824833869934, 0.11348816752433777, 0.10907862335443497, -0.1703108549118042, -0.1295064091682434, -0.0543350875377655, -0.3272201418876648, 0.0432293601334095, 0.0005083531141281128, -0.06216015666723251, -0.07654555141925812, 0.3525603711605072, -0.03704090788960457, 0.3255369961261749, 0.04623601213097572, 0.4874853789806366, -0.4256591200828552, -0.03800302743911743, -0.2148652970790863, -0.16715416312217712, 0.19443905353546143, -0.09444227814674377, 0.014928620308637619, -0.4964446425437927, 0.016825780272483826, 0.14366409182548523, 0.1247488483786583, -0.09427185356616974, -0.13068516552448273, 0.017534654587507248, -0.10316875576972961, 0.17536596953868866, -0.043604977428913116, -0.28049981594085693, -0.3713495135307312, 0.26308009028434753, -0.12220808863639832, -0.41725993156433105, -0.054276540875434875, -0.11333958059549332, -0.340021014213562, -0.03906606510281563, 0.21078145503997803, 0.25768953561782837, -0.05519706383347511, -0.15674281120300293, 0.16601552069187164, -0.20617949962615967, -0.15192623436450958, -0.39546266198158264, 0.3704549968242645, 0.17452450096607208, -0.4306299686431885, 0.08451390266418457, 0.1855340301990509, 0.2227001041173935, -0.0688808336853981, 0.11598162353038788, 0.48026639223098755, 0.4637163579463959, 0.09725204855203629, -0.07295127958059311, 0.09781045466661453, -0.025235241279006004, 0.04316205903887749, -0.17984646558761597, -0.27730774879455566, -0.37963318824768066, -0.0629081130027771, 0.3792981505393982, 0.166087344288826, 0.22824391722679138, -0.11415337771177292, 0.6678706407546997, -0.07787127792835236, 0.15509754419326782, 0.07739822566509247, -0.42872118949890137, -0.13333135843276978, -0.05001801997423172, -0.18801061809062958, 0.08136281371116638, -0.029225751757621765, 0.2752547860145569, 0.19669155776500702, 0.008402733132243156, -0.01541818119585514, 0.07746857404708862, 0.1925702840089798, 0.24232356250286102, 0.0625264048576355, 0.026762401685118675, -0.031876713037490845, -0.0687425434589386, 0.1345498412847519, 0.04304904490709305, 0.16555555164813995, -0.5193727612495422, 0.04329808056354523, -0.128689706325531, 0.3165604770183563, -0.09478183835744858, -0.5940592885017395, -0.3146185576915741, -0.3139340877532959, 0.07316027581691742, 0.1638055294752121, -0.2547347843647003, 0.4609087407588959, 0.325478732585907, -0.10859505832195282, 0.19958065450191498, -0.27975136041641235, -0.3332521617412567, -0.20667758584022522, -0.0032850615680217743, -0.02292376570403576, 0.027572471648454666, -0.27090784907341003, -0.1294238418340683, 0.20335450768470764, -0.13083887100219727, -0.4305639863014221, -0.20189234614372253, -0.149581640958786, -0.265852153301239, 0.3524155616760254, -0.07587495446205139, 0.06720676273107529, -0.10586631298065186, -0.2548282742500305, 0.3118799924850464, -0.43305733799934387, -0.2717995345592499, 0.11652234196662903, -0.006991268135607243, -0.09359756857156754, -0.0971146672964096, -0.16401860117912292, -0.05399508774280548, -0.3968866467475891, 0.2847639322280884, -0.33735015988349915, -0.020781464874744415, 0.24025748670101166, 0.303034245967865, 0.05454803258180618, -0.2112424671649933, -0.14642705023288727, -0.09231117367744446, -0.46456125378608704, 0.5462821125984192, -0.09208875894546509, -0.17064747214317322, -0.017435792833566666, -0.11057557910680771, 0.1701207011938095, 0.42110109329223633, -0.1340828239917755, -0.2716532349586487, -0.06257334351539612, 0.17571429908275604, 0.35175377130508423, 0.13835695385932922, 0.1399257481098175, 0.09267143905162811, -0.04902966693043709, -0.1913297176361084, -0.4589391350746155, 0.018764808773994446, 0.1829231083393097, 0.27906063199043274, 0.43370941281318665, 0.48626089096069336, -0.060887835919857025, 1.108398199081421, 0.3955044746398926, -0.5543603301048279, 0.28218382596969604, 0.06544192135334015, 0.060792475938797, 0.07609814405441284, -0.26944077014923096, -0.22319400310516357, -0.040633365511894226, 0.23709739744663239, -0.07015813887119293, 0.0038827555254101753, -0.1904720515012741, -0.14226609468460083, 0.02334042638540268, -0.4749276340007782, -0.43567347526550293, 0.1550312489271164, -0.2430228292942047, 0.14436295628547668, -0.019423263147473335, 0.29436415433883667, -0.1753358542919159, -0.12690886855125427, 0.3738851845264435, -0.0861317366361618, 0.33783039450645447, 0.05954090505838394, -0.12962745130062103, -0.07287456840276718, -0.3087999224662781, 0.3399234414100647, 0.17045575380325317, 0.6840858459472656, -0.06316017359495163, -0.37375348806381226, -0.2093508094549179, 0.0891801118850708, 0.5225722789764404, -0.4462679326534271, 0.19243720173835754, -0.08630409836769104, -0.3046846389770508, -0.23335148394107819, -0.10370872914791107, -0.09125997126102448, 0.1752283275127411, 0.0963917225599289, 0.5553183555603027, -0.08795182406902313, 0.01367618702352047, -0.09954734146595001, 0.01276419684290886, -0.04358987882733345, 0.07207009196281433, -0.3961217403411865, -0.28182074427604675, -0.173757866024971, 0.0718461275100708, 0.25276505947113037, -0.09035757929086685, 0.2094324678182602, -0.1429181545972824, 0.1574619561433792, -0.05906838923692703, 0.0402771458029747, 0.1525082290172577, 0.25761905312538147, 0.347956120967865, 0.17826448380947113, 0.06025118753314018, 0.040305063128471375, -0.10656116902828217, 0.4089033901691437, -0.07351036369800568, -0.5828572511672974, -0.18070510029792786, 0.14391133189201355, 0.28433918952941895, 0.3193140923976898, -0.08848536759614944, -0.059965841472148895, 0.44740504026412964, 0.14968909323215485, -0.3466983437538147, -0.09121378511190414, 0.5245766043663025, 0.1038045883178711, -0.4123072922229767, -0.1859409660100937, 0.43678125739097595, 0.3047797679901123, -0.12456894665956497, 0.4719858467578888, -0.25834405422210693, -0.23155450820922852, 0.5084343552589417, 0.13000915944576263, 0.8452115654945374, -0.3414616584777832, -0.019290145486593246, 0.05118314549326897, 0.24202968180179596, -0.16300997138023376, 0.18409846723079681, 0.10035829991102219, -0.27466076612472534, -0.2607084810733795, 0.05299966037273407, -0.1628766804933548, -0.05862341821193695, 0.12304357439279556, -0.043267957866191864, 0.13176853954792023, 0.15219499170780182, 0.27397972345352173, 0.020735835656523705, -0.15337467193603516, 0.23807266354560852, -0.11164167523384094, -0.13389216363430023, 0.1206078976392746, 0.2885870337486267, 0.08577398955821991, 0.10872507840394974, -0.20016661286354065, -0.07093916088342667, -0.3954175114631653, -0.19803383946418762, 0.2074795961380005, -0.5334349274635315, 0.16070351004600525, 0.09139309823513031, -0.19199064373970032, 0.09290049970149994, 0.21760906279087067, 0.05961674451828003, 0.10605120658874512, -0.26374709606170654, 0.06679677218198776, 0.565182626247406, 0.2061430811882019, -0.059144504368305206, -0.13891981542110443, 0.33748847246170044, 0.09150493890047073, -0.09260230511426926, 0.11881086230278015, -0.0898868516087532, -0.2944529354572296, -0.17260006070137024, 0.10753315687179565, -0.06705427169799805, -0.18413057923316956, 0.03806472197175026, -0.05616159737110138, -0.10223427414894104, -0.05670199543237686, 0.09106512367725372, 0.09046615660190582, -0.30127015709877014, 0.38666683435440063, 0.03938489407300949, -0.35849085450172424, 0.16174478828907013, 0.6495715379714966, -0.21438023447990417, 0.004337772727012634, 0.26990753412246704, -0.007698744535446167, -0.2421867400407791, -0.05383846536278725, -0.2483314871788025, 0.09341569989919662, -0.24735581874847412, 0.21616443991661072, 0.11446716636419296, 0.04165692627429962, 0.011371833272278309, 0.2452303171157837, 0.10980407148599625, -0.23595502972602844, -0.02449101023375988, -0.14306378364562988, -0.2752871811389923, 0.3329960107803345, -0.1848667860031128, 0.37659162282943726, -0.15535792708396912, -0.04556075856089592, 0.21695426106452942, 0.16398480534553528, -0.2958167791366577, 0.1537124067544937, 0.11930220574140549, 0.2476819008588791, -0.02339773252606392, 0.0660862997174263, 0.2925237715244293, 0.049062177538871765, 0.04198690503835678, 0.13710254430770874, -0.4975772500038147, -0.10468059033155441, -0.015483435243368149, 0.09945801645517349, 0.0942603200674057, -0.19737741351127625, 0.05837748572230339, -0.11096937954425812, -0.04269057884812355, -0.29259151220321655, 0.20998969674110413, 0.36615824699401855, 0.02380206808447838, 0.31907203793525696, 0.19192299246788025, -0.1596546769142151, 0.12317235767841339, -0.03532826155424118, -0.19849658012390137, 0.058549173176288605, 0.03224923834204674, -0.03583083301782608, -0.06483328342437744, -0.09729618579149246, 0.0036218210589140654, -0.14414173364639282, -0.0015268400311470032, 0.02767079323530197, 0.37662869691848755, -0.03821060061454773, -0.11674030125141144, 0.21441155672073364, 0.3566475212574005, 0.10558471083641052, -0.3537302315235138, -0.001050332561135292, 0.2076055109500885, 0.1230863630771637, -0.2721582055091858, 0.2213241308927536, 0.07151614129543304, 0.1589994579553604, 0.15212368965148926, 0.17786957323551178, -0.014746826142072678, -0.18881681561470032, 0.053444404155015945, -0.16576850414276123, 0.14189976453781128, -0.28590869903564453, 0.31274983286857605, 0.15639621019363403, -0.11787733435630798, 0.1820940375328064, 0.27234458923339844, -0.027757421135902405, 0.2205565720796585, 0.14887088537216187, -0.12751823663711548, 0.28340446949005127, -0.035350725054740906, 0.10307878255844116, -0.15126052498817444, -0.4114086329936981, 0.020999357104301453, 0.17503570020198822, -0.054236531257629395, 0.28982990980148315, 0.24815906584262848, 0.34425973892211914, -0.1829797774553299, -0.15015438199043274, 0.013343730941414833, 0.18937702476978302, -0.21786609292030334, -0.07786999642848969, 0.026442721486091614, -0.028633493930101395, -0.1475757360458374, 0.09359697997570038, -0.06741943955421448, 0.006540093570947647, 0.8534337282180786, 0.23704273998737335, -0.04838728904724121, 0.2984389066696167, -0.4437740743160248, 0.16776758432388306, 0.4356005787849426, -0.20677927136421204, 0.20154397189617157, -0.09967203438282013, -0.07890059053897858, 0.10120232403278351, 0.3839408755302429, 0.463306725025177, 0.23475925624370575, -0.16983747482299805, 0.5514410734176636, 0.12753327190876007, 0.04411734640598297, -0.013867831788957119, 0.3973239064216614, 0.26919248700141907, 0.20886337757110596, 0.13491828739643097, 0.1463729590177536, -0.07348470389842987, 0.069094717502594, -0.12797316908836365, 0.5555217266082764, 0.059954021126031876, 0.2462221384048462, -0.2796153724193573, -0.05469849705696106, -0.15895898640155792, -0.17322757840156555, -0.2542547583580017, 0.09002847969532013, 0.30028796195983887, -0.12437085062265396, 0.1956828534603119, -0.16247844696044922, 0.06698031723499298, 0.15357831120491028, 0.3528212010860443, 0.44389182329177856, -0.02880527824163437, -0.27907904982566833, 0.08637416362762451, -0.4634920656681061, 0.096609927713871, 0.10280043631792068, 0.30544957518577576, -0.20158179104328156, -0.050155073404312134, 0.27843502163887024, 0.14637136459350586, 0.012374095618724823, -0.335766077041626, -0.21198973059654236, 0.2546343207359314, -0.26994413137435913, -0.00018212199211120605, -0.3178730010986328, 0.17543631792068481, 0.3097180724143982, -0.21153438091278076, 0.08032270520925522, -0.17635904252529144, 0.06080779433250427, -0.2158721387386322, -0.18704645335674286, 0.020770128816366196, 0.30630242824554443, 0.7786955237388611, 0.06998889893293381, 0.1258217692375183, -0.19795849919319153, -0.10289566218852997, -0.1923382580280304, 0.04860145226120949, -0.0035032755695283413, 0.06941680610179901, -0.17427636682987213, 0.31027957797050476, -0.07760757952928543, -0.1007089763879776, -0.47425925731658936, -0.2693426311016083, -0.1944008618593216, -0.16726043820381165, -0.20371000468730927, 0.22683636844158173, -0.04215595871210098, -0.1998528093099594, 0.11640782654285431, 0.2179567515850067, -0.19635197520256042, 0.0735691636800766, -0.3028497099876404, -0.46572375297546387, 0.5503382682800293, -0.448560506105423, -0.1551886647939682, -0.022692285478115082, 0.1523509919643402, -0.4455023407936096, -0.04319154471158981, -0.8106878995895386, -0.03802487626671791, 0.1973816603422165, 0.025615008547902107, -0.26196742057800293, 0.05209033936262131, -0.19247324764728546, 0.033030200749635696, -0.19975414872169495, 0.594577431678772, 0.12023252248764038, -0.16990570724010468, 0.06747516989707947, -0.17000024020671844 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
Thank you, @severo ! I would be more than happy to help in any way I can. I am not familiar with this repo's codebase, but I would be eager to contribute. :) For the preview in Datasets Hub, I think it makes sense to just display the geospatial column as text. If there were a dataset loader, though, I think it should be able to support the geospatial components. Geopandas is probably the most user-friendly interface for that. I'm not sure if it's currently relevant in the context of geoparquet, but I think the pyogrio driver is faster than fiona. But the whole gdal dependency thing can be a real pain. If anything, it would need to be an optional dependency. Maybe it would be best if the loader tries importing relevant geospatial libraries, and in the event of an ImportError, falls back to text for the geometry column. Please let me know if I can be of assistance, and thanks again for creating this Issue. :)
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
168
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) Thank you, @severo ! I would be more than happy to help in any way I can. I am not familiar with this repo's codebase, but I would be eager to contribute. :) For the preview in Datasets Hub, I think it makes sense to just display the geospatial column as text. If there were a dataset loader, though, I think it should be able to support the geospatial components. Geopandas is probably the most user-friendly interface for that. I'm not sure if it's currently relevant in the context of geoparquet, but I think the pyogrio driver is faster than fiona. But the whole gdal dependency thing can be a real pain. If anything, it would need to be an optional dependency. Maybe it would be best if the loader tries importing relevant geospatial libraries, and in the event of an ImportError, falls back to text for the geometry column. Please let me know if I can be of assistance, and thanks again for creating this Issue. :)
[ -0.18842773139476776, -0.007291905581951141, -0.004543310031294823, 0.0861380398273468, 0.20921695232391357, -0.24514836072921753, 0.1060415506362915, 0.41238346695899963, 0.17052951455116272, 0.05875938758254051, -0.048211053013801575, 0.4327126741409302, -0.1904793381690979, 0.6723257303237915, 0.16224586963653564, -0.6249140501022339, 0.27740833163261414, 0.3452196717262268, 0.1335102766752243, 0.31721705198287964, 0.014618787914514542, 0.1354934275150299, -0.19498759508132935, 0.2715049982070923, -0.20027793943881989, -0.08174674957990646, -0.3031274378299713, 0.2856979966163635, -0.7165161967277527, -0.437052458524704, 0.25594979524612427, 0.13123543560504913, 0.5269458293914795, -0.1014697477221489, -0.00011296767479507253, 0.005294136703014374, 0.1447993516921997, 0.07846956700086594, -0.11023090779781342, -0.19821973145008087, -0.10788924247026443, -0.39246729016304016, 0.22810806334018707, -0.2528363764286041, -0.3574516177177429, -0.18613852560520172, -0.2407965511083603, -0.09156574308872223, 0.1685280203819275, -0.08844482153654099, 0.08389704674482346, 0.03029603138566017, 0.023928966373205185, -0.15802758932113647, 0.13164281845092773, 0.11845975369215012, -0.6039453148841858, -0.15262699127197266, 0.6291375160217285, 0.0763755664229393, -0.003953136503696442, 0.151725172996521, -0.12478338927030563, -0.023534663021564484, 0.07589950412511826, 0.04976577311754227, 0.1005905419588089, -0.08755294978618622, -0.14644494652748108, 0.15033258497714996, 0.7351881265640259, -0.36255934834480286, -0.2647647559642792, -0.13878720998764038, 0.2651568055152893, -0.09651397168636322, -0.050391390919685364, 0.2906879782676697, 0.17706739902496338, 0.2963546812534332, 0.043150585144758224, -0.4400748014450073, -0.3095339834690094, 0.005067013204097748, -0.036729294806718826, 0.5109574794769287, -0.1928720474243164, -0.014373816549777985, -0.07229673862457275, -0.0826549381017685, 0.24889536201953888, -0.19877928495407104, 0.09167790412902832, 0.11232049763202667, -0.20588438212871552, -0.2943214476108551, -0.30083736777305603, 0.3192707300186157, 0.2240576446056366, 0.25040408968925476, 0.02770969644188881, 0.14871084690093994, 0.23808759450912476, 0.2187701165676117, 0.49216780066490173, -0.2921600043773651, -0.013729967176914215, 0.5052903294563293, 0.009757831692695618, 0.12220948934555054, 0.47742003202438354, -0.11264286190271378, -0.1676623374223709, 0.27042436599731445, -0.5443951487541199, -0.27377042174339294, 0.2973746061325073, -0.22917000949382782, 0.027569761499762535, 0.06644540280103683, 0.3804667890071869, 0.19506467878818512, 0.10447002202272415, -0.12073452025651932, -0.12158624827861786, 0.2872923016548157, -0.14610110223293304, 0.29135674238204956, 0.12520700693130493, -0.4300685226917267, -0.1545504778623581, 0.1477995216846466, -0.16102470457553864, 0.17025037109851837, 0.07429158687591553, 0.16078239679336548, -0.13584104180335999, 0.1772208958864212, 0.22522112727165222, -0.008308567106723785, 0.014072740450501442, 0.019326386973261833, -0.3440782427787781, 0.03036179021000862, -0.1886889487504959, -0.16424442827701569, 0.2896595597267151, -0.19707417488098145, -0.2366732954978943, 0.25670045614242554, -0.3800278902053833, -0.35363394021987915, -0.44045713543891907, 0.04493853077292442, -0.2956897020339966, 0.0552411749958992, -0.3031102120876312, 0.34958615899086, -0.47135064005851746, -0.13594399392604828, -0.05478287488222122, 0.15663105249404907, -0.11024071276187897, -0.19309614598751068, 0.4241899847984314, 0.2816057801246643, -0.3472917377948761, -0.17415979504585266, 0.05932551994919777, -0.07589706778526306, 0.28241270780563354, -0.013000782579183578, -0.052038274705410004, -0.19572436809539795, -0.007472523488104343, 0.13305717706680298, 0.554941713809967, -0.22958776354789734, 0.12729546427726746, 0.19360610842704773, -0.07462344318628311, 0.12282168120145798, -0.0684397742152214, -0.052453890442848206, 0.17019708454608917, -0.09035925567150116, -0.18206164240837097, 0.5732927322387695, -0.16592833399772644, 0.14819660782814026, -0.3062174916267395, -0.4340760111808777, 0.20928288996219635, 0.6787869334220886, 0.04150913283228874, 0.03753359243273735, 0.017720453441143036, 0.09682828933000565, 0.01456526666879654, -0.15681686997413635, -0.04678431898355484, -0.18948230147361755, 0.24037814140319824, 0.15483909845352173, -0.21396222710609436, -0.2728125751018524, -0.5099748969078064, 0.21546649932861328, 0.15989263355731964, -0.03576407581567764, 0.2376249134540558, -0.05848129093647003, -0.30331993103027344, 0.08885055780410767, 0.035644568502902985, 0.02866131253540516, 0.11891774833202362, -0.07769466936588287, 0.21769271790981293, 0.07817040383815765, -0.2848919928073883, 0.36181727051734924, -0.3470686674118042, 0.04384312033653259, -0.18036159873008728, 0.4516334533691406, -0.01919260062277317, -0.03825676813721657, 0.1298685371875763, 0.2548440098762512, 0.22032234072685242, -0.005106092430651188, 0.20786356925964355, 0.5095313787460327, 0.06714475899934769, 0.19923000037670135, 0.2523455023765564, 0.4390936493873596, 0.048933882266283035, 0.02426232025027275, 0.28496506810188293, -0.6374911069869995, 0.005305618979036808, -0.010875072330236435, -0.3323736786842346, 0.4384082555770874, -0.06349463760852814, -0.05791231244802475, -0.16268998384475708, 0.10613936930894852, -0.040944069623947144, 0.06550535559654236, -0.36275798082351685, -0.0667220875620842, -0.21629609167575836, -0.07940956950187683, -0.032465819269418716, -0.271994024515152, -0.46280229091644287, -0.17930835485458374, 0.2149549424648285, -0.02490462362766266, 0.21618425846099854, 0.05706370621919632, -0.07755009084939957, 0.060289524495601654, 0.11882685869932175, 0.04148244485259056, 0.2629276216030121, 0.1876940131187439, -0.10614432394504547, 0.05381454527378082, 0.06961549073457718, -0.04387518763542175, 0.14722946286201477, 0.06236153095960617, -0.0742718055844307, -0.008388429880142212, 0.10926181077957153, -0.06878413259983063, -0.048596493899822235, 0.09797073900699615, 0.10053588449954987, 0.1416681855916977, 0.03127690777182579, -0.24588251113891602, -0.12308500707149506, 0.11232761293649673, 0.13713526725769043, 0.03938884288072586, 0.0976848304271698, -0.02175724133849144, 0.2593011260032654, -0.11528490483760834, 0.05699453130364418, 0.19889548420906067, -0.26615390181541443, 0.7580865621566772, -0.31904205679893494, -0.28761136531829834, -0.25833362340927124, -0.13433144986629486, 0.04325191304087639, 0.1439572125673294, 0.20701174437999725, 0.1209711879491806, 0.14984942972660065, 0.15930162370204926, 0.21230170130729675, -0.23611915111541748, -0.24015170335769653, 0.21490691602230072, -0.1144503504037857, 0.19831432402133942, 0.21987730264663696, 0.014802291989326477, -0.054221607744693756, 0.09028007835149765, 0.430822491645813, -0.08765773475170135, 0.09942051768302917, 0.02816636860370636, -0.07436726242303848, -0.14482133090496063, 0.030875276774168015, 0.036316726356744766, -0.4993705749511719, -0.42719897627830505, 0.11723564565181732, 0.1876077502965927, 0.07500450313091278, -0.5680190324783325, 0.11980348825454712, -0.15822768211364746, -0.0131430234760046, -0.10332418978214264, -0.08131631463766098, -0.47596198320388794, 0.22503787279129028, -0.13052445650100708, -0.10392448306083679, -0.13588900864124298, 0.3305690884590149, 0.04875672981142998, -0.0267147459089756, -0.2892501950263977, -0.30343809723854065, -0.04384215176105499, 0.028389204293489456, 0.05347152426838875, -0.1471724510192871, 0.3685200810432434, 0.024727286770939827, 0.013556884601712227, 0.04612089693546295, -0.1457391232252121, -0.22983232140541077, 0.49690771102905273, -0.28078994154930115, 0.1904333531856537, -0.2447843849658966, 0.2125815451145172, 0.14514876902103424, 0.05164668336510658, 0.0630800873041153, 0.23858918249607086, 0.18604210019111633, 0.29766157269477844, -0.1830352246761322, -0.04871856048703194, 0.24625928699970245, -0.11713004112243652, 0.14442135393619537, 0.3714131712913513, 0.1364959180355072, -0.4200896918773651, -0.320806622505188, 0.13685032725334167, -0.09931083023548126, 0.0794571191072464, 0.05269657075405121, 0.3203400671482086, 0.3616335093975067, -0.24582311511039734, -0.3487975597381592, -0.11183054745197296, -0.08910215646028519, 0.1701040416955948, 0.22026966512203217, 0.25189125537872314, 0.10597588121891022, -0.22416804730892181, 0.35676270723342896, -0.0548163577914238, 0.16400393843650818, -0.052016884088516235, 0.021569594740867615, -0.26021823287010193, -0.14124801754951477, 0.2093486189842224, -0.12394072860479355, 0.17553603649139404, -0.5091217756271362, -0.1746763437986374, 0.07318612933158875, -0.039238084107637405, -0.25696444511413574, -0.13377617299556732, -0.1744232326745987, -0.1946115642786026, 0.09097889810800552, 0.8112292885780334, -0.23174580931663513, -0.40660586953163147, 0.2212338149547577, -0.14116443693637848, 0.06486694514751434, 0.014002216048538685, -0.11552631855010986, 0.18970757722854614, -0.24261994659900665, 0.27191033959388733, 0.11197454482316971, 0.16717514395713806, 0.23076499998569489, -0.07861596345901489, -0.25856634974479675, 0.08401232957839966, -0.26931941509246826, 0.09255099296569824, 0.17558997869491577, -0.2753344178199768, -0.015369610860943794, 0.2983827292919159, 0.028385864570736885, -0.2328650951385498, 0.2993660271167755, 0.00003108009696006775, 0.019885174930095673, 0.4011821448802948, 0.04211480915546417, 0.3475229740142822, 0.30561041831970215, 0.20185226202011108, -0.059104762971401215, -0.4542029798030853, 0.1370871365070343, -0.6239125728607178, -0.30431807041168213, 0.09262867271900177, -0.30132368206977844, -0.2923141121864319, -0.2958085536956787, 0.46401408314704895, 0.16429759562015533, -0.18906033039093018, 0.05157623440027237, 0.5549057126045227, -0.03758690506219864, 0.255138635635376, 0.21524855494499207, 1.0888569355010986, -0.24279533326625824, -0.1219099760055542, 0.06587328016757965, -0.44556570053100586, 0.5298436880111694, -0.5803026556968689, -0.0042200516909360886, -0.33402785658836365, -0.36295533180236816, -0.19423170387744904, 0.0029290542006492615, 0.590410590171814, 0.04621470719575882, -0.34841570258140564, 0.042428649961948395, 0.24561052024364471, 0.2502700984477997, 0.030117742717266083, 0.22383266687393188, 0.08833891898393631, -0.24710822105407715, -0.4081505537033081, 0.19290338456630707, -0.3287043571472168, -0.4305434226989746, 0.09125404059886932, -0.1104811578989029, -0.045565731823444366, 0.013761080801486969, -0.34810757637023926, 0.20563140511512756, 0.0758841335773468, -0.09858254343271255, 0.12662577629089355, -0.38868051767349243, 0.43929746747016907, 0.23726537823677063, 0.15585651993751526, 0.0029915794730186462, -0.3351510465145111, 0.21799513697624207, -0.2302570939064026, -0.23034390807151794, -0.23050908744335175, 0.06332699209451675, -0.02386952005326748, -0.01500461995601654, -0.0020503848791122437, -0.0795467421412468, 0.00003313086926937103, -0.26545462012290955, -0.47571760416030884, -0.02489738166332245, 0.7554493546485901, -0.2938045561313629, -0.31597819924354553, -0.1304713785648346, 0.19422125816345215, -0.20328354835510254, 0.11541880667209625, 0.010808859020471573, -0.1058916226029396, -0.01604013890028, 0.356534868478775, -0.043083250522613525, 0.02361880987882614, 0.09820467233657837, 0.008956262841820717, 0.007787823677062988, -0.1574534773826599, 0.2777489423751831, -0.15964381396770477, -0.15664590895175934, 0.01572900265455246, 0.310478150844574, -0.07558395713567734, -0.29603949189186096, -0.05614485591650009, -0.15488743782043457, 0.1831267923116684, 0.09309226274490356, 0.07324299961328506, -0.30682650208473206, 0.13508085906505585, -0.31129080057144165, 0.23965679109096527, 0.11380530148744583, -0.13825005292892456, 0.311714768409729, 0.24104994535446167, -0.17136919498443604, -0.21741726994514465, 0.0835035890340805, -0.27930405735969543, 0.11995014548301697, -0.2148752361536026, 0.1970548778772354, 0.6748474836349487, -0.04556913673877716, -0.11264625191688538, -0.17366749048233032, 0.06556858867406845, 0.07687114179134369, -0.17012308537960052, -0.11282813549041748, -0.008255270309746265, 0.1654178500175476, 0.2667281925678253, 0.199044868350029, -0.23587851226329803, 0.0464206263422966, -0.2047247290611267, -0.0954536646604538, 0.2960776090621948, -0.19852373003959656, -0.0934181660413742, -0.03521069139242172, -0.14030736684799194, 0.22732722759246826, -0.19270960986614227, 0.022039882838726044, 0.029101427644491196, 0.026067547500133514, 0.21044445037841797, 0.08621987700462341, 0.026249105110764503, -0.16781887412071228, 0.11144502460956573, 0.42829862236976624, 0.4553290009498596, 0.25487521290779114, 0.4753578007221222, -0.024295739829540253, 0.0926438570022583, 0.08605334907770157, 0.3693983554840088, -0.17047521471977234, -0.029061002656817436, -0.23265960812568665, 0.33926311135292053, 0.19478879868984222, -0.15143078565597534, -0.4643840193748474, 0.2960480749607086, 0.0735948383808136, 0.0645066350698471, 0.40375903248786926, 0.4767095148563385, 0.3265470266342163, -0.3572319746017456, 0.15494918823242188, 0.660405158996582, -0.14397507905960083, 0.20488697290420532, 0.20815321803092957, -0.022327031940221786, -0.20265145599842072, -0.1739751547574997, 0.3397681713104248, -0.07557853311300278, 0.3563358783721924, -0.15656596422195435, 0.11633200943470001, 0.33503037691116333, 0.2813756763935089, 0.032788921147584915, -0.34415173530578613, 0.21356575191020966, 0.36695629358291626, 0.36557623744010925, -0.052736349403858185, -0.18276405334472656, -0.07100001722574234, 0.14150342345237732, -0.15312422811985016, -0.2519776523113251, 0.07284964621067047, 0.06571970880031586, 0.13971298933029175, -0.20716235041618347, -0.222908616065979, -0.47500327229499817, 0.10359181463718414, -0.14063304662704468, 0.13865217566490173, 0.3115457594394684, -0.14462123811244965, 0.36440378427505493, -0.2797025740146637, 0.0675622969865799, 0.4074735641479492, 0.24797511100769043, -0.2866618037223816, 0.33785751461982727, -0.0557151734828949, -0.2368885576725006, -0.07550247013568878, 0.08697323501110077, 0.08361804485321045, 0.19606877863407135, -0.16948792338371277, -0.07055256515741348, -0.18805192410945892, -0.0556480847299099, 0.3247150480747223, -0.007691219449043274, 0.05981181934475899, 0.08140388876199722, 0.23287005722522736, 0.13139906525611877, -0.022577829658985138, 0.10336148738861084, -0.10085178911685944, 0.017503440380096436, -0.3860505223274231, 0.20075374841690063, 0.3289536237716675, -0.19891920685768127, 0.14240390062332153, -0.037271492183208466, -0.26347091794013977, -0.39436599612236023, -0.21094585955142975, 0.11389881372451782, -0.026175163686275482, 0.17353157699108124, 0.06165604293346405, 0.35664060711860657, 0.22243517637252808, 0.12141549587249756, -0.3023581802845001, -0.27456334233283997, -0.46616584062576294, -0.03427770733833313, 0.03707998991012573, -0.10496650636196136, -0.21674545109272003, 0.38208693265914917, 0.05992251634597778, 0.38257282972335815, 0.5759219527244568, -0.43065881729125977, 0.5356378555297852, -0.053127553313970566, 0.036123126745224, -0.27021655440330505, 0.3026497960090637, 0.31011247634887695, -0.06944575905799866, -0.06638781726360321, -0.035004179924726486, -0.006716262549161911, 0.293198823928833, -0.09431782364845276, 0.00006162934005260468, -0.002743091434240341, -0.18779394030570984, -0.4422723352909088, 0.3112497329711914, 0.05726791173219681, 0.06826969236135483, -0.1202731728553772, 0.02673896588385105, -0.1713855117559433, -0.12647441029548645, -0.20905041694641113, 0.11636751145124435, -0.09669321775436401, 0.26538780331611633, -0.28502100706100464, -0.31274789571762085, -0.3891240060329437, -0.0825444757938385, -0.018905315548181534, 0.36237266659736633, -0.03231152892112732, 0.004783309996128082, 0.09214141219854355, -0.05109386146068573, -0.07031187415122986, -0.054257139563560486, 0.05609040707349777, 0.052987851202487946, -0.01619599014520645, -0.15600243210792542, 0.2931731045246124, 0.10845833271741867, -0.3190094828605652, 0.22554002702236176, -0.08756217360496521, 0.35814952850341797, 0.17531362175941467, -0.4859517514705658, 0.009346328675746918, 0.06324996054172516, 0.09769018739461899, 0.22994732856750488, 0.4000605642795563, 0.2361104041337967, -0.16684629023075104, -0.23461616039276123, -0.013071708381175995, 0.008978307247161865, 0.031538836658000946, -0.2271776795387268, -0.31144416332244873 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
Just hitting into this same issue too showing GeoParquet files in Datasets Viewer. I tried to implement a custom reader for GeoParquet in https://huggingface.co/datasets/weiji14/clay_vector_embeddings/discussions/1, but it seems like HuggingFace has disabled datasets with custom loading scripts from using the dataset viewer according to https://discuss.huggingface.co/t/dataset-repo-requires-arbitrary-python-code-execution/59346 :frowning_face: ![image](https://github.com/huggingface/datasets/assets/23487320/2f84d8ce-91c2-48cb-b72c-547ea8583892) I'm thinking now if there's a way to simply map files with GeoParquet extensions (*.gpq, *.geoparquet, etc) to use the Parquet reader. Maybe we could allowlist these geoparquet file extensions at https://github.com/huggingface/datasets/blame/0caf91285116ec910f409e82cc6e1f4cff7496e3/src/datasets/packaged_modules/__init__.py#L30-L51? Having the table columns show up would be a quick win. Longer term though, it would certainly be nice if the WKB geometry columns could be displayed in a nicer form. Geopandas' [read_parquet](https://geopandas.org/en/v0.14.1/docs/reference/api/geopandas.read_parquet.html) function is supposedly faster than `pyogrio.read_dataframe` according to https://github.com/geopandas/geopandas/discussions/2724#discussioncomment-4606048, but there's also [`pyogrio.raw.read_arrow`](https://pyogrio.readthedocs.io/en/latest/api.html#pyogrio.raw.read_arrow) now that can read into a `pyarrow.Table` directly.
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
132
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) Just hitting into this same issue too showing GeoParquet files in Datasets Viewer. I tried to implement a custom reader for GeoParquet in https://huggingface.co/datasets/weiji14/clay_vector_embeddings/discussions/1, but it seems like HuggingFace has disabled datasets with custom loading scripts from using the dataset viewer according to https://discuss.huggingface.co/t/dataset-repo-requires-arbitrary-python-code-execution/59346 :frowning_face: ![image](https://github.com/huggingface/datasets/assets/23487320/2f84d8ce-91c2-48cb-b72c-547ea8583892) I'm thinking now if there's a way to simply map files with GeoParquet extensions (*.gpq, *.geoparquet, etc) to use the Parquet reader. Maybe we could allowlist these geoparquet file extensions at https://github.com/huggingface/datasets/blame/0caf91285116ec910f409e82cc6e1f4cff7496e3/src/datasets/packaged_modules/__init__.py#L30-L51? Having the table columns show up would be a quick win. Longer term though, it would certainly be nice if the WKB geometry columns could be displayed in a nicer form. Geopandas' [read_parquet](https://geopandas.org/en/v0.14.1/docs/reference/api/geopandas.read_parquet.html) function is supposedly faster than `pyogrio.read_dataframe` according to https://github.com/geopandas/geopandas/discussions/2724#discussioncomment-4606048, but there's also [`pyogrio.raw.read_arrow`](https://pyogrio.readthedocs.io/en/latest/api.html#pyogrio.raw.read_arrow) now that can read into a `pyarrow.Table` directly.
[ -0.13126929104328156, -0.04446607828140259, 0.0009180661290884018, 0.19777345657348633, 0.22396178543567657, -0.06378383934497833, 0.05105587840080261, 0.2574182152748108, 0.17870508134365082, 0.09568867087364197, -0.19080086052417755, 0.4254343509674072, -0.3530285358428955, 0.6135352253913879, 0.22288855910301208, -0.47688642144203186, 0.15343905985355377, 0.2255333960056305, 0.23951731622219086, 0.28520458936691284, -0.03041796386241913, 0.22194018959999084, 0.02233520895242691, 0.19664326310157776, -0.18472857773303986, 0.017823083326220512, -0.08947700262069702, 0.23141640424728394, -0.5751276016235352, -0.48249292373657227, 0.16553032398223877, 0.11361680924892426, 0.451742559671402, 0.13259270787239075, -0.00011564743181224912, 0.17349164187908173, 0.17794063687324524, 0.07596687972545624, -0.1394716054201126, -0.2891169786453247, -0.11158059537410736, -0.2744176387786865, 0.2669334411621094, -0.11722420156002045, -0.43824881315231323, -0.22914579510688782, -0.043152570724487305, -0.27621597051620483, 0.18737486004829407, 0.003338727168738842, 0.059897180646657944, 0.2049962282180786, 0.11450152099132538, -0.015235461294651031, 0.08737638592720032, 0.2200845628976822, -0.46507972478866577, 0.00005836226046085358, 0.7685366868972778, 0.25340965390205383, -0.20659947395324707, 0.08064526319503784, -0.0389067605137825, -0.0018008165061473846, 0.24029281735420227, 0.04108721390366554, -0.02712450921535492, -0.057384803891181946, -0.12625443935394287, 0.1552494466304779, 0.4449094831943512, -0.35543474555015564, -0.3129211664199829, -0.47388097643852234, 0.09555772691965103, -0.14384779334068298, -0.004273414611816406, 0.26587745547294617, 0.19398045539855957, 0.3461093008518219, -0.11069335043430328, -0.45427948236465454, -0.23351112008094788, -0.06718406081199646, -0.11256745457649231, 0.32946115732192993, -0.2902907431125641, -0.03379566967487335, 0.01176685094833374, -0.15636977553367615, 0.001759333536028862, -0.13029544055461884, 0.08841864764690399, 0.0988130122423172, -0.14093546569347382, -0.15670232474803925, -0.19408100843429565, 0.3825313150882721, 0.2535073161125183, 0.28129541873931885, -0.05681254714727402, 0.2127874493598938, 0.03281392529606819, 0.2473081648349762, 0.41862010955810547, -0.23256756365299225, 0.01580362766981125, 0.48002341389656067, 0.017156541347503662, 0.28590157628059387, 0.3376433253288269, -0.0966779813170433, -0.06038566306233406, 0.052258238196372986, -0.609716534614563, -0.40324705839157104, 0.27884578704833984, -0.13034506142139435, 0.09647960215806961, 0.03024142235517502, 0.3588469624519348, 0.1493142992258072, 0.2930127680301666, -0.08100449293851852, 0.086342453956604, 0.11140355467796326, -0.314365029335022, 0.29487526416778564, 0.08304313570261002, -0.3966260254383087, -0.1519550085067749, 0.05329623445868492, -0.08719345927238464, 0.07943586260080338, 0.22962255775928497, -0.2747870981693268, -0.0931742936372757, 0.08555704355239868, 0.2825494408607483, 0.012185093015432358, -0.03884657472372055, 0.010400013998150826, -0.24088728427886963, 0.05026804655790329, -0.14554205536842346, -0.07458757609128952, 0.26135411858558655, -0.3194901943206787, -0.23771926760673523, 0.050811707973480225, -0.4474557042121887, -0.2796868085861206, -0.35053232312202454, 0.02151893451809883, -0.3103809952735901, 0.09528705477714539, -0.5103809833526611, 0.2643021047115326, -0.5416080951690674, -0.34419575333595276, -0.10818169265985489, 0.07121525704860687, -0.08959352970123291, -0.08240251988172531, 0.5060601234436035, 0.3141922354698181, -0.21403321623802185, -0.22638797760009766, 0.05817854031920433, -0.04297300800681114, 0.10345108807086945, 0.14175806939601898, -0.17606797814369202, -0.22615978121757507, -0.19555450975894928, 0.2494051307439804, 0.4714931845664978, -0.3210142254829407, 0.07983217388391495, 0.14259831607341766, -0.10968723893165588, 0.293710857629776, 0.040244195610284805, -0.2610055208206177, 0.18091987073421478, -0.10364587604999542, -0.14077168703079224, 0.23167681694030762, -0.03882415592670441, 0.10734247416257858, -0.2440405935049057, -0.4071427881717682, 0.20493152737617493, 0.5574469566345215, 0.09558616578578949, 0.028144821524620056, 0.1675158441066742, -0.1495143175125122, -0.030831225216388702, -0.3042474389076233, -0.01104612834751606, -0.11609938740730286, 0.06881043314933777, 0.35937297344207764, -0.1413208544254303, -0.27229687571525574, -0.6179807186126709, 0.3929368555545807, 0.015920385718345642, -0.12178462743759155, 0.002390064299106598, -0.13328948616981506, -0.17470324039459229, -0.058371759951114655, -0.1064174622297287, -0.0018461979925632477, 0.09292610734701157, -0.09018190205097198, 0.22106632590293884, 0.23377202451229095, -0.34855765104293823, 0.2318210005760193, -0.16733594238758087, 0.19211764633655548, -0.45827946066856384, 0.333761066198349, 0.08524668961763382, -0.007220468483865261, 0.16577278077602386, 0.23411431908607483, 0.19041931629180908, -0.09848474711179733, 0.26537078619003296, 0.3742036819458008, 0.14188823103904724, 0.45127081871032715, 0.21344617009162903, 0.3936759829521179, 0.12236328423023224, -0.016146451234817505, 0.18543899059295654, -0.4628680348396301, 0.001534049864858389, 0.03405153006315231, -0.44021162390708923, 0.38869279623031616, -0.06963823735713959, 0.022387832403182983, -0.01865353062748909, 0.0580916553735733, -0.04065035656094551, 0.18755632638931274, -0.42052945494651794, -0.15881681442260742, -0.10267066955566406, -0.01663844659924507, 0.2124643474817276, -0.18761290609836578, -0.43153101205825806, -0.31720083951950073, 0.11114595830440521, 0.06449736654758453, 0.05813335254788399, 0.12466142326593399, -0.1765531301498413, 0.1776297688484192, 0.22383244335651398, 0.03368931636214256, 0.050324946641922, 0.22713375091552734, 0.06649637967348099, 0.1098255068063736, 0.06374317407608032, -0.12774863839149475, 0.06838876008987427, 0.22482790052890778, -0.21885721385478973, 0.053578026592731476, 0.13618849217891693, 0.03947625681757927, -0.1973946988582611, 0.13036027550697327, -0.0012643011286854744, -0.004507854580879211, -0.2610386312007904, -0.177729532122612, -0.2831409275531769, 0.07869952917098999, 0.0021885493770241737, 0.031749557703733444, -0.0733882486820221, 0.0004321495071053505, 0.13653305172920227, -0.021035846322774887, 0.036219704896211624, -0.009672125801444054, -0.27975255250930786, 0.7445710897445679, -0.37789225578308105, -0.44331252574920654, -0.2761988341808319, -0.06586673110723495, 0.04415072128176689, 0.1053096204996109, 0.33430004119873047, 0.10405083000659943, 0.20838484168052673, 0.08202416449785233, 0.2823943495750427, -0.316755473613739, -0.28915664553642273, 0.22290503978729248, -0.14463341236114502, 0.2792739272117615, 0.27254432439804077, -0.05650986731052399, -0.1444326639175415, 0.07878543436527252, 0.3649205267429352, -0.013048411346971989, 0.20940957963466644, -0.0927322655916214, 0.04709890857338905, 0.00998158659785986, -0.13746841251850128, 0.08058126270771027, -0.35464930534362793, -0.384117066860199, 0.39915746450424194, 0.3411009907722473, -0.03051622211933136, -0.37479037046432495, 0.01982099562883377, 0.14066001772880554, -0.11309627443552017, -0.1363082230091095, -0.0350286141037941, -0.4497373402118683, 0.4692327380180359, -0.24006925523281097, -0.0747867077589035, 0.036920782178640366, 0.2598874568939209, 0.15504685044288635, 0.06018165871500969, -0.2969263195991516, -0.2604342997074127, -0.05540803074836731, -0.04517420753836632, 0.1001909077167511, -0.08270976692438126, 0.3183656930923462, 0.01338868960738182, 0.18153999745845795, -0.0009386874735355377, -0.16650687158107758, -0.08186859637498856, 0.4211542010307312, -0.4499145448207855, 0.20618411898612976, -0.10615336149930954, 0.1816200613975525, 0.2529858946800232, 0.09417206048965454, 0.12329334020614624, 0.32484111189842224, 0.061994731426239014, 0.4464062750339508, -0.15683883428573608, -0.07951723039150238, 0.16473542153835297, -0.1433008313179016, 0.0983126163482666, 0.40112805366516113, 0.29107344150543213, -0.03421191871166229, -0.31883472204208374, -0.039413996040821075, -0.02816542237997055, -0.12435546517372131, 0.01917058415710926, 0.3767998218536377, 0.34317225217819214, -0.1837003231048584, -0.1520942747592926, -0.11994506418704987, -0.14044517278671265, 0.15928342938423157, 0.3763834834098816, 0.45772692561149597, 0.18166275322437286, -0.2496972382068634, 0.21760247647762299, -0.08522490411996841, 0.19162818789482117, 0.048551563173532486, -0.11200237274169922, -0.23394741117954254, -0.004432406276464462, 0.21546506881713867, -0.12651564180850983, 0.2828841209411621, -0.29267963767051697, -0.08804990351200104, -0.030618760734796524, -0.12476617097854614, -0.30568045377731323, -0.031152300536632538, -0.009250637143850327, -0.22547045350074768, -0.04388260468840599, 0.8114938735961914, -0.22869834303855896, -0.3627939522266388, 0.05026865750551224, -0.13821810483932495, 0.06861954927444458, 0.07458635419607162, -0.052765049040317535, 0.17656174302101135, -0.3289993703365326, 0.10516346991062164, 0.23226968944072723, 0.13577379286289215, 0.17838433384895325, -0.058369383215904236, -0.2732042074203491, -0.0005209799855947495, 0.006473571062088013, 0.15005522966384888, 0.2548992931842804, -0.08487644046545029, -0.16886623203754425, 0.48762643337249756, 0.17163822054862976, -0.10729561746120453, 0.487436443567276, 0.004604728892445564, -0.4076806902885437, 0.28626319766044617, 0.05156887322664261, 0.35005804896354675, 0.24777574837207794, 0.111331045627594, -0.09627709537744522, -0.10697072744369507, 0.028086766600608826, -0.6392068266868591, -0.10910627245903015, 0.19868411123752594, -0.3647838532924652, -0.36446821689605713, -0.30002281069755554, 0.5488869547843933, 0.17812061309814453, -0.10817983746528625, 0.04742663726210594, 0.743626594543457, -0.2008422464132309, 0.09599310904741287, 0.09329379349946976, 0.8236161470413208, -0.23239468038082123, -0.032897476106882095, 0.21294230222702026, -0.4871581792831421, 0.6245019435882568, -0.52079838514328, 0.05234327167272568, -0.19112235307693481, -0.22153328359127045, -0.25084465742111206, -0.014311533421278, 0.6832266449928284, 0.17321135103702545, -0.23468941450119019, 0.19437283277511597, 0.24626295268535614, 0.2802348732948303, 0.04440072923898697, 0.3540163040161133, 0.06388784199953079, -0.2795022130012512, -0.4065653681755066, 0.11141873896121979, -0.24012543261051178, -0.37240085005760193, 0.13904565572738647, -0.19621361792087555, -0.04877325892448425, -0.03445996344089508, -0.25601768493652344, 0.024865154176950455, -0.09619652479887009, -0.13391590118408203, 0.16910231113433838, -0.34267377853393555, 0.5986865162849426, 0.19119925796985626, 0.10477524995803833, 0.029508011415600777, -0.5181100368499756, 0.1952919214963913, -0.26771432161331177, -0.23351217806339264, -0.325308620929718, 0.03679502010345459, -0.023572908714413643, 0.14525601267814636, 0.19333773851394653, -0.10385256260633469, -0.018103942275047302, -0.27519160509109497, -0.44390708208084106, 0.10036380589008331, 0.5421768426895142, -0.2657719552516937, -0.3923291563987732, -0.2960948646068573, 0.1777404099702835, -0.08651908487081528, 0.04641956090927124, -0.058662548661231995, 0.044717397540807724, -0.17838439345359802, 0.2542613744735718, -0.005342558026313782, -0.0021400637924671173, 0.18826203048229218, -0.2706370949745178, -0.11848589777946472, -0.0013882257044315338, 0.28392472863197327, -0.26543349027633667, -0.031864751130342484, -0.09792307764291763, 0.299559623003006, -0.20320087671279907, -0.17670167982578278, 0.10751042515039444, -0.08185221254825592, 0.13412411510944366, 0.02104974165558815, -0.0023612789809703827, -0.5111363530158997, 0.15755704045295715, -0.2274996042251587, 0.17944882810115814, 0.05076146870851517, -0.23746775090694427, 0.22443321347236633, 0.4879765212535858, -0.07013894617557526, -0.18028904497623444, -0.050122953951358795, -0.23283961415290833, 0.29968956112861633, 0.008374551311135292, 0.05781746655702591, 0.702238917350769, 0.03430798649787903, -0.09069806337356567, -0.20922443270683289, -0.004721831530332565, 0.12866277992725372, -0.2532239556312561, -0.04563954845070839, -0.04120698571205139, 0.1696944385766983, 0.20453572273254395, 0.1154303103685379, -0.2895602285861969, 0.06591016799211502, -0.1420774906873703, -0.19104447960853577, 0.3469010293483734, -0.1209510862827301, -0.057562872767448425, -0.06530282646417618, 0.03651431202888489, 0.06408019363880157, -0.2132587730884552, 0.06144510582089424, 0.052995093166828156, 0.09515164792537689, 0.22366806864738464, -0.02398141473531723, -0.08971019089221954, -0.062069814652204514, 0.04081527516245842, 0.48680317401885986, 0.5228949785232544, 0.2842230498790741, 0.4988953173160553, -0.0663931667804718, 0.05272822454571724, 0.1419941782951355, 0.2778746485710144, -0.004873625934123993, -0.1166125163435936, -0.17574074864387512, 0.4163428246974945, 0.07349590212106705, 0.01302821934223175, -0.37113165855407715, 0.5627470016479492, 0.06897030025720596, 0.14086726307868958, 0.3515709936618805, 0.5244770050048828, 0.25848090648651123, -0.3365369439125061, 0.1706928014755249, 0.6750239729881287, -0.13873116672039032, 0.3086017072200775, 0.20815104246139526, 0.031107652932405472, -0.2135780304670334, -0.11810079962015152, 0.38087329268455505, 0.04482697322964668, 0.1805810034275055, -0.2694917619228363, 0.10012640804052353, 0.1915227174758911, 0.28062769770622253, 0.16462580859661102, -0.469576895236969, -0.025612544268369675, 0.25947386026382446, 0.2674611806869507, 0.09372745454311371, -0.16889530420303345, 0.1373772919178009, 0.10853660106658936, -0.05482691153883934, -0.2607683837413788, 0.1034659594297409, 0.015079032629728317, 0.04840698465704918, 0.052065007388591766, -0.2810991108417511, -0.4145423173904419, 0.1271999478340149, -0.2196759283542633, 0.13612589240074158, 0.008330278098583221, -0.12695549428462982, 0.283529669046402, -0.18671908974647522, 0.0723123848438263, 0.14126834273338318, 0.2803548276424408, -0.14871308207511902, 0.3492618203163147, -0.08334334194660187, -0.21245068311691284, 0.07229124009609222, 0.17592373490333557, 0.04659649357199669, -0.0020756125450134277, 0.039475567638874054, -0.1437988579273224, -0.2439713031053543, -0.01893831230700016, 0.16010165214538574, 0.016266580671072006, -0.09389878809452057, 0.023171087726950645, 0.3177529573440552, 0.11475299298763275, 0.035092759877443314, -0.09484432637691498, -0.21815375983715057, 0.10530176758766174, -0.5670078992843628, 0.1376766562461853, 0.13501258194446564, -0.12072146683931351, 0.12255163490772247, -0.18880385160446167, -0.3757297396659851, -0.21678133308887482, -0.09043556451797485, 0.0640668049454689, -0.042870670557022095, 0.14781512320041656, 0.03539048135280609, 0.47896358370780945, 0.31199654936790466, 0.17748837172985077, -0.22204411029815674, -0.13384312391281128, -0.40842247009277344, -0.3765019476413727, 0.041302330791950226, 0.022209778428077698, -0.16427381336688995, 0.35194873809814453, -0.04836111515760422, 0.2618301212787628, 0.4364222288131714, -0.48610609769821167, 0.3980899453163147, -0.0714009627699852, -0.038495711982250214, -0.02208479680120945, 0.18238911032676697, 0.268961638212204, -0.12604162096977234, -0.049942340701818466, 0.1736125349998474, 0.1613840013742447, 0.1501782089471817, -0.11295975744724274, 0.11196170747280121, 0.28377866744995117, -0.3970167934894562, -0.4948151409626007, 0.2682625651359558, 0.1265789121389389, 0.02372419834136963, -0.1470986157655716, 0.06895100325345993, -0.31371039152145386, 0.007576921954751015, -0.25014665722846985, 0.2377835214138031, -0.23206621408462524, 0.3507090210914612, -0.3997020125389099, -0.4936508238315582, -0.3934737741947174, -0.11121625453233719, 0.0012266971170902252, 0.3593558669090271, -0.06774507462978363, 0.07807796448469162, -0.10688478499650955, -0.0009480781154707074, -0.012504895217716694, 0.04691367968916893, 0.07690167427062988, -0.006667398847639561, 0.1424180269241333, -0.1465151309967041, 0.26914331316947937, -0.23730039596557617, -0.29240506887435913, 0.23578199744224548, -0.15285494923591614, 0.4440747797489166, 0.06403913348913193, -0.5407334566116333, 0.043583355844020844, 0.16936179995536804, 0.1079115942120552, 0.29040759801864624, 0.31986942887306213, 0.19449692964553833, -0.25610673427581787, -0.2526581585407257, -0.11647465825080872, 0.2715598940849304, 0.14111971855163574, -0.08017687499523163, -0.26403099298477173 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
Update: It looks like renaming the GeoParquet file to have a file extension of `*.parquet` works (see https://huggingface.co/datasets/weiji14/clay_vector_embeddings). HuggingFace's default parquet reader is able to read the GeoParquet file, though the geometry column is of an unknown type: ![image](https://github.com/huggingface/datasets/assets/23487320/9060c300-d595-4409-9ccb-5e0207396883) I've opened a quick PR at #6508 to allow files with a `*.geoparquet` or `*.gpq` extension to be read using the default Parquet reader. Let's see how that goes :smile:
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
69
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) Update: It looks like renaming the GeoParquet file to have a file extension of `*.parquet` works (see https://huggingface.co/datasets/weiji14/clay_vector_embeddings). HuggingFace's default parquet reader is able to read the GeoParquet file, though the geometry column is of an unknown type: ![image](https://github.com/huggingface/datasets/assets/23487320/9060c300-d595-4409-9ccb-5e0207396883) I've opened a quick PR at #6508 to allow files with a `*.geoparquet` or `*.gpq` extension to be read using the default Parquet reader. Let's see how that goes :smile:
[ -0.18707825243473053, -0.14539124071598053, -0.02183523401618004, 0.18567025661468506, 0.2559494972229004, -0.14388911426067352, -0.03531947359442711, 0.3086123764514923, 0.16421110928058624, 0.08731267601251602, -0.026979725807905197, 0.3582472801208496, -0.2457117885351181, 0.6464818716049194, 0.284720242023468, -0.624435305595398, 0.2218818962574005, 0.2530815005302429, 0.2982199788093567, 0.30316853523254395, -0.006129477173089981, 0.2233651578426361, -0.08281612396240234, 0.23316100239753723, -0.16920652985572815, -0.07690215855836868, -0.24019360542297363, 0.24272167682647705, -0.6594529747962952, -0.40623047947883606, 0.2147710919380188, 0.08689434081315994, 0.48105138540267944, -0.0007548108696937561, -0.00011001799430232495, 0.05717971920967102, 0.10754804313182831, 0.07563627511262894, -0.11573298275470734, -0.23834969103336334, -0.1711062490940094, -0.3657072186470032, 0.11083244532346725, -0.1616181582212448, -0.4214695394039154, -0.1742141842842102, -0.13572295010089874, -0.16624104976654053, 0.12296928465366364, -0.07777515798807144, 0.12202571332454681, 0.1542494297027588, 0.15769794583320618, -0.10068329423666, 0.04295298457145691, 0.06695810705423355, -0.5189858078956604, -0.056445080786943436, 0.6613762378692627, 0.20928959548473358, -0.05508557707071304, 0.0774155706167221, -0.09109478443861008, 0.03854261711239815, 0.22311249375343323, 0.0940406545996666, 0.09538179636001587, 0.07978363335132599, -0.16979292035102844, 0.18584543466567993, 0.5298755764961243, -0.3388593792915344, -0.2356279492378235, -0.2648230791091919, 0.17927497625350952, -0.16371998190879822, -0.040813036262989044, 0.3051507771015167, 0.1786135584115982, 0.30400949716567993, -0.03459693118929863, -0.5092685222625732, -0.29960745573043823, 0.005179956555366516, -0.07734432816505432, 0.35477638244628906, -0.29596078395843506, -0.09167856723070145, -0.02557261660695076, -0.15793752670288086, -0.010917936451733112, -0.12278659641742706, 0.0541224479675293, 0.017595011740922928, -0.15836498141288757, -0.24182462692260742, -0.21891051530838013, 0.43476468324661255, 0.30482780933380127, 0.2476470172405243, 0.1265212893486023, 0.18496587872505188, 0.1893237829208374, 0.2923460602760315, 0.4336533844470978, -0.27792543172836304, -0.04723253846168518, 0.4106777608394623, 0.014394357800483704, 0.22312918305397034, 0.3527545630931854, -0.1610705554485321, -0.10640639811754227, 0.16383446753025055, -0.5727450847625732, -0.3326665759086609, 0.3332110643386841, -0.08782264590263367, 0.0712558925151825, 0.09328756481409073, 0.35155051946640015, 0.23677222430706024, 0.21993865072727203, -0.11631739884614944, 0.04284634068608284, 0.24974966049194336, -0.28258413076400757, 0.2577967345714569, 0.09071453660726547, -0.45790180563926697, -0.22548528015613556, 0.11429333686828613, -0.13757579028606415, 0.08793918043375015, 0.10938020050525665, -0.11925859749317169, -0.1396583467721939, 0.08195030689239502, 0.27779823541641235, -0.025181228294968605, -0.06453810632228851, 0.07077303528785706, -0.2088681161403656, 0.046850938349962234, -0.20719867944717407, -0.20951543748378754, 0.22437921166419983, -0.24828897416591644, -0.26996028423309326, 0.0939735621213913, -0.4555424451828003, -0.32400748133659363, -0.4167574346065521, 0.07003875076770782, -0.167787566781044, 0.059085097163915634, -0.35121679306030273, 0.3733001947402954, -0.5090786218643188, -0.2958647310733795, -0.04449936002492905, 0.13868004083633423, -0.12219016253948212, -0.1893509328365326, 0.46201038360595703, 0.25733351707458496, -0.26413553953170776, -0.13817772269248962, 0.16559378802776337, 0.024333985522389412, 0.11436337977647781, 0.06644206494092941, -0.08569762855768204, -0.24764132499694824, -0.05590292066335678, 0.27978038787841797, 0.4190949499607086, -0.2543475329875946, 0.14168262481689453, 0.11261358112096786, -0.05659112706780434, 0.07914775609970093, -0.06392433494329453, -0.17666684091091156, 0.13081112504005432, -0.014182218350470066, -0.01514473557472229, 0.45229125022888184, -0.16838225722312927, 0.11168324202299118, -0.32952675223350525, -0.42601504921913147, 0.1528806984424591, 0.5401378870010376, 0.042502548545598984, -0.005302146077156067, 0.04800339415669441, 0.000415705144405365, -0.035874947905540466, -0.2333042025566101, -0.041713520884513855, -0.11384239792823792, 0.24887529015541077, 0.24578215181827545, -0.16685836017131805, -0.36418354511260986, -0.5580058693885803, 0.23675426840782166, 0.15919476747512817, -0.1020435094833374, 0.15122374892234802, -0.0727386474609375, -0.22378018498420715, 0.025370730087161064, -0.06578201055526733, -0.018371354788541794, 0.14028216898441315, -0.09187924861907959, 0.1904730349779129, 0.10596896708011627, -0.3547104001045227, 0.3167451024055481, -0.21430636942386627, 0.143656387925148, -0.3781990706920624, 0.3983806073665619, 0.00693012960255146, -0.046464912593364716, 0.11806415021419525, 0.2803449332714081, 0.20864665508270264, -0.0036474864464253187, 0.28336912393569946, 0.5001114010810852, 0.001475342083722353, 0.3172471225261688, 0.2653876543045044, 0.4580302834510803, 0.10391727089881897, 0.03442183509469032, 0.16073541343212128, -0.5534076690673828, 0.0008071688935160637, 0.04640816152095795, -0.3706263601779938, 0.4506279230117798, -0.04715903475880623, -0.06863484531641006, -0.09285971522331238, 0.09091580659151077, -0.04441133141517639, 0.13933923840522766, -0.3303699791431427, -0.11009481549263, -0.15770557522773743, 0.029253963381052017, 0.09051506221294403, -0.31791847944259644, -0.4956737160682678, -0.19687116146087646, 0.1428328901529312, 0.058090467005968094, 0.15053731203079224, 0.05927666276693344, -0.1583402454853058, 0.10483541339635849, 0.181915283203125, 0.06309784948825836, 0.14308220148086548, 0.2433789223432541, 0.002189900726079941, 0.09664788097143173, -0.0020535746589303017, -0.11182058602571487, 0.08932113647460938, 0.13143670558929443, -0.20209404826164246, 0.02499181404709816, 0.17093300819396973, 0.003824988380074501, -0.2168436348438263, 0.1385582983493805, 0.021883508190512657, 0.042662739753723145, -0.09839161485433578, -0.1375800222158432, -0.18486152589321136, 0.15500342845916748, 0.061157096177339554, 0.10989398509263992, 0.005456147715449333, -0.023248158395290375, 0.19718578457832336, -0.07373498380184174, 0.0353630967438221, 0.029903406277298927, -0.3093029260635376, 0.8255171775817871, -0.3678733706474304, -0.39127352833747864, -0.328326016664505, -0.10596823692321777, 0.04854331538081169, 0.14078551530838013, 0.15001660585403442, 0.1331394761800766, 0.20790034532546997, 0.17688842117786407, 0.34906500577926636, -0.28970959782600403, -0.26543980836868286, 0.239553764462471, -0.14225082099437714, 0.2941306531429291, 0.30175405740737915, 0.030551396310329437, -0.15300482511520386, 0.08981291949748993, 0.4542239010334015, -0.1099848523736, 0.07644139975309372, 0.00579744391143322, -0.006698948331177235, -0.0874364823102951, -0.13842761516571045, 0.06350498646497726, -0.35074377059936523, -0.4181755483150482, 0.3328478932380676, 0.2613071799278259, 0.0014931708574295044, -0.5143702626228333, 0.04660541191697121, 0.048487670719623566, -0.15786023437976837, -0.11321423947811127, -0.12886515259742737, -0.49226269125938416, 0.33171766996383667, -0.17239773273468018, -0.036708105355501175, -0.08827777951955795, 0.28288328647613525, 0.09630303829908371, -0.0035644080489873886, -0.16850785911083221, -0.3352937400341034, -0.07254153490066528, 0.13736364245414734, 0.09691094607114792, -0.044879257678985596, 0.39227691292762756, -0.022701164707541466, 0.038143739104270935, 0.01026836410164833, -0.20775672793388367, -0.10010509938001633, 0.629315972328186, -0.35765233635902405, 0.16432315111160278, -0.2515750825405121, 0.2175298035144806, 0.13416969776153564, 0.03193683549761772, 0.13517673313617706, 0.3232608735561371, 0.07990023493766785, 0.4051021635532379, -0.16514533758163452, -0.05713827908039093, 0.23823679983615875, -0.15864187479019165, 0.07689977437257767, 0.4027479290962219, 0.29042917490005493, -0.0966271162033081, -0.321890652179718, 0.0003378167748451233, -0.09326556324958801, -0.044842690229415894, -0.029421338811516762, 0.32094806432724, 0.3533727526664734, -0.17635875940322876, -0.26597511768341064, -0.16564568877220154, -0.0938369557261467, 0.14154651761054993, 0.2559712529182434, 0.28225213289260864, 0.18255473673343658, -0.1727975457906723, 0.2624661922454834, -0.1406715214252472, 0.2643462121486664, 0.011134060099720955, -0.040288399904966354, -0.2572086751461029, -0.044866736978292465, 0.18254640698432922, -0.1583733707666397, 0.21767482161521912, -0.43967366218566895, -0.1526995152235031, -0.016296325251460075, 0.015326015651226044, -0.1909296065568924, -0.0471203550696373, -0.12492296099662781, -0.3547782003879547, 0.03475114330649376, 0.8068496584892273, -0.2854253649711609, -0.2978210747241974, 0.06387993693351746, -0.15447017550468445, 0.1003570407629013, 0.12681901454925537, -0.14544382691383362, 0.12189934402704239, -0.21008118987083435, 0.24671810865402222, 0.20798492431640625, 0.24631251394748688, 0.3325168788433075, 0.03966916725039482, -0.22859777510166168, 0.045989856123924255, -0.0635504424571991, 0.09885445237159729, 0.3186939060688019, -0.154917910695076, -0.1521831899881363, 0.4170345962047577, 0.11624732613563538, -0.26498547196388245, 0.3506580889225006, -0.0017450377345085144, -0.19267714023590088, 0.3360428512096405, 0.02239072695374489, 0.4027431309223175, 0.28763943910598755, 0.16373209655284882, -0.008241809904575348, -0.20324251055717468, 0.049313291907310486, -0.6362660527229309, -0.23076489567756653, 0.0945187583565712, -0.2921774685382843, -0.25121715664863586, -0.19680768251419067, 0.4275594651699066, 0.12415654957294464, -0.09248250722885132, 0.09870485961437225, 0.726796567440033, -0.12581577897071838, 0.23470115661621094, 0.14074289798736572, 1.0147099494934082, -0.20892693102359772, -0.023789498955011368, 0.20273470878601074, -0.4765332341194153, 0.5886104106903076, -0.5818634033203125, 0.08596925437450409, -0.2290850579738617, -0.19682282209396362, -0.22317154705524445, -0.02423333004117012, 0.6475554704666138, 0.05721215531229973, -0.27472835779190063, 0.08256659656763077, 0.23609255254268646, 0.2804358899593353, -0.03442355990409851, 0.2529262900352478, 0.0881272405385971, -0.25742825865745544, -0.46630939841270447, 0.18050795793533325, -0.3118646740913391, -0.45289677381515503, 0.08389081060886383, -0.2272719442844391, -0.00819849967956543, -0.0777856707572937, -0.37277787923812866, 0.0636584535241127, 0.03389882296323776, -0.10696429014205933, 0.24158021807670593, -0.36122268438339233, 0.40119901299476624, 0.14965851604938507, 0.27316945791244507, -0.018315546214580536, -0.5211243629455566, 0.21449898183345795, -0.2534409463405609, -0.2447713315486908, -0.2549492418766022, -0.00878763385117054, 0.0021124035120010376, 0.06351879239082336, 0.14770734310150146, -0.09457112103700638, 0.029081199318170547, -0.2893444299697876, -0.536916971206665, 0.10482367873191833, 0.5365915894508362, -0.26679742336273193, -0.32186150550842285, -0.15050086379051208, 0.23774123191833496, -0.1930958330631256, 0.12453775107860565, -0.0510781928896904, -0.022151799872517586, -0.17092466354370117, 0.35344788432121277, -0.05603610351681709, 0.003221338614821434, 0.07804066687822342, -0.1583092212677002, -0.11826017498970032, -0.14400434494018555, 0.29630476236343384, -0.25859135389328003, -0.0960187166929245, -0.014314629137516022, 0.3073059916496277, -0.11204931139945984, -0.21268174052238464, 0.03271200507879257, -0.155265212059021, 0.22801120579242706, 0.1416662484407425, 0.0002671666443347931, -0.4551205635070801, 0.18831384181976318, -0.22013746201992035, 0.23726190626621246, 0.11123515665531158, -0.2523695230484009, 0.2000296413898468, 0.42217597365379333, -0.023806851357221603, -0.14694038033485413, 0.003247331827878952, -0.30078569054603577, 0.22671659290790558, -0.15480253100395203, 0.10191822052001953, 0.559967041015625, -0.06349878758192062, -0.09284161031246185, -0.20995666086673737, 0.056188784539699554, 0.13074365258216858, -0.2472703456878662, -0.09791551530361176, -0.09909306466579437, 0.14004918932914734, 0.23928844928741455, 0.24024635553359985, -0.2939069867134094, 0.0759616419672966, -0.2036381959915161, -0.11594497412443161, 0.27181246876716614, -0.16550835967063904, -0.07726949453353882, -0.08400705456733704, -0.07855568826198578, 0.22318488359451294, -0.13423168659210205, -0.035539790987968445, 0.09867553412914276, 0.024320989847183228, 0.23589715361595154, -0.03431718051433563, -0.12189222127199173, -0.11168742179870605, 0.04644417390227318, 0.5332761406898499, 0.5115441083908081, 0.2425076961517334, 0.510141909122467, -0.020241886377334595, -0.021332425996661186, 0.0015681241638958454, 0.31180283427238464, -0.0839100182056427, -0.06487151235342026, -0.13692604005336761, 0.2765592336654663, 0.16780680418014526, -0.08360360562801361, -0.37303754687309265, 0.39212629199028015, 0.08070113509893417, 0.13134630024433136, 0.32096946239471436, 0.4855506122112274, 0.30012622475624084, -0.43183189630508423, 0.22491109371185303, 0.6151908040046692, -0.2803083062171936, 0.17113767564296722, 0.09388615936040878, 0.040045116096735, -0.1682072877883911, -0.09973406046628952, 0.4121091365814209, 0.01074230670928955, 0.29195645451545715, -0.19827347993850708, 0.001263124868273735, 0.312199205160141, 0.2613726258277893, 0.10721573233604431, -0.3996802866458893, 0.10897159576416016, 0.2689453959465027, 0.3361497223377228, 0.03000446781516075, -0.16259326040744781, 0.1344001591205597, 0.08822206407785416, -0.09436153620481491, -0.29783329367637634, 0.020315589383244514, -0.05448547750711441, 0.04904297739267349, -0.11210005730390549, -0.23416876792907715, -0.34124377369880676, 0.09347273409366608, -0.13455596566200256, 0.21175290644168854, 0.20126670598983765, -0.20017577707767487, 0.3733564019203186, -0.3075380027294159, 0.08616842329502106, 0.26021939516067505, 0.23494091629981995, -0.2122160643339157, 0.3622390925884247, -0.11869160830974579, -0.3242940306663513, -0.043895620852708817, 0.10672193765640259, 0.034216977655887604, 0.00422784686088562, -0.053392697125673294, -0.050775524228811264, -0.28464391827583313, -0.05573584511876106, 0.18635106086730957, -0.0019652098417282104, 0.07892892509698868, 0.10227841138839722, 0.26384100317955017, 0.17295141518115997, 0.021861594170331955, 0.05243957042694092, -0.15934650599956512, 0.10987670719623566, -0.4881419539451599, 0.12867353856563568, 0.1902475208044052, -0.15462349355220795, 0.12913787364959717, -0.1260753870010376, -0.336630642414093, -0.26682233810424805, -0.13136351108551025, 0.12406457215547562, -0.01655294932425022, 0.12523899972438812, 0.07440657168626785, 0.45496752858161926, 0.28632816672325134, 0.18735405802726746, -0.29599279165267944, -0.24882981181144714, -0.4140665531158447, -0.23249958455562592, 0.08749289065599442, -0.017033223062753677, -0.11651894450187683, 0.3397424817085266, 0.10218068957328796, 0.4256652593612671, 0.43298977613449097, -0.5518614053726196, 0.50577312707901, -0.18262699246406555, -0.02317531406879425, -0.1531403511762619, 0.23487603664398193, 0.3072139620780945, -0.10953682661056519, 0.030483588576316833, 0.1108318492770195, 0.11920670419931412, 0.24878039956092834, -0.06044531241059303, 0.05369764193892479, 0.16068609058856964, -0.3304172456264496, -0.43099433183670044, 0.21490508317947388, 0.09056243300437927, -0.04452008008956909, -0.17386680841445923, -0.0025948137044906616, -0.29111647605895996, -0.03942480310797691, -0.23864150047302246, 0.13704240322113037, -0.2198161780834198, 0.27270272374153137, -0.3410505950450897, -0.33268308639526367, -0.33522728085517883, -0.07307601720094681, 0.026437267661094666, 0.36089834570884705, -0.03677098825573921, 0.10760142654180527, 0.023087792098522186, 0.025834016501903534, -0.05731614679098129, 0.003335874527692795, 0.06298267096281052, 0.006125388666987419, 0.1094815731048584, -0.19484099745750427, 0.2695362865924835, -0.06349912285804749, -0.32408154010772705, 0.25294119119644165, -0.06515611708164215, 0.5232955813407898, 0.1250300258398056, -0.5980308055877686, -0.03125602751970291, 0.07713804394006729, 0.14394952356815338, 0.16959959268569946, 0.35680660605430603, 0.1373005509376526, -0.1823224425315857, -0.2666206955909729, -0.01861678808927536, 0.16035714745521545, 0.029301496222615242, -0.1395588517189026, -0.22735090553760529 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
@joshuasundance-swca, @weiji14, If I'm understanding this correctly, the code below wouldn't be recommended to due to dependency headaches? If that's the case, what solution would there be to see the geometry features for .gpq files in huggingfaceHub? code for dataset_loader.py ``` import geopandas as gpd # ... (other imports remain the same) class ClayVectorEmbeddings(datasets.ArrowBasedBuilder): # ... (other parts of the class remain the same) def _info(self): # Read the GeoParquet file to get the schema for the 'geometry' feature gdf = gpd.read_file("path/to/your/geoparquet/file.gpq") # Replace with your file path geometry_schema = str(gdf.geometry.dtype) return datasets.DatasetInfo( # This is the description that will appear on the datasets page. description="Clay Vector Embeddings in GeoParquet format.", # This defines the different columns of the dataset and their types features=datasets.Features( { "source_url": datasets.Value(dtype="string"), "date": datasets.Value(dtype="date32"), "embeddings": datasets.Value("string"), "geometry": datasets.Value(dtype=geometry_schema), # Use the schema read by GeoPandas # ... (other features) } ), ) # ... (rest of the script remains the same) ```
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
157
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) @joshuasundance-swca, @weiji14, If I'm understanding this correctly, the code below wouldn't be recommended to due to dependency headaches? If that's the case, what solution would there be to see the geometry features for .gpq files in huggingfaceHub? code for dataset_loader.py ``` import geopandas as gpd # ... (other imports remain the same) class ClayVectorEmbeddings(datasets.ArrowBasedBuilder): # ... (other parts of the class remain the same) def _info(self): # Read the GeoParquet file to get the schema for the 'geometry' feature gdf = gpd.read_file("path/to/your/geoparquet/file.gpq") # Replace with your file path geometry_schema = str(gdf.geometry.dtype) return datasets.DatasetInfo( # This is the description that will appear on the datasets page. description="Clay Vector Embeddings in GeoParquet format.", # This defines the different columns of the dataset and their types features=datasets.Features( { "source_url": datasets.Value(dtype="string"), "date": datasets.Value(dtype="date32"), "embeddings": datasets.Value("string"), "geometry": datasets.Value(dtype=geometry_schema), # Use the schema read by GeoPandas # ... (other features) } ), ) # ... (rest of the script remains the same) ```
[ -0.20906633138656616, -0.26573503017425537, 0.04979143664240837, 0.31051433086395264, 0.1762653887271881, -0.1647113859653473, 0.10059715807437897, 0.3131273090839386, 0.4167425334453583, 0.03970736265182495, -0.18783608078956604, 0.366243839263916, -0.18265698850154877, 0.5925232768058777, 0.29269447922706604, -0.6205483675003052, 0.17187923192977905, 0.34805774688720703, 0.08611829578876495, 0.17805622518062592, -0.040301613509655, 0.25568923354148865, -0.12426458299160004, 0.2986796796321869, -0.21180781722068787, -0.1074318215250969, -0.2463546097278595, 0.36532267928123474, -0.5456881523132324, -0.41057440638542175, 0.2598658800125122, 0.13107994198799133, 0.5367168188095093, 0.06967920064926147, -0.00011898705997737125, 0.07049594819545746, 0.07562253624200821, 0.059052541851997375, -0.07868511974811554, 0.0013443678617477417, -0.25117120146751404, -0.4823260009288788, 0.17496295273303986, -0.19708982110023499, -0.47617533802986145, -0.12851808965206146, -0.2835666537284851, -0.0949939489364624, 0.1825559139251709, -0.15871021151542664, 0.04393579438328743, 0.1918102651834488, 0.1886545866727829, 0.011130912229418755, 0.04620560631155968, -0.03124096244573593, -0.485842227935791, 0.07378453016281128, 0.7295361757278442, 0.23139522969722748, -0.028560049831867218, 0.1430393010377884, -0.0990593284368515, 0.04764170199632645, 0.2074749767780304, 0.13182245194911957, 0.10843268781900406, 0.0759519636631012, -0.18393325805664062, 0.1668981909751892, 0.4997931122779846, -0.44864553213119507, -0.366843044757843, -0.3805748522281647, 0.07029330730438232, -0.20995278656482697, -0.05781242996454239, 0.2728099226951599, 0.19430196285247803, 0.29815295338630676, -0.045790866017341614, -0.48704060912132263, -0.3277689814567566, -0.07316122949123383, -0.09153921902179718, 0.4023040533065796, -0.2557128071784973, -0.0070884376764297485, -0.15428632497787476, -0.08770649880170822, -0.03871462121605873, -0.13211554288864136, 0.12995705008506775, 0.1233309805393219, -0.2024512141942978, -0.2553671896457672, -0.1139223650097847, 0.4458999037742615, 0.3685395121574402, 0.34433823823928833, 0.026882193982601166, 0.24431785941123962, 0.11721368134021759, 0.31921544671058655, 0.40915414690971375, -0.10476367175579071, -0.0589640811085701, 0.3427647650241852, 0.17773187160491943, 0.33700671792030334, 0.27627047896385193, -0.10112959891557693, -0.1205797791481018, 0.07956304401159286, -0.40163707733154297, -0.2296646237373352, 0.40548205375671387, -0.18401136994361877, 0.0892176553606987, 0.005555137526243925, 0.3748346269130707, 0.17828042805194855, 0.19409491121768951, -0.0009307935833930969, 0.009959065355360508, 0.19520443677902222, -0.21388475596904755, 0.3258516788482666, 0.02580997906625271, -0.344342976808548, -0.18772628903388977, 0.12757767736911774, -0.10929575562477112, 0.101959228515625, 0.06408022344112396, -0.09910815954208374, -0.05906471610069275, 0.07348760217428207, 0.33794158697128296, 0.1130056083202362, -0.08031699061393738, 0.14796435832977295, -0.3232741951942444, 0.13258005678653717, -0.22170449793338776, -0.15100301802158356, 0.27450767159461975, -0.1326097548007965, -0.34884417057037354, 0.027426529675722122, -0.37121739983558655, -0.2842315137386322, -0.2971556782722473, -0.014333224855363369, -0.2056872546672821, 0.17746585607528687, -0.4280908405780792, 0.24423912167549133, -0.43936505913734436, -0.2601453363895416, -0.007140003144741058, 0.0717875212430954, -0.0833282619714737, -0.24258814752101898, 0.5048674941062927, 0.444364070892334, -0.32584652304649353, -0.3507479131221771, 0.24243739247322083, 0.0282047837972641, 0.08147263526916504, 0.09742802381515503, -0.07434790581464767, 0.015232130885124207, -0.08793629705905914, 0.23290260136127472, 0.37585341930389404, -0.3583633005619049, 0.031850580126047134, 0.18274739384651184, 0.02361348271369934, 0.2725331783294678, -0.006917037069797516, -0.23338238894939423, 0.09792392700910568, 0.08024181425571442, 0.03579046577215195, 0.4827224612236023, -0.058807097375392914, 0.2047227919101715, -0.3022089898586273, -0.424578458070755, 0.22359953820705414, 0.49164295196533203, 0.07501962035894394, 0.08181250840425491, -0.06929277628660202, -0.1975945383310318, 0.034204818308353424, -0.29095757007598877, -0.08460813015699387, -0.13801483809947968, 0.13187099993228912, 0.12621116638183594, -0.08429066091775894, -0.34103187918663025, -0.6933666467666626, 0.45904722809791565, -0.02528071589767933, -0.004377618432044983, -0.053342223167419434, 0.020264852792024612, -0.24740657210350037, 0.03890671581029892, -0.1867709755897522, -0.12119415402412415, 0.057467713952064514, -0.04710257053375244, 0.3376804292201996, 0.1031695008277893, -0.39767691493034363, 0.36367443203926086, -0.050000932067632675, 0.25472524762153625, -0.4847859740257263, 0.48725658655166626, 0.0457637682557106, -0.07178433984518051, 0.1312023252248764, 0.3393547534942627, 0.23998543620109558, -0.07483953982591629, 0.2660306990146637, 0.37023261189460754, 0.02988317795097828, 0.28313109278678894, 0.2705145478248596, 0.4264228343963623, 0.14209087193012238, 0.016390863806009293, 0.3213554322719574, -0.4226283133029938, 0.07343690097332001, 0.038860127329826355, -0.19719147682189941, 0.6193587183952332, 0.1566634327173233, 0.10465787351131439, -0.07976783066987991, 0.042307041585445404, -0.05492379516363144, 0.1441410630941391, -0.3307623565196991, 0.017870716750621796, -0.19106170535087585, -0.07481902837753296, 0.21735219657421112, -0.34514790773391724, -0.4645792245864868, -0.039679788053035736, 0.1975468546152115, 0.06969451904296875, 0.15770301222801208, -0.046392180025577545, -0.17200925946235657, 0.1800367534160614, 0.3194182813167572, -0.15115487575531006, 0.17679843306541443, 0.1640462726354599, -0.025547202676534653, 0.1896839737892151, -0.0434272326529026, -0.003544430248439312, -0.016894899308681488, 0.07612135261297226, -0.25205808877944946, 0.015224680304527283, 0.0974338948726654, -0.008285229094326496, -0.18445080518722534, 0.15939734876155853, -0.09783931076526642, 0.09955111891031265, -0.2405771017074585, -0.0432126447558403, -0.14476311206817627, 0.10288114100694656, 0.0478520467877388, 0.08744366466999054, -0.018341779708862305, -0.018419096246361732, 0.062063246965408325, -0.144057497382164, 0.03913826867938042, 0.2040407955646515, -0.20539353787899017, 0.7159321308135986, -0.27059730887413025, -0.5245054364204407, -0.30821138620376587, 0.01890469156205654, 0.018119126558303833, 0.03149617090821266, 0.07722140103578568, 0.1491823047399521, 0.17996354401111603, 0.11822674423456192, 0.32952237129211426, -0.4097687900066376, -0.1937757134437561, 0.292420893907547, -0.21232353150844574, 0.30050036311149597, 0.41352441906929016, 0.053278543055057526, -0.029673142358660698, 0.1124425008893013, 0.4406985342502594, -0.18606005609035492, 0.08031515032052994, -0.064671590924263, -0.06976328790187836, -0.0307504553347826, -0.05683380737900734, 0.10481108725070953, -0.365852952003479, -0.40844687819480896, 0.3880295753479004, 0.28220227360725403, 0.11171279847621918, -0.5917872786521912, 0.017106913030147552, 0.12041476368904114, -0.020694497972726822, -0.003017537295818329, -0.0499313585460186, -0.5036972165107727, 0.28480350971221924, -0.09926924854516983, 0.004059389233589172, -0.08264042437076569, 0.020027518272399902, 0.2764946222305298, 0.007094863802194595, -0.10215217620134354, -0.3271297812461853, -0.14616471529006958, 0.19142279028892517, 0.15559162199497223, 0.07526597380638123, 0.43695569038391113, -0.1241116151213646, 0.1595064252614975, 0.015823647379875183, -0.2709735929965973, -0.13809022307395935, 0.5803509950637817, -0.3193064033985138, 0.17529529333114624, -0.16620871424674988, -0.016758332028985023, 0.2421964555978775, -0.021007169038057327, 0.279529333114624, 0.301898717880249, 0.07912915199995041, 0.38968849182128906, -0.11636578291654587, -0.07964734733104706, 0.2219359129667282, -0.09231741726398468, -0.04867839068174362, 0.36314040422439575, 0.2602444887161255, -0.05165742337703705, -0.3220122754573822, -0.02304115518927574, -0.164878249168396, -0.1517036259174347, 0.042207375168800354, 0.44173821806907654, 0.2673395574092865, -0.2266549915075302, -0.22563400864601135, -0.10861937701702118, 0.13825014233589172, 0.1924038678407669, 0.29833656549453735, 0.3538134694099426, 0.21629558503627777, -0.2448965460062027, 0.07213761657476425, -0.16408979892730713, 0.28427034616470337, -0.02688618376851082, -0.09971744567155838, -0.1571113020181656, -0.016897685825824738, 0.23148179054260254, -0.18242602050304413, 0.24461963772773743, -0.46039098501205444, -0.06421728432178497, 0.0961073487997055, -0.17946739494800568, -0.1640293300151825, -0.09215943515300751, -0.10984334349632263, -0.39057156443595886, -0.007429536432027817, 0.7796210050582886, -0.4310486912727356, -0.2783072292804718, 0.03669131547212601, -0.059281326830387115, -0.04361775889992714, 0.08157031238079071, -0.21658581495285034, 0.06181047111749649, -0.3562735319137573, 0.230538010597229, 0.19354809820652008, 0.2180178016424179, 0.34890103340148926, 0.05747004970908165, -0.22574834525585175, 0.003937333822250366, -0.08740541338920593, 0.1870725303888321, 0.29611125588417053, -0.26655152440071106, -0.16501328349113464, 0.4284738600254059, 0.05098220705986023, -0.44599899649620056, 0.5275838375091553, -0.06553101539611816, -0.29970046877861023, 0.2734158933162689, 0.14240042865276337, 0.4489482045173645, 0.378886342048645, 0.0985332578420639, 0.06684607267379761, -0.2780444622039795, 0.13277307152748108, -0.5493555665016174, -0.1976526379585266, 0.11939990520477295, -0.22222796082496643, -0.2838441729545593, -0.3381268382072449, 0.4921245574951172, 0.058483097702264786, -0.04675256088376045, 0.1296815574169159, 0.7989686727523804, -0.09335055202245712, 0.23751533031463623, 0.036703504621982574, 1.0041171312332153, -0.19045765697956085, 0.04588658735156059, 0.395929217338562, -0.4902023673057556, 0.5853434801101685, -0.49075114727020264, -0.03107278048992157, -0.3428952395915985, -0.05152522772550583, -0.20272044837474823, -0.027202922850847244, 0.6390789151191711, -0.0014070123434066772, -0.2508181035518646, 0.28361043334007263, 0.06834997236728668, 0.22260038554668427, 0.02217905968427658, 0.11624786257743835, 0.09906104952096939, -0.4432467520236969, -0.5738610029220581, 0.07474613934755325, -0.3857871890068054, -0.26773932576179504, -0.0148999048396945, -0.21645866334438324, 0.016943853348493576, -0.0568256750702858, -0.36639702320098877, 0.0760381668806076, -0.028009027242660522, -0.16698797047138214, 0.33963659405708313, -0.4322924017906189, 0.29733341932296753, 0.07699847221374512, 0.236180379986763, -0.05175333097577095, -0.4140963852405548, 0.15421637892723083, -0.2965358793735504, -0.1787308007478714, -0.24358054995536804, 0.030013591051101685, 0.1312182992696762, 0.06199628859758377, 0.07411646097898483, -0.011906363070011139, -0.0839158371090889, -0.27741241455078125, -0.391541451215744, 0.10837879776954651, 0.4404734969139099, -0.24563530087471008, -0.38066890835762024, -0.14664523303508759, 0.2672182619571686, -0.2221226692199707, 0.02817055955529213, 0.23173515498638153, -0.1254275143146515, -0.0814133808016777, 0.2580425441265106, -0.1326388716697693, -0.030897311866283417, 0.05988074466586113, -0.0848618894815445, -0.11276354640722275, -0.1326552778482437, 0.36159586906433105, -0.1843028962612152, -0.039743997156620026, -0.13874444365501404, 0.4503075182437897, -0.1222459152340889, -0.12089555710554123, 0.08574417978525162, -0.20273874700069427, 0.07986848056316376, 0.1252935528755188, -0.011900093406438828, -0.4643977880477905, 0.19153347611427307, -0.2567538022994995, 0.11370252817869186, 0.2471645325422287, -0.2120441049337387, 0.21533924341201782, 0.4429847002029419, 0.01714225672185421, -0.14768977463245392, -0.028827304020524025, -0.22055315971374512, 0.15457355976104736, -0.1908847987651825, 0.0016393177211284637, 0.4593261480331421, 0.001861032098531723, -0.044998444616794586, -0.12824837863445282, -0.014803183265030384, 0.06748936325311661, -0.2737976312637329, -0.035090669989585876, -0.18061019480228424, 0.20582324266433716, 0.24812930822372437, 0.3005794286727905, -0.1689089983701706, 0.10312977433204651, -0.056880149990320206, -0.15500955283641815, 0.4845733046531677, -0.18545952439308167, 0.0032638758420944214, 0.01360772643238306, -0.033012498170137405, 0.07559656351804733, -0.24443410336971283, 0.0868505910038948, 0.12141057848930359, -0.15045373141765594, 0.35860738158226013, -0.09717899560928345, -0.2692009508609772, -0.12783648073673248, 0.16085697710514069, 0.4633341133594513, 0.40749692916870117, 0.2932482361793518, 0.5779169797897339, -0.10293103754520416, 0.021289799362421036, -0.11490674316883087, 0.32849788665771484, -0.12935112416744232, -0.08881155401468277, -0.12410701811313629, 0.1326855570077896, 0.04850519448518753, -0.10900718718767166, -0.3676386773586273, 0.30810654163360596, -0.1014070212841034, 0.15747325122356415, 0.4464450478553772, 0.38532549142837524, 0.3105356693267822, -0.36494797468185425, 0.15008875727653503, 0.5989715456962585, -0.20525513589382172, 0.0453605055809021, 0.20946606993675232, -0.06006152927875519, -0.054926272481679916, 0.028678497299551964, 0.5277879238128662, -0.017353937029838562, 0.18620437383651733, -0.22579360008239746, 0.0010652896016836166, 0.11609087884426117, 0.18297936022281647, 0.08967278897762299, -0.5067116618156433, -0.031764719635248184, 0.2577953636646271, 0.38714519143104553, -0.1005018875002861, -0.25472307205200195, 0.13632062077522278, -0.0038196519017219543, -0.19687582552433014, -0.17795611917972565, 0.009799197316169739, -0.06782081723213196, 0.037117280066013336, 0.11150948703289032, -0.18413865566253662, -0.26060858368873596, 0.07960650324821472, -0.21778273582458496, 0.051017921417951584, 0.04365218058228493, -0.2850646376609802, 0.27020424604415894, -0.31293192505836487, 0.01031295396387577, 0.24207940697669983, 0.13014104962348938, -0.10262464731931686, 0.37252452969551086, -0.05262546241283417, -0.17946237325668335, -0.16592393815517426, 0.03257574513554573, 0.019806012511253357, -0.05001543462276459, -0.0582222081720829, -0.12997935712337494, -0.26352888345718384, 0.01118692196905613, 0.15687483549118042, -0.0644475668668747, -0.04400426149368286, 0.15510602295398712, 0.27047470211982727, 0.08084451407194138, 0.030525464564561844, 0.03499489277601242, -0.22720463573932648, 0.09962929785251617, -0.44778648018836975, 0.3341243267059326, 0.003934098407626152, -0.22386443614959717, 0.14293701946735382, -0.05023191124200821, -0.3843967318534851, -0.2584162950515747, -0.10911861062049866, 0.11449722945690155, -0.04053940623998642, 0.14095337688922882, 0.0049935802817344666, 0.33845919370651245, 0.4057941734790802, 0.15582716464996338, -0.07342512160539627, -0.3508307933807373, -0.2922155261039734, -0.3280620574951172, 0.0683332085609436, -0.028478574007749557, -0.27654969692230225, 0.40439656376838684, 0.14964208006858826, 0.399411678314209, 0.44283485412597656, -0.4378756284713745, 0.558800458908081, -0.07637451589107513, -0.20423480868339539, -0.16769269108772278, 0.16436278820037842, 0.22102586925029755, -0.03672325611114502, 0.0472479909658432, 0.03441132605075836, 0.15163469314575195, 0.33588719367980957, -0.18008458614349365, 0.1724039763212204, 0.1730499267578125, -0.30060911178588867, -0.4562252461910248, 0.216291606426239, 0.10516206920146942, 0.07168149948120117, -0.1704217493534088, 0.01889781467616558, -0.28439468145370483, -0.10604773461818695, -0.2646346390247345, 0.07523458451032639, -0.3629677891731262, 0.40758904814720154, -0.20528806746006012, -0.20616894960403442, -0.40324667096138, 0.07131439447402954, 0.1530911922454834, 0.18720857799053192, 0.06865278631448746, 0.15977051854133606, -0.0019895173609256744, 0.05356758460402489, -0.0014637839049100876, -0.001478005200624466, 0.0320487879216671, -0.05936013162136078, 0.032781824469566345, -0.15306919813156128, 0.4480776786804199, 0.07896939665079117, -0.38556617498397827, 0.24293626844882965, -0.02413026988506317, 0.47386154532432556, 0.05136747658252716, -0.6734486818313599, 0.0013591721653938293, 0.05351376160979271, 0.14911139011383057, 0.16019295156002045, 0.42208895087242126, 0.12230299413204193, -0.16406458616256714, -0.22436654567718506, 0.03726472705602646, 0.09777985513210297, 0.08689721673727036, -0.14270062744617462, -0.22694075107574463 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
Hi @mehrdad-es, I'm not sure if HuggingFace would be keen to add `geopandas` to HuggingFace Hub (maybe a question for @severo?). Having a geometry viewer would be an even bigger task, and if you're thinking of a map-viewer, it might involve some redesign of the website UI. Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest.
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
76
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) Hi @mehrdad-es, I'm not sure if HuggingFace would be keen to add `geopandas` to HuggingFace Hub (maybe a question for @severo?). Having a geometry viewer would be an even bigger task, and if you're thinking of a map-viewer, it might involve some redesign of the website UI. Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest.
[ -0.1316765546798706, -0.40139129757881165, -0.031732238829135895, 0.21440738439559937, 0.145236998796463, -0.1536620855331421, -0.09845881164073944, 0.303332656621933, 0.13120824098587036, 0.11506611853837967, -0.1729734241962433, 0.28030723333358765, -0.15342693030834198, 0.7390541434288025, 0.3054031729698181, -0.7070499658584595, 0.23529887199401855, 0.19060733914375305, 0.13341709971427917, 0.2811569571495056, 0.023175567388534546, 0.1650647222995758, -0.09783470630645752, 0.17646212875843048, -0.20013070106506348, -0.09899067133665085, -0.31888696551322937, 0.26471760869026184, -0.5771561861038208, -0.4182893633842468, 0.2154071033000946, 0.01573842018842697, 0.4634190797805786, 0.023338302969932556, -0.00011122671276098117, -0.06052762269973755, 0.08445578813552856, 0.14174297451972961, -0.21607504785060883, -0.12540172040462494, -0.06791948527097702, -0.3620375096797943, 0.2810276746749878, -0.07779689133167267, -0.40067654848098755, -0.11353805661201477, -0.18342700600624084, -0.1430470049381256, 0.36232441663742065, -0.19866527616977692, 0.11699201166629791, 0.2541511058807373, 0.055737558752298355, -0.08206449449062347, -0.17832866311073303, 0.21464520692825317, -0.6085267066955566, -0.04033225402235985, 0.6569485664367676, 0.23674912750720978, 0.03359797224402428, 0.08919171988964081, -0.0698588564991951, 0.007165778428316116, 0.22356724739074707, 0.04447297006845474, -0.06420012563467026, -0.01918533816933632, -0.15151739120483398, 0.1830369234085083, 0.48242002725601196, -0.26790696382522583, -0.24816197156906128, -0.2845623791217804, 0.20018844306468964, -0.10834155231714249, -0.18467646837234497, 0.3053690791130066, 0.14149358868598938, 0.3773781657218933, -0.050528157502412796, -0.4569939374923706, -0.325700968503952, 0.07617886364459991, 0.06233630329370499, 0.3841765820980072, -0.2886805832386017, -0.09756734222173691, -0.03058212623000145, -0.06828448176383972, 0.10784104466438293, -0.0889756828546524, 0.16627725958824158, 0.10452933609485626, -0.10802768170833588, -0.28373247385025024, -0.1019330844283104, 0.4335592985153198, 0.38993918895721436, 0.23404179513454437, 0.09346719086170197, 0.17038166522979736, 0.1701812595129013, 0.21959710121154785, 0.4169871509075165, -0.2193213403224945, -0.016266003251075745, 0.22539803385734558, 0.04733635485172272, 0.24154628813266754, 0.4938321113586426, -0.09152383357286453, -0.0688994750380516, 0.2961885929107666, -0.5520246028900146, -0.3844117224216461, 0.3133774399757385, -0.13830885291099548, 0.18684008717536926, 0.0973273515701294, 0.37282487750053406, 0.28043341636657715, 0.2615581452846527, -0.10762681812047958, -0.07676324993371964, 0.1335950791835785, -0.24621640145778656, 0.24279431998729706, 0.19105713069438934, -0.37828758358955383, -0.21701622009277344, 0.04507739841938019, -0.15458281338214874, 0.275439590215683, 0.1277591586112976, -0.1657179743051529, -0.08985050022602081, 0.09468306601047516, 0.3804432153701782, -0.1416652947664261, -0.17979323863983154, 0.14416132867336273, -0.22679543495178223, -0.008212830871343613, -0.16209590435028076, -0.31301042437553406, 0.21159851551055908, -0.0566742978990078, -0.2216004729270935, 0.08911727368831635, -0.3247477114200592, -0.33502334356307983, -0.47144615650177, 0.026773523539304733, -0.25504961609840393, 0.08061568439006805, -0.3719109296798706, 0.3313961327075958, -0.6179539561271667, -0.15651120245456696, -0.0837855264544487, 0.333060085773468, -0.12618198990821838, -0.14447319507598877, 0.43808624148368835, 0.3334675431251526, -0.08759748935699463, -0.21944721043109894, 0.12733329832553864, 0.04936997592449188, 0.0532110333442688, 0.058958835899829865, -0.03526931256055832, -0.22462528944015503, -0.026816580444574356, 0.16776448488235474, 0.3074140250682831, -0.2955106198787689, 0.14326852560043335, 0.16075070202350616, -0.019523821771144867, 0.14451844990253448, -0.049933113157749176, -0.11648309975862503, 0.06548093259334564, -0.015721211209893227, -0.0677313506603241, 0.4214897155761719, -0.1396389901638031, 0.15430782735347748, -0.28916800022125244, -0.436633437871933, -0.023008760064840317, 0.5549637079238892, -0.027562227100133896, -0.006633572280406952, 0.07984361797571182, 0.0258527472615242, -0.029672808945178986, -0.23481014370918274, -0.059949614107608795, -0.17712847888469696, 0.21926052868366241, 0.29362672567367554, -0.22529299557209015, -0.32269081473350525, -0.6138197183609009, 0.18208998441696167, 0.11318209767341614, -0.013920940458774567, 0.16700126230716705, -0.12934252619743347, -0.2150000035762787, 0.08023645728826523, 0.01127883791923523, -0.009592752903699875, 0.14187298715114594, -0.12451343238353729, 0.252838671207428, 0.11460243165493011, -0.3884139955043793, 0.3377726674079895, -0.1767822802066803, 0.1946118324995041, -0.31631818413734436, 0.44270479679107666, 0.01777622476220131, 0.08867817372083664, 0.11201871931552887, 0.3469312787055969, 0.26098525524139404, -0.006141739897429943, 0.27136412262916565, 0.434378981590271, -0.03381127864122391, 0.26412925124168396, 0.31433430314064026, 0.45327603816986084, 0.17536282539367676, 0.05434070900082588, 0.214027538895607, -0.5548295378684998, -0.07855650782585144, -0.002126004546880722, -0.3304081857204437, 0.4098110795021057, -0.1083388477563858, 0.05160890519618988, -0.10138079524040222, 0.10826588422060013, -0.06437891721725464, 0.11529719829559326, -0.3765997588634491, -0.1578499674797058, -0.19977860152721405, -0.10076397657394409, 0.12837408483028412, -0.32873716950416565, -0.5073965787887573, -0.14503154158592224, 0.0697406604886055, -0.022754402831196785, 0.23782995343208313, 0.10767227411270142, -0.10449839383363724, 0.10489773005247116, 0.20207510888576508, 0.011182118207216263, 0.10649266839027405, 0.23728230595588684, -0.03613292798399925, 0.18670406937599182, 0.06896880269050598, -0.05057435855269432, 0.09655044227838516, 0.15027081966400146, -0.15961669385433197, -0.10419461876153946, 0.09920058399438858, -0.00433217640966177, -0.22034195065498352, 0.08440972864627838, -0.16757814586162567, 0.00944407656788826, 0.040185343474149704, -0.20258033275604248, -0.09446682780981064, -0.09337081760168076, 0.05383509770035744, 0.022469233721494675, -0.048651766031980515, -0.10123496502637863, 0.20150573551654816, -0.07360433042049408, 0.09331190586090088, 0.049771420657634735, -0.2449609339237213, 0.8881446123123169, -0.4779963791370392, -0.22512772679328918, -0.37013566493988037, -0.10267474502325058, 0.0397222526371479, 0.11663436889648438, 0.18767936527729034, 0.0780603215098381, 0.26745525002479553, 0.035894036293029785, 0.4243549108505249, -0.32286593317985535, -0.33605319261550903, 0.28719276189804077, -0.09391245245933533, 0.16653896868228912, 0.26995521783828735, 0.0900266021490097, -0.13640499114990234, 0.11119358241558075, 0.4232921600341797, -0.07216780632734299, 0.09301701188087463, -0.04878094047307968, 0.03671354800462723, -0.11296875774860382, -0.03152548894286156, 0.22400623559951782, -0.3896077573299408, -0.43045181035995483, 0.3708617091178894, 0.1606937050819397, 0.031130125746130943, -0.4949943721294403, 0.02343025803565979, 0.09399545937776566, -0.16819454729557037, -0.009565377607941628, -0.1617894470691681, -0.5235332250595093, 0.2266530990600586, -0.23646442592144012, -0.05610767379403114, -0.15347671508789062, 0.3787561058998108, 0.21761919558048248, -0.18040429055690765, -0.23975282907485962, -0.44302088022232056, -0.0805286392569542, 0.028818439692258835, 0.01435486227273941, 0.003196142613887787, 0.3222894072532654, 0.09221459925174713, 0.05420152097940445, 0.035810649394989014, -0.2328541874885559, -0.2695425748825073, 0.5046383738517761, -0.35398009419441223, 0.10983473062515259, -0.2810319662094116, 0.23553958535194397, 0.11532952636480331, 0.13421763479709625, 0.1643986999988556, 0.3276295065879822, 0.12087931483983994, 0.3591596186161041, -0.2250615954399109, -0.1297006458044052, 0.21704337000846863, -0.19128376245498657, 0.12671177089214325, 0.4510079622268677, 0.387005090713501, -0.09152930974960327, -0.42419692873954773, -0.06929343938827515, -0.19134697318077087, 0.05256364122033119, -0.017232699319720268, 0.3348548710346222, 0.3258454203605652, -0.1924678534269333, -0.3228728771209717, -0.202823206782341, -0.10305953025817871, 0.09223675727844238, 0.16629484295845032, 0.31915369629859924, 0.19494011998176575, -0.09567803144454956, 0.18437397480010986, -0.18501290678977966, 0.2953382432460785, 0.0182952880859375, -0.13496233522891998, -0.2848890423774719, -0.09588631242513657, 0.23646076023578644, -0.06103540584445, 0.14548197388648987, -0.33642709255218506, -0.20809443295001984, -0.1912204623222351, -0.15939153730869293, -0.27800607681274414, 0.10124549269676208, -0.05448426306247711, -0.3285723924636841, 0.015799330547451973, 0.851652979850769, -0.2657014727592468, -0.36042481660842896, 0.19641147553920746, -0.12234043329954147, 0.12925900518894196, 0.018991872668266296, -0.09282530844211578, 0.14340141415596008, -0.1901513934135437, 0.1647832691669464, 0.19075226783752441, 0.1611717790365219, 0.3681374788284302, -0.10983261466026306, -0.23760975897312164, 0.008957158774137497, -0.1292201429605484, 0.1939552128314972, 0.14981886744499207, -0.1452806293964386, -0.16835597157478333, 0.3694593012332916, 0.17884162068367004, -0.20897860825061798, 0.3357579708099365, 0.042909886687994, -0.09824670851230621, 0.2944980561733246, 0.1376618593931198, 0.4409329295158386, 0.3333148956298828, 0.30290475487709045, -0.04385470598936081, -0.1724826544523239, 0.18714407086372375, -0.5425962805747986, -0.3483114540576935, 0.1286761313676834, -0.17733903229236603, -0.3405480980873108, -0.09580013155937195, 0.6025462746620178, 0.1334162950515747, -0.07742605358362198, 0.158995121717453, 0.7983589768409729, -0.010581785812973976, 0.15471462905406952, 0.17485272884368896, 1.1454834938049316, -0.1954396516084671, -0.07975977659225464, 0.20548737049102783, -0.5222551226615906, 0.6374226212501526, -0.4976901412010193, 0.019817989319562912, -0.15497519075870514, -0.17765913903713226, -0.22734904289245605, 0.03509608283638954, 0.5531768798828125, -0.0630611702799797, -0.26820093393325806, 0.06725622713565826, 0.18133653700351715, 0.29052427411079407, 0.046841442584991455, 0.2176101803779602, 0.07489924877882004, -0.33503833413124084, -0.5973696708679199, 0.1775009036064148, -0.39603501558303833, -0.31985780596733093, 0.00008691288530826569, -0.18865996599197388, -0.01948099583387375, 0.016143664717674255, -0.3058076500892639, 0.008185405284166336, 0.03966214135289192, -0.15271946787834167, 0.20669923722743988, -0.26855093240737915, 0.30836814641952515, 0.13878419995307922, 0.31336039304733276, -0.024807389825582504, -0.5145955681800842, 0.1728026568889618, -0.32119134068489075, -0.26796093583106995, -0.2976846694946289, 0.0451979897916317, -0.04867972433567047, -0.06579863280057907, 0.06245363503694534, -0.01174909621477127, 0.06895623356103897, -0.21828407049179077, -0.5289503335952759, 0.06508693844079971, 0.4377317428588867, -0.24873395264148712, -0.2926092743873596, -0.08783304691314697, 0.18822737038135529, -0.1982450634241104, 0.1114220917224884, -0.05694727599620819, -0.028569307178258896, -0.20515617728233337, 0.47027429938316345, -0.008331552147865295, -0.06510059535503387, 0.10035557299852371, -0.08762864768505096, -0.13539981842041016, -0.26578375697135925, 0.2614688277244568, -0.18512636423110962, -0.0813298299908638, -0.006783332675695419, 0.1770993024110794, -0.12574127316474915, -0.21388870477676392, -0.0014723099302500486, -0.19311942160129547, 0.15996265411376953, 0.10493443161249161, 0.10162194073200226, -0.38541361689567566, 0.16739000380039215, -0.14441901445388794, 0.12290980666875839, 0.15579813718795776, -0.13151775300502777, 0.24531833827495575, 0.3583945333957672, 0.0497845821082592, -0.1508380025625229, 0.06266392767429352, -0.2888258099555969, 0.13267739117145538, -0.13684488832950592, 0.028960857540369034, 0.5966954231262207, -0.06318944692611694, -0.07718705385923386, -0.23699066042900085, 0.034805528819561005, 0.08962491899728775, -0.2939595878124237, -0.09889460355043411, -0.095717653632164, 0.14844365417957306, 0.2564672529697418, 0.25051042437553406, -0.2991844713687897, 0.16814732551574707, -0.16613726317882538, -0.1551562398672104, 0.2148294895887375, -0.15407979488372803, -0.0015520751476287842, -0.13639019429683685, -0.06632272899150848, 0.1340801864862442, -0.05279286950826645, -0.04757288843393326, 0.19828826189041138, 0.03192918002605438, 0.19632722437381744, -0.08445073664188385, -0.0380481518805027, -0.12950091063976288, 0.14746291935443878, 0.4907427430152893, 0.4978342056274414, 0.16020001471042633, 0.48263809084892273, 0.05074812471866608, -0.006967395544052124, -0.031455717980861664, 0.3045927882194519, -0.18167023360729218, 0.07295498251914978, -0.1403781622648239, 0.24084258079528809, 0.14597088098526, -0.13993513584136963, -0.39699792861938477, 0.32737553119659424, 0.0717296302318573, 0.08471491932868958, 0.413070946931839, 0.4237092435359955, 0.3693908452987671, -0.32734185457229614, 0.1416682004928589, 0.5556643605232239, -0.13581909239292145, 0.25049394369125366, 0.09396053850650787, 0.02135303243994713, -0.12737998366355896, -0.06377972662448883, 0.3969275951385498, 0.07529481500387192, 0.11825740337371826, -0.3022298216819763, 0.04103807359933853, 0.12467218935489655, 0.2947946786880493, 0.21879449486732483, -0.21689778566360474, 0.04442662000656128, 0.1705736368894577, 0.2771476209163666, -0.005239896476268768, -0.24798965454101562, 0.18879786133766174, 0.06939022988080978, -0.2588328719139099, -0.3630220890045166, 0.09154176712036133, 0.022502247244119644, 0.11707928776741028, -0.08104616403579712, -0.22838228940963745, -0.2460128217935562, 0.045707207173109055, -0.08271224796772003, 0.02054961770772934, 0.2684592008590698, -0.1779596358537674, 0.4254225492477417, -0.28040680289268494, -0.06472393125295639, 0.35670965909957886, 0.3083812892436981, -0.06981053203344345, 0.26206934452056885, -0.016857631504535675, -0.28256675601005554, -0.22351586818695068, 0.2226877063512802, 0.03546672314405441, -0.004844006150960922, -0.009388905018568039, -0.04631666839122772, -0.2028457373380661, -0.047113172709941864, 0.23361706733703613, 0.02377810887992382, 0.17541417479515076, 0.04881606251001358, 0.24184919893741608, 0.16157099604606628, -0.013139504007995129, 0.12683247029781342, -0.36931169033050537, 0.06914396584033966, -0.40123963356018066, 0.12340040504932404, 0.04833778738975525, -0.23074555397033691, 0.09401765465736389, -0.06055916100740433, -0.3754596412181854, -0.198078915476799, -0.14760546386241913, 0.015334457159042358, -0.1414221227169037, 0.037523530423641205, 0.05789431929588318, 0.4060854911804199, 0.39943739771842957, 0.2027936726808548, -0.24719494581222534, -0.18157346546649933, -0.4706133008003235, -0.13642603158950806, 0.06994014978408813, -0.030034195631742477, -0.1294506937265396, 0.2900453209877014, -0.004341042600572109, 0.303862065076828, 0.48356449604034424, -0.39511603116989136, 0.4247645437717438, -0.1473141610622406, -0.12387670576572418, -0.18654565513134003, 0.3645307123661041, 0.17455638945102692, -0.054386042058467865, 0.05432262271642685, 0.21303659677505493, 0.1817660927772522, 0.21095378696918488, -0.08878643810749054, 0.07629597187042236, 0.25445884466171265, -0.42713454365730286, -0.4522484838962555, 0.2806614339351654, 0.10867811739444733, -0.05836594104766846, -0.16445651650428772, -0.10700947791337967, -0.17347128689289093, -0.10627584159374237, -0.08707579225301743, 0.2680869400501251, -0.12298284471035004, 0.15377065539360046, -0.2598581612110138, -0.4113064706325531, -0.29437151551246643, 0.022861821576952934, 0.1197117269039154, 0.21239307522773743, -0.010592089965939522, -0.022655609995126724, 0.028676897287368774, -0.03106432594358921, 0.10347286611795425, 0.10917818546295166, -0.0417647585272789, 0.0073949359357357025, 0.12874524295330048, -0.1182059720158577, 0.31093698740005493, 0.03342888876795769, -0.3047406077384949, 0.3547596037387848, -0.12666623294353485, 0.5580028891563416, 0.009683569893240929, -0.6038994193077087, -0.04266403242945671, 0.00843556597828865, 0.2004576027393341, 0.20174972712993622, 0.5439770221710205, -0.04378654062747955, -0.2384396642446518, -0.16343694925308228, -0.021325871348381042, 0.15384921431541443, 0.025625506415963173, -0.008032746613025665, -0.2034534066915512 ]
https://github.com/huggingface/datasets/issues/6438
Support GeoParquet
I've created https://github.com/huggingface/datasets-server/issues/2416 to discuss the possibility of supporting (vectorial) geospatial columns in the dataset viewer, or in the converted parquet files. At the same time, it would be super interesting to see what is already possible to do with a Hugging Face dataset that hosts geospatial data. > Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest. It would be awesome to show this inside a [Space](https://huggingface.co/docs/hub/spaces).
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
88
Support GeoParquet ### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/) I've created https://github.com/huggingface/datasets-server/issues/2416 to discuss the possibility of supporting (vectorial) geospatial columns in the dataset viewer, or in the converted parquet files. At the same time, it would be super interesting to see what is already possible to do with a Hugging Face dataset that hosts geospatial data. > Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest. It would be awesome to show this inside a [Space](https://huggingface.co/docs/hub/spaces).
[ -0.05656285211443901, -0.28124871850013733, -0.01919877529144287, 0.11515984684228897, 0.22579270601272583, -0.13627426326274872, 0.016782213002443314, 0.23339977860450745, 0.10431063175201416, 0.0815291479229927, -0.06813223659992218, 0.22475256025791168, -0.28454557061195374, 0.7236691117286682, 0.3302188813686371, -0.6510847806930542, 0.20073038339614868, 0.25332701206207275, 0.24923354387283325, 0.307600736618042, 0.03637920320034027, 0.2153048813343048, -0.046809352934360504, 0.18188846111297607, -0.2481968253850937, -0.08536671847105026, -0.24162644147872925, 0.2853220999240875, -0.5557066798210144, -0.4268321990966797, 0.16981686651706696, -0.03851340338587761, 0.4064338505268097, 0.0070924535393714905, -0.00011334240844007581, 0.009250812232494354, 0.09824557602405548, 0.1467338651418686, -0.22122351825237274, -0.26516348123550415, 0.005000036209821701, -0.35541778802871704, 0.17282257974147797, -0.0584128201007843, -0.47509047389030457, -0.18204352259635925, -0.19069769978523254, -0.16927631199359894, 0.2943510413169861, -0.12154801189899445, 0.10767096281051636, 0.21300600469112396, 0.01913781836628914, -0.014387249946594238, -0.07258903235197067, 0.3359506130218506, -0.49803030490875244, -0.054542478173971176, 0.6606711149215698, 0.1359601467847824, -0.022048890590667725, 0.11158846318721771, -0.005457913503050804, -0.09757812321186066, 0.23749646544456482, 0.13024725019931793, -0.06890464574098587, 0.023155756294727325, -0.213568776845932, 0.21085524559020996, 0.4059189558029175, -0.2765137553215027, -0.2602604031562805, -0.3039175271987915, 0.18272601068019867, -0.16452448070049286, -0.12706583738327026, 0.36247000098228455, 0.16117535531520844, 0.3245019018650055, -0.07016132026910782, -0.4598269760608673, -0.24356406927108765, -0.030417688190937042, -0.026999350637197495, 0.41161099076271057, -0.27551090717315674, -0.057382307946681976, 0.06161090359091759, -0.148731529712677, -0.09657854586839676, -0.04587068408727646, 0.13439054787158966, 0.07587218284606934, -0.20603032410144806, -0.2317727655172348, -0.16299602389335632, 0.4436427354812622, 0.37306880950927734, 0.23450899124145508, 0.11860246956348419, 0.06915336847305298, 0.1366671621799469, 0.1882534921169281, 0.4210968315601349, -0.1842470020055771, -0.06107401102781296, 0.3024561107158661, -0.047085121273994446, 0.2797360122203827, 0.4641425609588623, -0.08747831732034683, -0.011010657995939255, 0.22583387792110443, -0.5780336260795593, -0.36190223693847656, 0.2795069217681885, -0.11690764874219894, 0.09737998992204666, 0.1349567323923111, 0.3151518702507019, 0.2108093947172165, 0.28987017273902893, -0.1212882474064827, 0.090284064412117, 0.13150149583816528, -0.23065227270126343, 0.20984160900115967, 0.22964783012866974, -0.41650959849357605, -0.22961580753326416, 0.06037404388189316, -0.17192094027996063, 0.16145791113376617, 0.08703669905662537, -0.1857764720916748, -0.09092801064252853, 0.17041650414466858, 0.39883673191070557, -0.050959572196006775, -0.14104904234409332, 0.13261568546295166, -0.19784197211265564, 0.056887224316596985, -0.3297021687030792, -0.21411043405532837, 0.30450645089149475, -0.15744033455848694, -0.2342240810394287, 0.09430906176567078, -0.34746402502059937, -0.300272673368454, -0.3771805465221405, 0.01800941675901413, -0.24243977665901184, 0.03716827183961868, -0.3740744888782501, 0.32238882780075073, -0.5997298359870911, -0.21390563249588013, 0.019494466483592987, 0.22109675407409668, -0.07603902369737625, -0.12913797795772552, 0.5307889580726624, 0.31649184226989746, -0.19270893931388855, -0.2148548811674118, 0.18809391558170319, 0.06136317551136017, 0.17009314894676208, 0.19186997413635254, -0.0641791895031929, -0.3114221692085266, -0.08109686523675919, 0.1578514277935028, 0.25295132398605347, -0.3028392195701599, 0.26641160249710083, 0.18242409825325012, -0.11530320346355438, 0.2185063660144806, -0.04529256373643875, -0.21990695595741272, 0.014932204969227314, 0.018651042133569717, -0.10546441376209259, 0.3784065246582031, -0.16236883401870728, 0.1647409051656723, -0.3154783248901367, -0.40937644243240356, 0.17887860536575317, 0.5463126301765442, -0.13315635919570923, -0.0020709186792373657, 0.0582001730799675, -0.00886745285242796, -0.014140985906124115, -0.3177853524684906, -0.023531446233391762, -0.10565292835235596, 0.30267927050590515, 0.2738547921180725, -0.18619351089000702, -0.23622983694076538, -0.6169922947883606, 0.23482203483581543, 0.16637562215328217, -0.011991366744041443, 0.16628336906433105, -0.10774566233158112, -0.24998387694358826, 0.06577034294605255, 0.06550834327936172, -0.0355520062148571, 0.10568760335445404, -0.12305150926113129, 0.24686765670776367, 0.14499935507774353, -0.389163613319397, 0.37628576159477234, -0.25350654125213623, 0.1740301102399826, -0.40361472964286804, 0.46029865741729736, 0.0753021165728569, 0.03234674409031868, 0.1427125185728073, 0.3370130658149719, 0.1767670214176178, -0.06285714358091354, 0.2627750337123871, 0.4531915485858917, 0.012292515486478806, 0.3866879940032959, 0.19753775000572205, 0.4493865966796875, 0.1993311047554016, 0.02607526257634163, 0.16963329911231995, -0.5200203657150269, -0.04198504611849785, 0.01320582628250122, -0.27214187383651733, 0.3665926456451416, -0.14575879275798798, 0.03955580294132233, -0.14518293738365173, 0.12013141065835953, -0.01858421415090561, 0.1233752965927124, -0.47457432746887207, -0.13848844170570374, -0.16776278614997864, -0.12260298430919647, 0.15551188588142395, -0.27491500973701477, -0.4978346526622772, -0.20813429355621338, 0.1285473108291626, 0.039776500314474106, 0.17321094870567322, 0.08282966911792755, -0.13100725412368774, 0.049218691885471344, 0.22040539979934692, 0.01791466400027275, 0.08914249390363693, 0.219448059797287, -0.0919276624917984, 0.1362490952014923, 0.08752559870481491, -0.08574872463941574, 0.11874446272850037, 0.07978824526071548, -0.1366245448589325, -0.05834624916315079, 0.08784669637680054, 0.05217790976166725, -0.2117428481578827, 0.006122671067714691, -0.1670815646648407, 0.031042184680700302, -0.03833050653338432, -0.21688422560691833, -0.10958182066679001, 0.06986269354820251, 0.03699437901377678, 0.03642808645963669, -0.03242756798863411, 0.013915734365582466, 0.06982620060443878, -0.17348754405975342, -0.01305990107357502, 0.026169251650571823, -0.24993962049484253, 0.8455474972724915, -0.43364715576171875, -0.3505555987358093, -0.40664979815483093, -0.11957883834838867, 0.03769911453127861, 0.11239606142044067, 0.10835596174001694, 0.08475395292043686, 0.20102110505104065, 0.14821279048919678, 0.3435137867927551, -0.2759080231189728, -0.3245178163051605, 0.20810545980930328, -0.21979941427707672, 0.21152472496032715, 0.3357643485069275, 0.07958877086639404, -0.26352742314338684, 0.0823354572057724, 0.444468230009079, -0.15133725106716156, 0.08077368140220642, -0.1104210764169693, 0.016938727349042892, -0.024084554985165596, -0.13315755128860474, 0.17710185050964355, -0.3852623403072357, -0.3625246584415436, 0.43496376276016235, 0.15738263726234436, -0.05837441235780716, -0.37409549951553345, -0.016786977648735046, 0.04833974316716194, -0.23500941693782806, -0.13874372839927673, -0.138158917427063, -0.515363872051239, 0.2089860886335373, -0.1799192577600479, -0.04038321599364281, -0.09009425342082977, 0.286746621131897, 0.10440023243427277, -0.10491836071014404, -0.1736496090888977, -0.36228132247924805, -0.1223403811454773, -0.02283528819680214, -0.014682263135910034, -0.06843986362218857, 0.319759726524353, 0.06550971418619156, 0.059661559760570526, 0.04356890916824341, -0.24000674486160278, -0.16265717148780823, 0.6802367568016052, -0.390045702457428, 0.22838816046714783, -0.20748889446258545, 0.2286103069782257, 0.16209983825683594, 0.17324714362621307, 0.07752591371536255, 0.3104249835014343, 0.10909499228000641, 0.38469406962394714, -0.17595812678337097, -0.16727879643440247, 0.19981560111045837, -0.08998601138591766, 0.12730319797992706, 0.4394581913948059, 0.30318301916122437, -0.04579516500234604, -0.3195083439350128, -0.05195994675159454, -0.12213808298110962, 0.04480014368891716, 0.01629060134291649, 0.40132778882980347, 0.41129863262176514, -0.22415147721767426, -0.3914201557636261, -0.10735173523426056, -0.13044396042823792, 0.052437763661146164, 0.17553651332855225, 0.408976286649704, 0.20466378331184387, -0.21043236553668976, 0.2115086168050766, -0.18899717926979065, 0.17282578349113464, 0.047702912241220474, -0.08140788227319717, -0.30057090520858765, -0.02155947871506214, 0.1586466133594513, -0.08397521823644638, 0.21679344773292542, -0.3285907208919525, -0.13135835528373718, -0.19524098932743073, -0.1883884072303772, -0.28467515110969543, 0.08939996361732483, -0.05249207466840744, -0.42622047662734985, -0.03271408751606941, 0.8967304229736328, -0.24611616134643555, -0.3472598195075989, 0.1257885992527008, -0.09962575137615204, 0.16054336726665497, 0.12241769582033157, -0.07257720828056335, 0.13543802499771118, -0.183206245303154, 0.19203604757785797, 0.2282465547323227, 0.2127169668674469, 0.34628793597221375, -0.08030719310045242, -0.12440837919712067, 0.01950904354453087, -0.11404512822628021, 0.0822158008813858, 0.21922355890274048, -0.11835815012454987, -0.1446339339017868, 0.526889443397522, 0.13413354754447937, -0.2571925222873688, 0.364551842212677, -0.07657776772975922, -0.13374558091163635, 0.23348742723464966, 0.18734592199325562, 0.44097644090652466, 0.3210795223712921, 0.2131626009941101, -0.0770629420876503, -0.18696020543575287, 0.1575196087360382, -0.6100406050682068, -0.3137870132923126, 0.141046404838562, -0.1797599345445633, -0.1999577432870865, -0.11908753216266632, 0.4639763832092285, 0.11043347418308258, -0.02521061897277832, -0.006925862282514572, 0.930614709854126, -0.07712271809577942, 0.1714380830526352, 0.18081824481487274, 1.0005855560302734, -0.17960764467716217, 0.0657230094075203, 0.20257407426834106, -0.46029168367385864, 0.6512060165405273, -0.45615750551223755, 0.019522901624441147, -0.17294703423976898, -0.20265664160251617, -0.20653444528579712, -0.021929416805505753, 0.5960865616798401, 0.020695116370916367, -0.30106255412101746, 0.036465346813201904, 0.17786477506160736, 0.38587915897369385, -0.006663169711828232, 0.2790968716144562, 0.0958811342716217, -0.29028332233428955, -0.538841724395752, 0.14836350083351135, -0.33973485231399536, -0.336911678314209, 0.04529867693781853, -0.19197474420070648, -0.028078483417630196, -0.0066969506442546844, -0.3235436677932739, 0.03920987993478775, -0.009004060178995132, -0.18028980493545532, 0.2125873863697052, -0.3095959424972534, 0.3842872977256775, 0.20342424511909485, 0.2886925935745239, -0.0708889365196228, -0.4704270660877228, 0.17416974902153015, -0.34199607372283936, -0.24338901042938232, -0.32942676544189453, 0.0541888028383255, -0.03721274435520172, 0.010413933545351028, 0.04691227525472641, -0.08219955116510391, 0.021865572780370712, -0.23161561787128448, -0.5434525012969971, 0.1219141036272049, 0.320862352848053, -0.2614438831806183, -0.3055618107318878, -0.10729475319385529, 0.2511439919471741, -0.12852656841278076, 0.09249468147754669, -0.007057458162307739, -0.033384039998054504, -0.19610899686813354, 0.44281813502311707, -0.04175340384244919, -0.06507937610149384, 0.0707935318350792, -0.190324068069458, -0.06284792721271515, -0.1545049101114273, 0.22338108718395233, -0.15918050706386566, -0.07288231700658798, 0.03235887736082077, 0.2917473018169403, -0.17942006886005402, -0.14724883437156677, 0.10090966522693634, -0.08896252512931824, 0.18744590878486633, 0.12610405683517456, 0.1234317198395729, -0.3796088397502899, 0.16204507648944855, -0.19185876846313477, 0.17228515446186066, 0.13996225595474243, -0.22006182372570038, 0.19529078900814056, 0.36884602904319763, 0.04509352892637253, -0.14930477738380432, -0.002161230891942978, -0.283797025680542, 0.18138740956783295, -0.03674167022109032, 0.07382553815841675, 0.7452424764633179, -0.17459049820899963, 0.027572691440582275, -0.21445216238498688, 0.0534491166472435, 0.1224869042634964, -0.20177605748176575, -0.08730335533618927, -0.05870053544640541, 0.15337836742401123, 0.2542511522769928, 0.25578051805496216, -0.2908293306827545, 0.1570570468902588, -0.15771673619747162, -0.21243825554847717, 0.28210538625717163, -0.16007578372955322, -0.003516249358654022, -0.09165696799755096, -0.16261737048625946, 0.1616876721382141, -0.09227453172206879, -0.01282322034239769, 0.1317412257194519, -0.07099461555480957, 0.1727955937385559, -0.07581416517496109, -0.021608520299196243, -0.16930407285690308, 0.11785770952701569, 0.47883227467536926, 0.5333367586135864, 0.2580001950263977, 0.47109082341194153, 0.06131461262702942, -0.07800913602113724, -0.028103865683078766, 0.32957005500793457, -0.19443657994270325, 0.02507564052939415, -0.17310546338558197, 0.27159878611564636, 0.14524918794631958, -0.10370487719774246, -0.38301020860671997, 0.38332268595695496, 0.20528586208820343, 0.12901024520397186, 0.41164687275886536, 0.5021731853485107, 0.33680835366249084, -0.36054569482803345, 0.129683256149292, 0.6984040141105652, -0.14886890351772308, 0.18518340587615967, 0.12747107446193695, 0.026191744953393936, -0.21563084423542023, -0.11552178114652634, 0.3670649826526642, 0.11897151917219162, 0.13104212284088135, -0.29615411162376404, 0.03567273169755936, 0.18343326449394226, 0.2734093964099884, 0.260009765625, -0.33173149824142456, 0.02968427538871765, 0.2718198001384735, 0.23329581320285797, 0.06891237199306488, -0.24200937151908875, 0.27805817127227783, 0.10404452681541443, -0.2163141518831253, -0.308954656124115, 0.11558932065963745, -0.0013486221432685852, 0.09669193625450134, -0.01708660088479519, -0.20586666464805603, -0.3454354405403137, 0.041624974459409714, -0.06842043995857239, 0.10993370413780212, 0.2251979112625122, -0.19711242616176605, 0.39831799268722534, -0.23775850236415863, -0.04768326133489609, 0.3537880778312683, 0.2685486078262329, -0.08022398501634598, 0.27693232893943787, -0.006578221917152405, -0.32615581154823303, -0.08089657127857208, 0.1748695820569992, 0.05901000648736954, -0.06730921566486359, 0.04300420731306076, 0.05153753608465195, -0.2389937788248062, -0.017406903207302094, 0.23864462971687317, 0.03623619303107262, 0.06537789851427078, -0.03546757623553276, 0.23198427259922028, 0.14308084547519684, 0.00637472327798605, 0.02996019460260868, -0.2973882257938385, 0.0992242693901062, -0.4804600477218628, 0.09570017457008362, 0.09250685572624207, -0.19084107875823975, 0.03651764988899231, -0.042028434574604034, -0.3343786299228668, -0.26919594407081604, -0.13546200096607208, 0.06309282779693604, -0.13351354002952576, 0.09848275035619736, 0.051913097500801086, 0.3705308139324188, 0.2480202168226242, 0.2134295403957367, -0.31083887815475464, -0.20475788414478302, -0.44749265909194946, -0.18720513582229614, -0.010523684322834015, 0.00234241783618927, -0.1556205153465271, 0.27571526169776917, -0.055960483849048615, 0.3707956075668335, 0.38701093196868896, -0.4108145833015442, 0.3739098608493805, -0.26419445872306824, -0.14324556291103363, -0.125379741191864, 0.3597303628921509, 0.184000164270401, -0.08435124158859253, 0.06318704038858414, 0.28913530707359314, 0.15486390888690948, 0.2486601173877716, -0.1094309464097023, 0.018223896622657776, 0.22410047054290771, -0.46952953934669495, -0.5027493238449097, 0.20670320093631744, 0.13967232406139374, -0.07649651169776917, -0.14571678638458252, -0.05450737476348877, -0.18213973939418793, -0.06768763065338135, -0.10330112278461456, 0.2678004801273346, -0.14469309151172638, 0.31192687153816223, -0.3334069848060608, -0.3985639214515686, -0.3441619575023651, -0.02387193590402603, 0.12536440789699554, 0.20122167468070984, -0.016382979229092598, 0.04485822468996048, -0.0034992583096027374, -0.1019161120057106, 0.08202262967824936, 0.11572727560997009, 0.044230666011571884, -0.022887790575623512, 0.15109674632549286, -0.1816960573196411, 0.31480538845062256, -0.021133050322532654, -0.23637640476226807, 0.2893006503582001, -0.0586153119802475, 0.5238489508628845, 0.00750682782381773, -0.5033684968948364, -0.02786993235349655, 0.04367636889219284, 0.2318631112575531, 0.182245135307312, 0.3854256570339203, 0.11894850432872772, -0.22716370224952698, -0.19160617887973785, -0.11493177711963654, 0.1750504970550537, 0.09006620198488235, -0.03342953696846962, -0.21400251984596252 ]
https://github.com/huggingface/datasets/issues/6437
Problem in training iterable dataset
`split_dataset_by_node` doesn't give the exact same number of examples to each node in the case of iterable datasets, though it tries to be as equal as possible. In particular if your dataset is sharded and you have a number of shards that is a factor of the number of workers, then the shards will be evenly distributed among workers. If the shards don't contain the same number of examples, then some workers might end up with more examples than others. However if you use a Dataset you'll end up with the same amount of data, because we know the length of the dataset we can split it exactly where we want. Also Dataset objects don't load the full dataset in memory; instead it memory maps Arrow files from disk.
### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ```
129
Problem in training iterable dataset ### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ``` `split_dataset_by_node` doesn't give the exact same number of examples to each node in the case of iterable datasets, though it tries to be as equal as possible. In particular if your dataset is sharded and you have a number of shards that is a factor of the number of workers, then the shards will be evenly distributed among workers. If the shards don't contain the same number of examples, then some workers might end up with more examples than others. However if you use a Dataset you'll end up with the same amount of data, because we know the length of the dataset we can split it exactly where we want. Also Dataset objects don't load the full dataset in memory; instead it memory maps Arrow files from disk.
[ -0.35856759548187256, -0.43623173236846924, -0.06505601108074188, 0.2447272539138794, 0.1507219523191452, 0.00030840933322906494, 0.2204957902431488, 0.10808390378952026, -0.03405938297510147, 0.030955813825130463, 0.07104900479316711, 0.40755894780158997, -0.10079245269298553, -0.14866584539413452, 0.016370918601751328, -0.1617535948753357, -0.07227485626935959, 0.09274662286043167, -0.10523059964179993, -0.16402311623096466, -0.023536620661616325, -0.040096938610076904, -0.05710002779960632, -0.2574191093444824, -0.27044999599456787, -0.322613924741745, -0.15708066523075104, 0.13287977874279022, 0.15150883793830872, -0.3982130289077759, 0.22465451061725616, 0.21711674332618713, 0.07113514840602875, 0.6111322045326233, -0.00011611040099523962, 0.1270407736301422, 0.11343926191329956, 0.05389530956745148, -0.2836294174194336, 0.09008470922708511, 0.0699123665690422, -0.16767992079257965, 0.1288554072380066, -0.25542256236076355, -0.017265209928154945, -0.25423866510391235, 0.0887683629989624, -0.22222749888896942, 0.19286620616912842, -0.06117810681462288, 0.18085996806621552, 0.3152318596839905, -0.38789796829223633, -0.13680003583431244, -0.0948413535952568, -0.023857034742832184, -0.05047376826405525, 0.5289285182952881, 0.4512913227081299, -0.09903708845376968, -0.3489397168159485, 0.13595692813396454, -0.05334828048944473, 0.48587271571159363, 0.11524230986833572, -0.17097163200378418, 0.16171970963478088, -0.12134867906570435, -0.22600862383842468, 0.07008585333824158, 0.209254652261734, -0.17847523093223572, -0.13133041560649872, -0.647540807723999, 0.05670463666319847, -0.19455043971538544, -0.04642031341791153, 0.20723749697208405, -0.20647524297237396, -0.10571934282779694, -0.34051162004470825, 0.1179606020450592, -0.11424799263477325, 0.06665744632482529, -0.03450223058462143, 0.43341511487960815, 0.12204326689243317, 0.10901777446269989, 0.17341770231723785, 0.3337450623512268, 0.27899324893951416, -0.026215527206659317, 0.23314596712589264, -0.12107996642589569, -0.35010719299316406, 0.0048371367156505585, -0.028902210295200348, -0.2701371908187866, 0.208410382270813, -0.030516959726810455, 0.20906029641628265, -0.11848633736371994, 0.395309180021286, -0.16644850373268127, 0.5638724565505981, 0.07488258183002472, -0.4063733220100403, 0.5258415937423706, 0.06969798356294632, -0.005018646363168955, -0.2698235809803009, 0.040707480162382126, 0.06067270785570145, -0.0887560248374939, 0.35089078545570374, -0.039708808064460754, 0.0894986167550087, 0.24719855189323425, -0.35851654410362244, -0.20880499482154846, -0.03892766684293747, -0.06285414099693298, 0.16916777193546295, 0.2972574532032013, -0.09283385425806046, 0.26357024908065796, -0.19406679272651672, 0.21887153387069702, -0.4177860915660858, 0.11258232593536377, -0.27934789657592773, -0.13284242153167725, -0.30788931250572205, 0.07514964789152145, -0.06503023207187653, 0.1454615443944931, 0.147626593708992, 0.1199553981423378, 0.1839950829744339, -0.0251849964261055, 0.28525522351264954, -0.3693799376487732, 0.3085674047470093, 0.015029530972242355, -0.29605022072792053, 0.15146100521087646, -0.06459318101406097, 0.424646258354187, -0.1955931931734085, 0.1916886270046234, -0.3020869195461273, -0.39741799235343933, 0.19607199728488922, 0.15077270567417145, 0.08966077119112015, 0.08991019427776337, -0.0026810988783836365, 0.18239285051822662, 0.3279919922351837, -0.3139348328113556, 0.14439180493354797, -0.36140745878219604, -0.37425512075424194, -0.0870751142501831, 0.21682196855545044, 0.4756351113319397, 0.1611105054616928, -0.20727519690990448, -0.03740045800805092, -0.003157157450914383, 0.44769322872161865, 0.27928903698921204, -0.19872094690799713, 0.3126477897167206, -0.29739391803741455, -0.294039249420166, 0.023935429751873016, -0.1715429127216339, -0.5276458263397217, 0.5280032157897949, -0.394378125667572, 0.3448140621185303, 0.10092026740312576, 0.17946095764636993, 0.394318550825119, -0.056042641401290894, 0.10319455713033676, 0.22442299127578735, -0.4505127966403961, 0.26622775197029114, -0.3217192590236664, -0.025330182164907455, 0.20731696486473083, 0.25477829575538635, 0.1255008429288864, 0.1885431855916977, -0.0570584312081337, 0.11734677106142044, 0.6822019815444946, 0.07497955113649368, 0.08174433559179306, 0.1965331733226776, -0.1867588460445404, -0.06413932144641876, 0.19466909766197205, -0.32779577374458313, -0.21012023091316223, 0.3620021641254425, 0.12041151523590088, -0.1950116604566574, -0.03866845369338989, -0.033519305288791656, -0.05064013600349426, -0.0443219356238842, -0.34934601187705994, -0.11438103020191193, 0.03683304041624069, 0.13337284326553345, 0.16905876994132996, -0.04859664663672447, -0.0415797159075737, 0.3022805154323578, -0.34041279554367065, -0.2858086824417114, -0.31470218300819397, 0.3260335326194763, 0.2794240415096283, -0.17171771824359894, 0.05373995006084442, 0.13760554790496826, 0.05021551996469498, -0.2001727670431137, -0.1356634795665741, 0.18756002187728882, 0.029026560485363007, 0.17810282111167908, -0.036474935710430145, 0.18096396327018738, 0.3300218880176544, -0.08104683458805084, -0.01402517594397068, 0.2520906627178192, -0.08684326708316803, -0.17566362023353577, 0.2104862928390503, 0.27291110157966614, -0.21152456104755402, 0.1099126935005188, 0.07591462135314941, -0.08814044296741486, 0.11127296090126038, -0.044437047094106674, -0.04005555808544159, 0.08165137469768524, 0.34083855152130127, -0.36809229850769043, 0.47540611028671265, 0.0031173210591077805, -0.40744468569755554, 0.14277997612953186, 0.12165451049804688, -0.007623190060257912, -0.07383493334054947, -0.2171000838279724, 0.021391555666923523, 0.1650446653366089, 0.1171233132481575, 0.2829395532608032, 0.5696573853492737, 0.07821119576692581, 0.2508566379547119, -0.11773491650819778, 0.026876844465732574, -0.15472590923309326, -0.06747149676084518, 0.14257755875587463, 0.6344330310821533, 0.36770540475845337, 0.15409405529499054, -0.0034479955211281776, -0.19571992754936218, -0.0354565754532814, 0.1856653243303299, -0.021744681522250175, -0.036059051752090454, 0.3940182030200958, -0.2547287046909332, -0.0025076568126678467, -0.4811199903488159, 0.15211905539035797, -0.034803759306669235, -0.015665940940380096, -0.08894400298595428, 0.5858088731765747, -0.013804273679852486, 0.1379178911447525, -0.05993746593594551, 0.2029966115951538, 0.03480371832847595, -0.2375185638666153, -0.21152178943157196, -0.21985039114952087, -0.11833921819925308, -0.00458337739109993, -0.054120857268571854, -0.11602835357189178, 0.4848763942718506, 0.11556576937437057, -0.5529154539108276, -0.06901158392429352, 0.18491113185882568, -0.028402157127857208, -0.08813409507274628, -0.1381765753030777, -0.05951635539531708, -0.05612853169441223, -0.056624822318553925, -0.12415782362222672, 0.22682251036167145, -0.6403189897537231, 0.0034461338073015213, 0.027131307870149612, -0.02161373198032379, -0.09213744103908539, 0.10621365904808044, -0.3307017385959625, -0.4303399920463562, -0.25505122542381287, 0.14046519994735718, -0.20558077096939087, 0.11887682974338531, 0.0840291976928711, -0.15682466328144073, -0.22552353143692017, 0.19612161815166473, -0.0752667784690857, -0.01987924985587597, -0.20871976017951965, 0.039935849606990814, -0.21590180695056915, -0.14391274750232697, -0.4435667395591736, -0.1847890466451645, -0.22608906030654907, 0.561245858669281, -0.42092955112457275, -0.08417020738124847, -0.07395793497562408, 0.05332144722342491, -0.2973601520061493, -0.21504175662994385, 0.2062540203332901, -0.17472931742668152, 0.0239137914031744, -0.07042408734560013, 0.004435531795024872, 0.08124353736639023, 0.086054727435112, 0.16298219561576843, -0.08782652765512466, 0.1188386008143425, 0.022607412189245224, 0.937781810760498, 0.23410558700561523, 0.06790156662464142, 0.1514916568994522, -0.14922210574150085, -0.12777778506278992, -0.1189708486199379, -0.4036746323108673, 0.3819473385810852, -0.10460495948791504, -0.44300252199172974, 0.23181407153606415, -0.25538355112075806, -0.41014695167541504, 0.11807240545749664, -0.09022818505764008, 0.25341227650642395, -0.20608371496200562, 0.13099755346775055, -0.3799059987068176, 0.41509824991226196, -0.03295225277543068, 0.11170872300863266, -0.07008801400661469, -0.2038087546825409, -0.09386155009269714, -0.3125103712081909, 0.06911540776491165, -0.08815379440784454, -0.1339694857597351, 0.08238527178764343, -0.437674343585968, -0.06768400967121124, 0.2755720317363739, 0.334157794713974, -0.07777463644742966, -0.06749275326728821, 0.3463958501815796, 0.08987440168857574, 0.8163260221481323, 0.35128897428512573, 0.10478284955024719, -0.0181876253336668, -0.41278213262557983, -0.16563595831394196, -0.177177295088768, -0.18599927425384521, 0.5800562500953674, 0.3224269449710846, -0.08606851100921631, -0.3620748817920685, -0.1528100073337555, 0.14074254035949707, 0.03346068412065506, -0.06654049456119537, -0.30308830738067627, -0.3126663565635681, -0.20933935046195984, 0.035709939897060394, 0.6531063914299011, 0.20982465147972107, 0.1536625772714615, -0.26525723934173584, -0.21560600399971008, -0.027150502428412437, 0.12514454126358032, -0.07827840745449066, 0.07042591273784637, 0.17366304993629456, 0.03832872956991196, 0.4827836751937866, 0.3801490366458893, 0.3556094765663147, 0.5275116562843323, 0.4789283871650696, -0.1418624371290207, -0.2557712197303772, 0.15426424145698547, 0.10544180870056152, 0.06543245911598206, 0.5280023217201233, 0.0026733470149338245, -0.06656982749700546, 0.02069801837205887, 0.19840407371520996, -0.32944267988204956, -0.19913533329963684, 0.40317633748054504, -0.1236598938703537, -0.49713146686553955, -0.47236302495002747, 0.08087948709726334, -0.061496373265981674, -0.02129290997982025, 0.4977680444717407, -0.6380181908607483, -0.11919863522052765, 0.2236892729997635, 0.04176592454314232, 0.7814138531684875, -0.0027183890342712402, 0.17712372541427612, 0.30557623505592346, 0.205935999751091, 0.05154256522655487, -0.0033279918134212494, 0.49479901790618896, -0.32356658577919006, -0.6020666360855103, 0.18950994312763214, -0.21921437978744507, -0.1308647096157074, 0.29044055938720703, 0.31410741806030273, 0.06486082077026367, -0.018583565950393677, -0.2583656311035156, -0.16455349326133728, 0.28180283308029175, 0.0013328474014997482, -0.12898418307304382, -0.11249049007892609, 0.07333505898714066, -0.14260143041610718, 0.12104560434818268, -0.07722864300012589, -0.13800431787967682, 0.12131364643573761, 0.10230612754821777, -0.06065993383526802, -0.04087056219577789, -0.35177454352378845, 0.25177669525146484, 0.07163120806217194, -0.5539745688438416, -0.12704315781593323, 0.24912308156490326, 0.030384019017219543, -0.3217948079109192, 0.049285560846328735, 0.3050149381160736, 0.011975027620792389, 0.13803249597549438, 0.02300921268761158, -0.1871677041053772, 0.26084649562835693, -0.026469990611076355, -0.1692158281803131, -0.26638975739479065, 0.026007160544395447, -0.4193498492240906, -0.004699423909187317, 0.32173067331314087, 0.3189461827278137, -0.03366243466734886, 0.06928689777851105, 0.11178862303495407, -0.038348399102687836, -0.3003869354724884, 0.09746216237545013, 0.13777580857276917, -0.26414617896080017, 0.42383795976638794, -0.31399089097976685, -0.3669891953468323, -0.11701804399490356, 0.19699455797672272, 0.195725679397583, 0.361106276512146, 0.42157843708992004, -0.1705794334411621, -0.11073028296232224, -0.13313201069831848, -0.019899968057870865, 0.08036397397518158, -0.26114413142204285, 0.4422668516635895, -0.26757481694221497, 0.18040455877780914, -0.034023087471723557, -0.00004579871892929077, 0.12601017951965332, 0.038724303245544434, -0.11532934010028839, -0.15336951613426208, -0.21953783929347992, -0.232264444231987, 0.03854100778698921, 0.1539985090494156, 0.1771584451198578, 0.14575065672397614, -0.11566709727048874, 0.38219431042671204, -0.2679535150527954, -0.28084367513656616, -0.1438080221414566, 0.11764821410179138, -0.03826342895627022, -0.1323326826095581, 0.25268641114234924, -0.0186309851706028, 0.023233065381646156, 0.17662227153778076, 0.07040061056613922, -0.16890737414360046, -0.05693669244647026, 0.08682841062545776, 0.019719082862138748, 0.06537801772356033, -0.08221472054719925, -0.40070176124572754, -0.05182327702641487, -0.27611443400382996, 0.30315837264060974, 0.2474299669265747, 0.06915979087352753, 0.08222320675849915, 0.48034417629241943, 0.022428087890148163, 0.05271445959806442, 0.3258547782897949, -0.05966261029243469, -0.13305597007274628, -0.0006743352860212326, 0.2450975924730301, 0.2531960904598236, -0.0253949873149395, -0.24105097353458405, -0.21229106187820435, 0.3027550280094147, -0.05550885945558548, 0.15609502792358398, -0.1349906325340271, 0.004979360848665237, 0.14673490822315216, 0.3964516818523407, 0.6535426378250122, -0.23908837139606476, -0.1862969845533371, 0.20424562692642212, 0.11737532168626785, 0.00736091285943985, -0.2018069475889206, 0.32255634665489197, -0.030483141541481018, 0.06860305368900299, 0.34255796670913696, 0.13495184481143951, -0.0795910507440567, -0.1602052003145218, 0.1310984194278717, 0.1608523726463318, -0.4705706834793091, 0.18557056784629822, 0.02895285375416279, 0.32695963978767395, -0.05362166836857796, 0.24710802733898163, 0.22618098556995392, 0.15478593111038208, 0.11101411283016205, 0.14044146239757538, 0.5335496068000793, 0.16173216700553894, -0.18759191036224365, -0.010595723986625671, -0.19667118787765503, -0.31546124815940857, -0.1281084418296814, -0.34544798731803894, 0.04249174892902374, -0.0196014866232872, 0.20075508952140808, -0.4355347156524658, -0.4690881073474884, -0.14124847948551178, 0.04633806645870209, -0.18898653984069824, 0.050315018743276596, -0.07157886773347855, 0.05427902191877365, 0.037009067833423615, -0.014717180281877518, 0.04169607162475586, -0.009185552597045898, 0.5697567462921143, 0.18338902294635773, -0.0660780817270279, -0.47352704405784607, 0.04413796216249466, 0.18499192595481873, 0.35598617792129517, -0.29705479741096497, -0.01332816667854786, -0.15718810260295868, -0.022859543561935425, 0.0008493140339851379, 0.3153189420700073, 0.12053345143795013, 0.3091118633747101, -0.08811713755130768, -0.1585012823343277, 0.24865567684173584, 0.03374961018562317, -0.10015111416578293, 0.4475933313369751, -0.10532282292842865, 0.16231471300125122, 0.4003782868385315, 0.00804121419787407, -0.1537727415561676, 0.04379318654537201, 0.43729647994041443, -0.18768589198589325, -0.27451640367507935, 0.6409144401550293, -0.06180405616760254, -0.17174303531646729, 0.09710494428873062, 0.037641704082489014, -0.2671402096748352, 0.05889490619301796, 0.23776046931743622, -0.4326748847961426, 0.21527689695358276, -0.043284524232149124, 0.034605540335178375, -0.2130313217639923, 0.5432325005531311, 0.018898513168096542, 0.233570396900177, -0.28823181986808777, 0.018414326012134552, -0.4456024467945099, 0.31017255783081055, -0.3749842643737793, -0.05684675648808479, 0.045918893069028854, 0.27224797010421753, -0.09743843227624893, -0.057304687798023224, -0.16247893869876862, -0.3162626028060913, -0.03408204764127731, 0.6070189476013184, -0.21963395178318024, -0.1292687952518463, -0.5112317800521851, 0.2617301344871521, 0.24064141511917114, -0.3800877630710602, 0.16256877779960632, -0.09966952353715897, -0.03765975683927536, 0.34467852115631104, -0.04806585609912872, 0.13904671370983124, -0.020807713270187378, -0.02829139679670334, 0.11951892077922821, 0.3678627610206604, -0.09867764264345169, -0.005602112039923668, -0.28074535727500916, -0.2106759399175644, -0.3988848030567169, 0.20681306719779968, 0.07291370630264282, 0.20714803040027618, -0.18904633820056915, -0.04129211977124214, -0.2826367914676666, 0.1772051751613617, 0.03879636526107788, 0.03842060640454292, -0.047160498797893524, 0.11059525609016418, 0.011520080268383026, 0.48660868406295776, 0.22763656079769135, 0.5645205974578857, -0.012442134320735931, 0.0072302259504795074, -0.23530316352844238, -0.2648499608039856, 0.2814093828201294, -0.4936082363128662, -0.3519534170627594, -0.10182717442512512, 0.3315039277076721, 0.11954984068870544, 0.011434879153966904, -0.14833775162696838, -0.04707566648721695, 0.2855328917503357, -0.24427467584609985, 0.04708502069115639, 0.1651185303926468, 0.08525864779949188, -0.035461850464344025, -0.022813688963651657, 0.3612755239009857, 0.03424851596355438, -0.46516841650009155, 0.44341129064559937, -0.2114042490720749 ]
https://github.com/huggingface/datasets/issues/6437
Problem in training iterable dataset
> `split_dataset_by_node` doesn't give the exact same number of examples to each node in the case of iterable datasets, though it tries to be as equal as possible. In particular if your dataset is sharded and you have a number of shards that is a factor of the number of workers, then the shards will be evenly distributed among workers. If the shards don't contain the same number of examples, then some workers might end up with more examples than others. > > However if you use a Dataset you'll end up with the same amount of data, because we know the length of the dataset we can split it exactly where we want. Also Dataset objects don't load the full dataset in memory; instead it memory maps Arrow files from disk. Thanks for your answer! I finally solve it by using the torch.distributed.algorithms.join.Join. I think maybe some rookie like me would face the same question the day after tomorrow hh.
### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ```
161
Problem in training iterable dataset ### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ``` > `split_dataset_by_node` doesn't give the exact same number of examples to each node in the case of iterable datasets, though it tries to be as equal as possible. In particular if your dataset is sharded and you have a number of shards that is a factor of the number of workers, then the shards will be evenly distributed among workers. If the shards don't contain the same number of examples, then some workers might end up with more examples than others. > > However if you use a Dataset you'll end up with the same amount of data, because we know the length of the dataset we can split it exactly where we want. Also Dataset objects don't load the full dataset in memory; instead it memory maps Arrow files from disk. Thanks for your answer! I finally solve it by using the torch.distributed.algorithms.join.Join. I think maybe some rookie like me would face the same question the day after tomorrow hh.
[ -0.35856759548187256, -0.43623173236846924, -0.06505601108074188, 0.2447272539138794, 0.1507219523191452, 0.00030840933322906494, 0.2204957902431488, 0.10808390378952026, -0.03405938297510147, 0.030955813825130463, 0.07104900479316711, 0.40755894780158997, -0.10079245269298553, -0.14866584539413452, 0.016370918601751328, -0.1617535948753357, -0.07227485626935959, 0.09274662286043167, -0.10523059964179993, -0.16402311623096466, -0.023536620661616325, -0.040096938610076904, -0.05710002779960632, -0.2574191093444824, -0.27044999599456787, -0.322613924741745, -0.15708066523075104, 0.13287977874279022, 0.15150883793830872, -0.3982130289077759, 0.22465451061725616, 0.21711674332618713, 0.07113514840602875, 0.6111322045326233, -0.00011611040099523962, 0.1270407736301422, 0.11343926191329956, 0.05389530956745148, -0.2836294174194336, 0.09008470922708511, 0.0699123665690422, -0.16767992079257965, 0.1288554072380066, -0.25542256236076355, -0.017265209928154945, -0.25423866510391235, 0.0887683629989624, -0.22222749888896942, 0.19286620616912842, -0.06117810681462288, 0.18085996806621552, 0.3152318596839905, -0.38789796829223633, -0.13680003583431244, -0.0948413535952568, -0.023857034742832184, -0.05047376826405525, 0.5289285182952881, 0.4512913227081299, -0.09903708845376968, -0.3489397168159485, 0.13595692813396454, -0.05334828048944473, 0.48587271571159363, 0.11524230986833572, -0.17097163200378418, 0.16171970963478088, -0.12134867906570435, -0.22600862383842468, 0.07008585333824158, 0.209254652261734, -0.17847523093223572, -0.13133041560649872, -0.647540807723999, 0.05670463666319847, -0.19455043971538544, -0.04642031341791153, 0.20723749697208405, -0.20647524297237396, -0.10571934282779694, -0.34051162004470825, 0.1179606020450592, -0.11424799263477325, 0.06665744632482529, -0.03450223058462143, 0.43341511487960815, 0.12204326689243317, 0.10901777446269989, 0.17341770231723785, 0.3337450623512268, 0.27899324893951416, -0.026215527206659317, 0.23314596712589264, -0.12107996642589569, -0.35010719299316406, 0.0048371367156505585, -0.028902210295200348, -0.2701371908187866, 0.208410382270813, -0.030516959726810455, 0.20906029641628265, -0.11848633736371994, 0.395309180021286, -0.16644850373268127, 0.5638724565505981, 0.07488258183002472, -0.4063733220100403, 0.5258415937423706, 0.06969798356294632, -0.005018646363168955, -0.2698235809803009, 0.040707480162382126, 0.06067270785570145, -0.0887560248374939, 0.35089078545570374, -0.039708808064460754, 0.0894986167550087, 0.24719855189323425, -0.35851654410362244, -0.20880499482154846, -0.03892766684293747, -0.06285414099693298, 0.16916777193546295, 0.2972574532032013, -0.09283385425806046, 0.26357024908065796, -0.19406679272651672, 0.21887153387069702, -0.4177860915660858, 0.11258232593536377, -0.27934789657592773, -0.13284242153167725, -0.30788931250572205, 0.07514964789152145, -0.06503023207187653, 0.1454615443944931, 0.147626593708992, 0.1199553981423378, 0.1839950829744339, -0.0251849964261055, 0.28525522351264954, -0.3693799376487732, 0.3085674047470093, 0.015029530972242355, -0.29605022072792053, 0.15146100521087646, -0.06459318101406097, 0.424646258354187, -0.1955931931734085, 0.1916886270046234, -0.3020869195461273, -0.39741799235343933, 0.19607199728488922, 0.15077270567417145, 0.08966077119112015, 0.08991019427776337, -0.0026810988783836365, 0.18239285051822662, 0.3279919922351837, -0.3139348328113556, 0.14439180493354797, -0.36140745878219604, -0.37425512075424194, -0.0870751142501831, 0.21682196855545044, 0.4756351113319397, 0.1611105054616928, -0.20727519690990448, -0.03740045800805092, -0.003157157450914383, 0.44769322872161865, 0.27928903698921204, -0.19872094690799713, 0.3126477897167206, -0.29739391803741455, -0.294039249420166, 0.023935429751873016, -0.1715429127216339, -0.5276458263397217, 0.5280032157897949, -0.394378125667572, 0.3448140621185303, 0.10092026740312576, 0.17946095764636993, 0.394318550825119, -0.056042641401290894, 0.10319455713033676, 0.22442299127578735, -0.4505127966403961, 0.26622775197029114, -0.3217192590236664, -0.025330182164907455, 0.20731696486473083, 0.25477829575538635, 0.1255008429288864, 0.1885431855916977, -0.0570584312081337, 0.11734677106142044, 0.6822019815444946, 0.07497955113649368, 0.08174433559179306, 0.1965331733226776, -0.1867588460445404, -0.06413932144641876, 0.19466909766197205, -0.32779577374458313, -0.21012023091316223, 0.3620021641254425, 0.12041151523590088, -0.1950116604566574, -0.03866845369338989, -0.033519305288791656, -0.05064013600349426, -0.0443219356238842, -0.34934601187705994, -0.11438103020191193, 0.03683304041624069, 0.13337284326553345, 0.16905876994132996, -0.04859664663672447, -0.0415797159075737, 0.3022805154323578, -0.34041279554367065, -0.2858086824417114, -0.31470218300819397, 0.3260335326194763, 0.2794240415096283, -0.17171771824359894, 0.05373995006084442, 0.13760554790496826, 0.05021551996469498, -0.2001727670431137, -0.1356634795665741, 0.18756002187728882, 0.029026560485363007, 0.17810282111167908, -0.036474935710430145, 0.18096396327018738, 0.3300218880176544, -0.08104683458805084, -0.01402517594397068, 0.2520906627178192, -0.08684326708316803, -0.17566362023353577, 0.2104862928390503, 0.27291110157966614, -0.21152456104755402, 0.1099126935005188, 0.07591462135314941, -0.08814044296741486, 0.11127296090126038, -0.044437047094106674, -0.04005555808544159, 0.08165137469768524, 0.34083855152130127, -0.36809229850769043, 0.47540611028671265, 0.0031173210591077805, -0.40744468569755554, 0.14277997612953186, 0.12165451049804688, -0.007623190060257912, -0.07383493334054947, -0.2171000838279724, 0.021391555666923523, 0.1650446653366089, 0.1171233132481575, 0.2829395532608032, 0.5696573853492737, 0.07821119576692581, 0.2508566379547119, -0.11773491650819778, 0.026876844465732574, -0.15472590923309326, -0.06747149676084518, 0.14257755875587463, 0.6344330310821533, 0.36770540475845337, 0.15409405529499054, -0.0034479955211281776, -0.19571992754936218, -0.0354565754532814, 0.1856653243303299, -0.021744681522250175, -0.036059051752090454, 0.3940182030200958, -0.2547287046909332, -0.0025076568126678467, -0.4811199903488159, 0.15211905539035797, -0.034803759306669235, -0.015665940940380096, -0.08894400298595428, 0.5858088731765747, -0.013804273679852486, 0.1379178911447525, -0.05993746593594551, 0.2029966115951538, 0.03480371832847595, -0.2375185638666153, -0.21152178943157196, -0.21985039114952087, -0.11833921819925308, -0.00458337739109993, -0.054120857268571854, -0.11602835357189178, 0.4848763942718506, 0.11556576937437057, -0.5529154539108276, -0.06901158392429352, 0.18491113185882568, -0.028402157127857208, -0.08813409507274628, -0.1381765753030777, -0.05951635539531708, -0.05612853169441223, -0.056624822318553925, -0.12415782362222672, 0.22682251036167145, -0.6403189897537231, 0.0034461338073015213, 0.027131307870149612, -0.02161373198032379, -0.09213744103908539, 0.10621365904808044, -0.3307017385959625, -0.4303399920463562, -0.25505122542381287, 0.14046519994735718, -0.20558077096939087, 0.11887682974338531, 0.0840291976928711, -0.15682466328144073, -0.22552353143692017, 0.19612161815166473, -0.0752667784690857, -0.01987924985587597, -0.20871976017951965, 0.039935849606990814, -0.21590180695056915, -0.14391274750232697, -0.4435667395591736, -0.1847890466451645, -0.22608906030654907, 0.561245858669281, -0.42092955112457275, -0.08417020738124847, -0.07395793497562408, 0.05332144722342491, -0.2973601520061493, -0.21504175662994385, 0.2062540203332901, -0.17472931742668152, 0.0239137914031744, -0.07042408734560013, 0.004435531795024872, 0.08124353736639023, 0.086054727435112, 0.16298219561576843, -0.08782652765512466, 0.1188386008143425, 0.022607412189245224, 0.937781810760498, 0.23410558700561523, 0.06790156662464142, 0.1514916568994522, -0.14922210574150085, -0.12777778506278992, -0.1189708486199379, -0.4036746323108673, 0.3819473385810852, -0.10460495948791504, -0.44300252199172974, 0.23181407153606415, -0.25538355112075806, -0.41014695167541504, 0.11807240545749664, -0.09022818505764008, 0.25341227650642395, -0.20608371496200562, 0.13099755346775055, -0.3799059987068176, 0.41509824991226196, -0.03295225277543068, 0.11170872300863266, -0.07008801400661469, -0.2038087546825409, -0.09386155009269714, -0.3125103712081909, 0.06911540776491165, -0.08815379440784454, -0.1339694857597351, 0.08238527178764343, -0.437674343585968, -0.06768400967121124, 0.2755720317363739, 0.334157794713974, -0.07777463644742966, -0.06749275326728821, 0.3463958501815796, 0.08987440168857574, 0.8163260221481323, 0.35128897428512573, 0.10478284955024719, -0.0181876253336668, -0.41278213262557983, -0.16563595831394196, -0.177177295088768, -0.18599927425384521, 0.5800562500953674, 0.3224269449710846, -0.08606851100921631, -0.3620748817920685, -0.1528100073337555, 0.14074254035949707, 0.03346068412065506, -0.06654049456119537, -0.30308830738067627, -0.3126663565635681, -0.20933935046195984, 0.035709939897060394, 0.6531063914299011, 0.20982465147972107, 0.1536625772714615, -0.26525723934173584, -0.21560600399971008, -0.027150502428412437, 0.12514454126358032, -0.07827840745449066, 0.07042591273784637, 0.17366304993629456, 0.03832872956991196, 0.4827836751937866, 0.3801490366458893, 0.3556094765663147, 0.5275116562843323, 0.4789283871650696, -0.1418624371290207, -0.2557712197303772, 0.15426424145698547, 0.10544180870056152, 0.06543245911598206, 0.5280023217201233, 0.0026733470149338245, -0.06656982749700546, 0.02069801837205887, 0.19840407371520996, -0.32944267988204956, -0.19913533329963684, 0.40317633748054504, -0.1236598938703537, -0.49713146686553955, -0.47236302495002747, 0.08087948709726334, -0.061496373265981674, -0.02129290997982025, 0.4977680444717407, -0.6380181908607483, -0.11919863522052765, 0.2236892729997635, 0.04176592454314232, 0.7814138531684875, -0.0027183890342712402, 0.17712372541427612, 0.30557623505592346, 0.205935999751091, 0.05154256522655487, -0.0033279918134212494, 0.49479901790618896, -0.32356658577919006, -0.6020666360855103, 0.18950994312763214, -0.21921437978744507, -0.1308647096157074, 0.29044055938720703, 0.31410741806030273, 0.06486082077026367, -0.018583565950393677, -0.2583656311035156, -0.16455349326133728, 0.28180283308029175, 0.0013328474014997482, -0.12898418307304382, -0.11249049007892609, 0.07333505898714066, -0.14260143041610718, 0.12104560434818268, -0.07722864300012589, -0.13800431787967682, 0.12131364643573761, 0.10230612754821777, -0.06065993383526802, -0.04087056219577789, -0.35177454352378845, 0.25177669525146484, 0.07163120806217194, -0.5539745688438416, -0.12704315781593323, 0.24912308156490326, 0.030384019017219543, -0.3217948079109192, 0.049285560846328735, 0.3050149381160736, 0.011975027620792389, 0.13803249597549438, 0.02300921268761158, -0.1871677041053772, 0.26084649562835693, -0.026469990611076355, -0.1692158281803131, -0.26638975739479065, 0.026007160544395447, -0.4193498492240906, -0.004699423909187317, 0.32173067331314087, 0.3189461827278137, -0.03366243466734886, 0.06928689777851105, 0.11178862303495407, -0.038348399102687836, -0.3003869354724884, 0.09746216237545013, 0.13777580857276917, -0.26414617896080017, 0.42383795976638794, -0.31399089097976685, -0.3669891953468323, -0.11701804399490356, 0.19699455797672272, 0.195725679397583, 0.361106276512146, 0.42157843708992004, -0.1705794334411621, -0.11073028296232224, -0.13313201069831848, -0.019899968057870865, 0.08036397397518158, -0.26114413142204285, 0.4422668516635895, -0.26757481694221497, 0.18040455877780914, -0.034023087471723557, -0.00004579871892929077, 0.12601017951965332, 0.038724303245544434, -0.11532934010028839, -0.15336951613426208, -0.21953783929347992, -0.232264444231987, 0.03854100778698921, 0.1539985090494156, 0.1771584451198578, 0.14575065672397614, -0.11566709727048874, 0.38219431042671204, -0.2679535150527954, -0.28084367513656616, -0.1438080221414566, 0.11764821410179138, -0.03826342895627022, -0.1323326826095581, 0.25268641114234924, -0.0186309851706028, 0.023233065381646156, 0.17662227153778076, 0.07040061056613922, -0.16890737414360046, -0.05693669244647026, 0.08682841062545776, 0.019719082862138748, 0.06537801772356033, -0.08221472054719925, -0.40070176124572754, -0.05182327702641487, -0.27611443400382996, 0.30315837264060974, 0.2474299669265747, 0.06915979087352753, 0.08222320675849915, 0.48034417629241943, 0.022428087890148163, 0.05271445959806442, 0.3258547782897949, -0.05966261029243469, -0.13305597007274628, -0.0006743352860212326, 0.2450975924730301, 0.2531960904598236, -0.0253949873149395, -0.24105097353458405, -0.21229106187820435, 0.3027550280094147, -0.05550885945558548, 0.15609502792358398, -0.1349906325340271, 0.004979360848665237, 0.14673490822315216, 0.3964516818523407, 0.6535426378250122, -0.23908837139606476, -0.1862969845533371, 0.20424562692642212, 0.11737532168626785, 0.00736091285943985, -0.2018069475889206, 0.32255634665489197, -0.030483141541481018, 0.06860305368900299, 0.34255796670913696, 0.13495184481143951, -0.0795910507440567, -0.1602052003145218, 0.1310984194278717, 0.1608523726463318, -0.4705706834793091, 0.18557056784629822, 0.02895285375416279, 0.32695963978767395, -0.05362166836857796, 0.24710802733898163, 0.22618098556995392, 0.15478593111038208, 0.11101411283016205, 0.14044146239757538, 0.5335496068000793, 0.16173216700553894, -0.18759191036224365, -0.010595723986625671, -0.19667118787765503, -0.31546124815940857, -0.1281084418296814, -0.34544798731803894, 0.04249174892902374, -0.0196014866232872, 0.20075508952140808, -0.4355347156524658, -0.4690881073474884, -0.14124847948551178, 0.04633806645870209, -0.18898653984069824, 0.050315018743276596, -0.07157886773347855, 0.05427902191877365, 0.037009067833423615, -0.014717180281877518, 0.04169607162475586, -0.009185552597045898, 0.5697567462921143, 0.18338902294635773, -0.0660780817270279, -0.47352704405784607, 0.04413796216249466, 0.18499192595481873, 0.35598617792129517, -0.29705479741096497, -0.01332816667854786, -0.15718810260295868, -0.022859543561935425, 0.0008493140339851379, 0.3153189420700073, 0.12053345143795013, 0.3091118633747101, -0.08811713755130768, -0.1585012823343277, 0.24865567684173584, 0.03374961018562317, -0.10015111416578293, 0.4475933313369751, -0.10532282292842865, 0.16231471300125122, 0.4003782868385315, 0.00804121419787407, -0.1537727415561676, 0.04379318654537201, 0.43729647994041443, -0.18768589198589325, -0.27451640367507935, 0.6409144401550293, -0.06180405616760254, -0.17174303531646729, 0.09710494428873062, 0.037641704082489014, -0.2671402096748352, 0.05889490619301796, 0.23776046931743622, -0.4326748847961426, 0.21527689695358276, -0.043284524232149124, 0.034605540335178375, -0.2130313217639923, 0.5432325005531311, 0.018898513168096542, 0.233570396900177, -0.28823181986808777, 0.018414326012134552, -0.4456024467945099, 0.31017255783081055, -0.3749842643737793, -0.05684675648808479, 0.045918893069028854, 0.27224797010421753, -0.09743843227624893, -0.057304687798023224, -0.16247893869876862, -0.3162626028060913, -0.03408204764127731, 0.6070189476013184, -0.21963395178318024, -0.1292687952518463, -0.5112317800521851, 0.2617301344871521, 0.24064141511917114, -0.3800877630710602, 0.16256877779960632, -0.09966952353715897, -0.03765975683927536, 0.34467852115631104, -0.04806585609912872, 0.13904671370983124, -0.020807713270187378, -0.02829139679670334, 0.11951892077922821, 0.3678627610206604, -0.09867764264345169, -0.005602112039923668, -0.28074535727500916, -0.2106759399175644, -0.3988848030567169, 0.20681306719779968, 0.07291370630264282, 0.20714803040027618, -0.18904633820056915, -0.04129211977124214, -0.2826367914676666, 0.1772051751613617, 0.03879636526107788, 0.03842060640454292, -0.047160498797893524, 0.11059525609016418, 0.011520080268383026, 0.48660868406295776, 0.22763656079769135, 0.5645205974578857, -0.012442134320735931, 0.0072302259504795074, -0.23530316352844238, -0.2648499608039856, 0.2814093828201294, -0.4936082363128662, -0.3519534170627594, -0.10182717442512512, 0.3315039277076721, 0.11954984068870544, 0.011434879153966904, -0.14833775162696838, -0.04707566648721695, 0.2855328917503357, -0.24427467584609985, 0.04708502069115639, 0.1651185303926468, 0.08525864779949188, -0.035461850464344025, -0.022813688963651657, 0.3612755239009857, 0.03424851596355438, -0.46516841650009155, 0.44341129064559937, -0.2114042490720749 ]
https://github.com/huggingface/datasets/issues/6437
Problem in training iterable dataset
Great ! Maybe it can be worth having an example that we can include in the docs for other people, did you need anything else than the Join context manager used with the model and optimizer ?
### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ```
37
Problem in training iterable dataset ### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ``` Great ! Maybe it can be worth having an example that we can include in the docs for other people, did you need anything else than the Join context manager used with the model and optimizer ?
[ -0.35856759548187256, -0.43623173236846924, -0.06505601108074188, 0.2447272539138794, 0.1507219523191452, 0.00030840933322906494, 0.2204957902431488, 0.10808390378952026, -0.03405938297510147, 0.030955813825130463, 0.07104900479316711, 0.40755894780158997, -0.10079245269298553, -0.14866584539413452, 0.016370918601751328, -0.1617535948753357, -0.07227485626935959, 0.09274662286043167, -0.10523059964179993, -0.16402311623096466, -0.023536620661616325, -0.040096938610076904, -0.05710002779960632, -0.2574191093444824, -0.27044999599456787, -0.322613924741745, -0.15708066523075104, 0.13287977874279022, 0.15150883793830872, -0.3982130289077759, 0.22465451061725616, 0.21711674332618713, 0.07113514840602875, 0.6111322045326233, -0.00011611040099523962, 0.1270407736301422, 0.11343926191329956, 0.05389530956745148, -0.2836294174194336, 0.09008470922708511, 0.0699123665690422, -0.16767992079257965, 0.1288554072380066, -0.25542256236076355, -0.017265209928154945, -0.25423866510391235, 0.0887683629989624, -0.22222749888896942, 0.19286620616912842, -0.06117810681462288, 0.18085996806621552, 0.3152318596839905, -0.38789796829223633, -0.13680003583431244, -0.0948413535952568, -0.023857034742832184, -0.05047376826405525, 0.5289285182952881, 0.4512913227081299, -0.09903708845376968, -0.3489397168159485, 0.13595692813396454, -0.05334828048944473, 0.48587271571159363, 0.11524230986833572, -0.17097163200378418, 0.16171970963478088, -0.12134867906570435, -0.22600862383842468, 0.07008585333824158, 0.209254652261734, -0.17847523093223572, -0.13133041560649872, -0.647540807723999, 0.05670463666319847, -0.19455043971538544, -0.04642031341791153, 0.20723749697208405, -0.20647524297237396, -0.10571934282779694, -0.34051162004470825, 0.1179606020450592, -0.11424799263477325, 0.06665744632482529, -0.03450223058462143, 0.43341511487960815, 0.12204326689243317, 0.10901777446269989, 0.17341770231723785, 0.3337450623512268, 0.27899324893951416, -0.026215527206659317, 0.23314596712589264, -0.12107996642589569, -0.35010719299316406, 0.0048371367156505585, -0.028902210295200348, -0.2701371908187866, 0.208410382270813, -0.030516959726810455, 0.20906029641628265, -0.11848633736371994, 0.395309180021286, -0.16644850373268127, 0.5638724565505981, 0.07488258183002472, -0.4063733220100403, 0.5258415937423706, 0.06969798356294632, -0.005018646363168955, -0.2698235809803009, 0.040707480162382126, 0.06067270785570145, -0.0887560248374939, 0.35089078545570374, -0.039708808064460754, 0.0894986167550087, 0.24719855189323425, -0.35851654410362244, -0.20880499482154846, -0.03892766684293747, -0.06285414099693298, 0.16916777193546295, 0.2972574532032013, -0.09283385425806046, 0.26357024908065796, -0.19406679272651672, 0.21887153387069702, -0.4177860915660858, 0.11258232593536377, -0.27934789657592773, -0.13284242153167725, -0.30788931250572205, 0.07514964789152145, -0.06503023207187653, 0.1454615443944931, 0.147626593708992, 0.1199553981423378, 0.1839950829744339, -0.0251849964261055, 0.28525522351264954, -0.3693799376487732, 0.3085674047470093, 0.015029530972242355, -0.29605022072792053, 0.15146100521087646, -0.06459318101406097, 0.424646258354187, -0.1955931931734085, 0.1916886270046234, -0.3020869195461273, -0.39741799235343933, 0.19607199728488922, 0.15077270567417145, 0.08966077119112015, 0.08991019427776337, -0.0026810988783836365, 0.18239285051822662, 0.3279919922351837, -0.3139348328113556, 0.14439180493354797, -0.36140745878219604, -0.37425512075424194, -0.0870751142501831, 0.21682196855545044, 0.4756351113319397, 0.1611105054616928, -0.20727519690990448, -0.03740045800805092, -0.003157157450914383, 0.44769322872161865, 0.27928903698921204, -0.19872094690799713, 0.3126477897167206, -0.29739391803741455, -0.294039249420166, 0.023935429751873016, -0.1715429127216339, -0.5276458263397217, 0.5280032157897949, -0.394378125667572, 0.3448140621185303, 0.10092026740312576, 0.17946095764636993, 0.394318550825119, -0.056042641401290894, 0.10319455713033676, 0.22442299127578735, -0.4505127966403961, 0.26622775197029114, -0.3217192590236664, -0.025330182164907455, 0.20731696486473083, 0.25477829575538635, 0.1255008429288864, 0.1885431855916977, -0.0570584312081337, 0.11734677106142044, 0.6822019815444946, 0.07497955113649368, 0.08174433559179306, 0.1965331733226776, -0.1867588460445404, -0.06413932144641876, 0.19466909766197205, -0.32779577374458313, -0.21012023091316223, 0.3620021641254425, 0.12041151523590088, -0.1950116604566574, -0.03866845369338989, -0.033519305288791656, -0.05064013600349426, -0.0443219356238842, -0.34934601187705994, -0.11438103020191193, 0.03683304041624069, 0.13337284326553345, 0.16905876994132996, -0.04859664663672447, -0.0415797159075737, 0.3022805154323578, -0.34041279554367065, -0.2858086824417114, -0.31470218300819397, 0.3260335326194763, 0.2794240415096283, -0.17171771824359894, 0.05373995006084442, 0.13760554790496826, 0.05021551996469498, -0.2001727670431137, -0.1356634795665741, 0.18756002187728882, 0.029026560485363007, 0.17810282111167908, -0.036474935710430145, 0.18096396327018738, 0.3300218880176544, -0.08104683458805084, -0.01402517594397068, 0.2520906627178192, -0.08684326708316803, -0.17566362023353577, 0.2104862928390503, 0.27291110157966614, -0.21152456104755402, 0.1099126935005188, 0.07591462135314941, -0.08814044296741486, 0.11127296090126038, -0.044437047094106674, -0.04005555808544159, 0.08165137469768524, 0.34083855152130127, -0.36809229850769043, 0.47540611028671265, 0.0031173210591077805, -0.40744468569755554, 0.14277997612953186, 0.12165451049804688, -0.007623190060257912, -0.07383493334054947, -0.2171000838279724, 0.021391555666923523, 0.1650446653366089, 0.1171233132481575, 0.2829395532608032, 0.5696573853492737, 0.07821119576692581, 0.2508566379547119, -0.11773491650819778, 0.026876844465732574, -0.15472590923309326, -0.06747149676084518, 0.14257755875587463, 0.6344330310821533, 0.36770540475845337, 0.15409405529499054, -0.0034479955211281776, -0.19571992754936218, -0.0354565754532814, 0.1856653243303299, -0.021744681522250175, -0.036059051752090454, 0.3940182030200958, -0.2547287046909332, -0.0025076568126678467, -0.4811199903488159, 0.15211905539035797, -0.034803759306669235, -0.015665940940380096, -0.08894400298595428, 0.5858088731765747, -0.013804273679852486, 0.1379178911447525, -0.05993746593594551, 0.2029966115951538, 0.03480371832847595, -0.2375185638666153, -0.21152178943157196, -0.21985039114952087, -0.11833921819925308, -0.00458337739109993, -0.054120857268571854, -0.11602835357189178, 0.4848763942718506, 0.11556576937437057, -0.5529154539108276, -0.06901158392429352, 0.18491113185882568, -0.028402157127857208, -0.08813409507274628, -0.1381765753030777, -0.05951635539531708, -0.05612853169441223, -0.056624822318553925, -0.12415782362222672, 0.22682251036167145, -0.6403189897537231, 0.0034461338073015213, 0.027131307870149612, -0.02161373198032379, -0.09213744103908539, 0.10621365904808044, -0.3307017385959625, -0.4303399920463562, -0.25505122542381287, 0.14046519994735718, -0.20558077096939087, 0.11887682974338531, 0.0840291976928711, -0.15682466328144073, -0.22552353143692017, 0.19612161815166473, -0.0752667784690857, -0.01987924985587597, -0.20871976017951965, 0.039935849606990814, -0.21590180695056915, -0.14391274750232697, -0.4435667395591736, -0.1847890466451645, -0.22608906030654907, 0.561245858669281, -0.42092955112457275, -0.08417020738124847, -0.07395793497562408, 0.05332144722342491, -0.2973601520061493, -0.21504175662994385, 0.2062540203332901, -0.17472931742668152, 0.0239137914031744, -0.07042408734560013, 0.004435531795024872, 0.08124353736639023, 0.086054727435112, 0.16298219561576843, -0.08782652765512466, 0.1188386008143425, 0.022607412189245224, 0.937781810760498, 0.23410558700561523, 0.06790156662464142, 0.1514916568994522, -0.14922210574150085, -0.12777778506278992, -0.1189708486199379, -0.4036746323108673, 0.3819473385810852, -0.10460495948791504, -0.44300252199172974, 0.23181407153606415, -0.25538355112075806, -0.41014695167541504, 0.11807240545749664, -0.09022818505764008, 0.25341227650642395, -0.20608371496200562, 0.13099755346775055, -0.3799059987068176, 0.41509824991226196, -0.03295225277543068, 0.11170872300863266, -0.07008801400661469, -0.2038087546825409, -0.09386155009269714, -0.3125103712081909, 0.06911540776491165, -0.08815379440784454, -0.1339694857597351, 0.08238527178764343, -0.437674343585968, -0.06768400967121124, 0.2755720317363739, 0.334157794713974, -0.07777463644742966, -0.06749275326728821, 0.3463958501815796, 0.08987440168857574, 0.8163260221481323, 0.35128897428512573, 0.10478284955024719, -0.0181876253336668, -0.41278213262557983, -0.16563595831394196, -0.177177295088768, -0.18599927425384521, 0.5800562500953674, 0.3224269449710846, -0.08606851100921631, -0.3620748817920685, -0.1528100073337555, 0.14074254035949707, 0.03346068412065506, -0.06654049456119537, -0.30308830738067627, -0.3126663565635681, -0.20933935046195984, 0.035709939897060394, 0.6531063914299011, 0.20982465147972107, 0.1536625772714615, -0.26525723934173584, -0.21560600399971008, -0.027150502428412437, 0.12514454126358032, -0.07827840745449066, 0.07042591273784637, 0.17366304993629456, 0.03832872956991196, 0.4827836751937866, 0.3801490366458893, 0.3556094765663147, 0.5275116562843323, 0.4789283871650696, -0.1418624371290207, -0.2557712197303772, 0.15426424145698547, 0.10544180870056152, 0.06543245911598206, 0.5280023217201233, 0.0026733470149338245, -0.06656982749700546, 0.02069801837205887, 0.19840407371520996, -0.32944267988204956, -0.19913533329963684, 0.40317633748054504, -0.1236598938703537, -0.49713146686553955, -0.47236302495002747, 0.08087948709726334, -0.061496373265981674, -0.02129290997982025, 0.4977680444717407, -0.6380181908607483, -0.11919863522052765, 0.2236892729997635, 0.04176592454314232, 0.7814138531684875, -0.0027183890342712402, 0.17712372541427612, 0.30557623505592346, 0.205935999751091, 0.05154256522655487, -0.0033279918134212494, 0.49479901790618896, -0.32356658577919006, -0.6020666360855103, 0.18950994312763214, -0.21921437978744507, -0.1308647096157074, 0.29044055938720703, 0.31410741806030273, 0.06486082077026367, -0.018583565950393677, -0.2583656311035156, -0.16455349326133728, 0.28180283308029175, 0.0013328474014997482, -0.12898418307304382, -0.11249049007892609, 0.07333505898714066, -0.14260143041610718, 0.12104560434818268, -0.07722864300012589, -0.13800431787967682, 0.12131364643573761, 0.10230612754821777, -0.06065993383526802, -0.04087056219577789, -0.35177454352378845, 0.25177669525146484, 0.07163120806217194, -0.5539745688438416, -0.12704315781593323, 0.24912308156490326, 0.030384019017219543, -0.3217948079109192, 0.049285560846328735, 0.3050149381160736, 0.011975027620792389, 0.13803249597549438, 0.02300921268761158, -0.1871677041053772, 0.26084649562835693, -0.026469990611076355, -0.1692158281803131, -0.26638975739479065, 0.026007160544395447, -0.4193498492240906, -0.004699423909187317, 0.32173067331314087, 0.3189461827278137, -0.03366243466734886, 0.06928689777851105, 0.11178862303495407, -0.038348399102687836, -0.3003869354724884, 0.09746216237545013, 0.13777580857276917, -0.26414617896080017, 0.42383795976638794, -0.31399089097976685, -0.3669891953468323, -0.11701804399490356, 0.19699455797672272, 0.195725679397583, 0.361106276512146, 0.42157843708992004, -0.1705794334411621, -0.11073028296232224, -0.13313201069831848, -0.019899968057870865, 0.08036397397518158, -0.26114413142204285, 0.4422668516635895, -0.26757481694221497, 0.18040455877780914, -0.034023087471723557, -0.00004579871892929077, 0.12601017951965332, 0.038724303245544434, -0.11532934010028839, -0.15336951613426208, -0.21953783929347992, -0.232264444231987, 0.03854100778698921, 0.1539985090494156, 0.1771584451198578, 0.14575065672397614, -0.11566709727048874, 0.38219431042671204, -0.2679535150527954, -0.28084367513656616, -0.1438080221414566, 0.11764821410179138, -0.03826342895627022, -0.1323326826095581, 0.25268641114234924, -0.0186309851706028, 0.023233065381646156, 0.17662227153778076, 0.07040061056613922, -0.16890737414360046, -0.05693669244647026, 0.08682841062545776, 0.019719082862138748, 0.06537801772356033, -0.08221472054719925, -0.40070176124572754, -0.05182327702641487, -0.27611443400382996, 0.30315837264060974, 0.2474299669265747, 0.06915979087352753, 0.08222320675849915, 0.48034417629241943, 0.022428087890148163, 0.05271445959806442, 0.3258547782897949, -0.05966261029243469, -0.13305597007274628, -0.0006743352860212326, 0.2450975924730301, 0.2531960904598236, -0.0253949873149395, -0.24105097353458405, -0.21229106187820435, 0.3027550280094147, -0.05550885945558548, 0.15609502792358398, -0.1349906325340271, 0.004979360848665237, 0.14673490822315216, 0.3964516818523407, 0.6535426378250122, -0.23908837139606476, -0.1862969845533371, 0.20424562692642212, 0.11737532168626785, 0.00736091285943985, -0.2018069475889206, 0.32255634665489197, -0.030483141541481018, 0.06860305368900299, 0.34255796670913696, 0.13495184481143951, -0.0795910507440567, -0.1602052003145218, 0.1310984194278717, 0.1608523726463318, -0.4705706834793091, 0.18557056784629822, 0.02895285375416279, 0.32695963978767395, -0.05362166836857796, 0.24710802733898163, 0.22618098556995392, 0.15478593111038208, 0.11101411283016205, 0.14044146239757538, 0.5335496068000793, 0.16173216700553894, -0.18759191036224365, -0.010595723986625671, -0.19667118787765503, -0.31546124815940857, -0.1281084418296814, -0.34544798731803894, 0.04249174892902374, -0.0196014866232872, 0.20075508952140808, -0.4355347156524658, -0.4690881073474884, -0.14124847948551178, 0.04633806645870209, -0.18898653984069824, 0.050315018743276596, -0.07157886773347855, 0.05427902191877365, 0.037009067833423615, -0.014717180281877518, 0.04169607162475586, -0.009185552597045898, 0.5697567462921143, 0.18338902294635773, -0.0660780817270279, -0.47352704405784607, 0.04413796216249466, 0.18499192595481873, 0.35598617792129517, -0.29705479741096497, -0.01332816667854786, -0.15718810260295868, -0.022859543561935425, 0.0008493140339851379, 0.3153189420700073, 0.12053345143795013, 0.3091118633747101, -0.08811713755130768, -0.1585012823343277, 0.24865567684173584, 0.03374961018562317, -0.10015111416578293, 0.4475933313369751, -0.10532282292842865, 0.16231471300125122, 0.4003782868385315, 0.00804121419787407, -0.1537727415561676, 0.04379318654537201, 0.43729647994041443, -0.18768589198589325, -0.27451640367507935, 0.6409144401550293, -0.06180405616760254, -0.17174303531646729, 0.09710494428873062, 0.037641704082489014, -0.2671402096748352, 0.05889490619301796, 0.23776046931743622, -0.4326748847961426, 0.21527689695358276, -0.043284524232149124, 0.034605540335178375, -0.2130313217639923, 0.5432325005531311, 0.018898513168096542, 0.233570396900177, -0.28823181986808777, 0.018414326012134552, -0.4456024467945099, 0.31017255783081055, -0.3749842643737793, -0.05684675648808479, 0.045918893069028854, 0.27224797010421753, -0.09743843227624893, -0.057304687798023224, -0.16247893869876862, -0.3162626028060913, -0.03408204764127731, 0.6070189476013184, -0.21963395178318024, -0.1292687952518463, -0.5112317800521851, 0.2617301344871521, 0.24064141511917114, -0.3800877630710602, 0.16256877779960632, -0.09966952353715897, -0.03765975683927536, 0.34467852115631104, -0.04806585609912872, 0.13904671370983124, -0.020807713270187378, -0.02829139679670334, 0.11951892077922821, 0.3678627610206604, -0.09867764264345169, -0.005602112039923668, -0.28074535727500916, -0.2106759399175644, -0.3988848030567169, 0.20681306719779968, 0.07291370630264282, 0.20714803040027618, -0.18904633820056915, -0.04129211977124214, -0.2826367914676666, 0.1772051751613617, 0.03879636526107788, 0.03842060640454292, -0.047160498797893524, 0.11059525609016418, 0.011520080268383026, 0.48660868406295776, 0.22763656079769135, 0.5645205974578857, -0.012442134320735931, 0.0072302259504795074, -0.23530316352844238, -0.2648499608039856, 0.2814093828201294, -0.4936082363128662, -0.3519534170627594, -0.10182717442512512, 0.3315039277076721, 0.11954984068870544, 0.011434879153966904, -0.14833775162696838, -0.04707566648721695, 0.2855328917503357, -0.24427467584609985, 0.04708502069115639, 0.1651185303926468, 0.08525864779949188, -0.035461850464344025, -0.022813688963651657, 0.3612755239009857, 0.03424851596355438, -0.46516841650009155, 0.44341129064559937, -0.2114042490720749 ]
https://github.com/huggingface/datasets/issues/6437
Problem in training iterable dataset
> Great ! Maybe it can be worth having an example that we can include in the docs for other people, did you need anything else than the Join context manager used with the model and optimizer ? I think it's none. I have tried barrier() to solve the problem but I failed. Maybe it's a tool for other situation.
### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ```
60
Problem in training iterable dataset ### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ``` > Great ! Maybe it can be worth having an example that we can include in the docs for other people, did you need anything else than the Join context manager used with the model and optimizer ? I think it's none. I have tried barrier() to solve the problem but I failed. Maybe it's a tool for other situation.
[ -0.35856759548187256, -0.43623173236846924, -0.06505601108074188, 0.2447272539138794, 0.1507219523191452, 0.00030840933322906494, 0.2204957902431488, 0.10808390378952026, -0.03405938297510147, 0.030955813825130463, 0.07104900479316711, 0.40755894780158997, -0.10079245269298553, -0.14866584539413452, 0.016370918601751328, -0.1617535948753357, -0.07227485626935959, 0.09274662286043167, -0.10523059964179993, -0.16402311623096466, -0.023536620661616325, -0.040096938610076904, -0.05710002779960632, -0.2574191093444824, -0.27044999599456787, -0.322613924741745, -0.15708066523075104, 0.13287977874279022, 0.15150883793830872, -0.3982130289077759, 0.22465451061725616, 0.21711674332618713, 0.07113514840602875, 0.6111322045326233, -0.00011611040099523962, 0.1270407736301422, 0.11343926191329956, 0.05389530956745148, -0.2836294174194336, 0.09008470922708511, 0.0699123665690422, -0.16767992079257965, 0.1288554072380066, -0.25542256236076355, -0.017265209928154945, -0.25423866510391235, 0.0887683629989624, -0.22222749888896942, 0.19286620616912842, -0.06117810681462288, 0.18085996806621552, 0.3152318596839905, -0.38789796829223633, -0.13680003583431244, -0.0948413535952568, -0.023857034742832184, -0.05047376826405525, 0.5289285182952881, 0.4512913227081299, -0.09903708845376968, -0.3489397168159485, 0.13595692813396454, -0.05334828048944473, 0.48587271571159363, 0.11524230986833572, -0.17097163200378418, 0.16171970963478088, -0.12134867906570435, -0.22600862383842468, 0.07008585333824158, 0.209254652261734, -0.17847523093223572, -0.13133041560649872, -0.647540807723999, 0.05670463666319847, -0.19455043971538544, -0.04642031341791153, 0.20723749697208405, -0.20647524297237396, -0.10571934282779694, -0.34051162004470825, 0.1179606020450592, -0.11424799263477325, 0.06665744632482529, -0.03450223058462143, 0.43341511487960815, 0.12204326689243317, 0.10901777446269989, 0.17341770231723785, 0.3337450623512268, 0.27899324893951416, -0.026215527206659317, 0.23314596712589264, -0.12107996642589569, -0.35010719299316406, 0.0048371367156505585, -0.028902210295200348, -0.2701371908187866, 0.208410382270813, -0.030516959726810455, 0.20906029641628265, -0.11848633736371994, 0.395309180021286, -0.16644850373268127, 0.5638724565505981, 0.07488258183002472, -0.4063733220100403, 0.5258415937423706, 0.06969798356294632, -0.005018646363168955, -0.2698235809803009, 0.040707480162382126, 0.06067270785570145, -0.0887560248374939, 0.35089078545570374, -0.039708808064460754, 0.0894986167550087, 0.24719855189323425, -0.35851654410362244, -0.20880499482154846, -0.03892766684293747, -0.06285414099693298, 0.16916777193546295, 0.2972574532032013, -0.09283385425806046, 0.26357024908065796, -0.19406679272651672, 0.21887153387069702, -0.4177860915660858, 0.11258232593536377, -0.27934789657592773, -0.13284242153167725, -0.30788931250572205, 0.07514964789152145, -0.06503023207187653, 0.1454615443944931, 0.147626593708992, 0.1199553981423378, 0.1839950829744339, -0.0251849964261055, 0.28525522351264954, -0.3693799376487732, 0.3085674047470093, 0.015029530972242355, -0.29605022072792053, 0.15146100521087646, -0.06459318101406097, 0.424646258354187, -0.1955931931734085, 0.1916886270046234, -0.3020869195461273, -0.39741799235343933, 0.19607199728488922, 0.15077270567417145, 0.08966077119112015, 0.08991019427776337, -0.0026810988783836365, 0.18239285051822662, 0.3279919922351837, -0.3139348328113556, 0.14439180493354797, -0.36140745878219604, -0.37425512075424194, -0.0870751142501831, 0.21682196855545044, 0.4756351113319397, 0.1611105054616928, -0.20727519690990448, -0.03740045800805092, -0.003157157450914383, 0.44769322872161865, 0.27928903698921204, -0.19872094690799713, 0.3126477897167206, -0.29739391803741455, -0.294039249420166, 0.023935429751873016, -0.1715429127216339, -0.5276458263397217, 0.5280032157897949, -0.394378125667572, 0.3448140621185303, 0.10092026740312576, 0.17946095764636993, 0.394318550825119, -0.056042641401290894, 0.10319455713033676, 0.22442299127578735, -0.4505127966403961, 0.26622775197029114, -0.3217192590236664, -0.025330182164907455, 0.20731696486473083, 0.25477829575538635, 0.1255008429288864, 0.1885431855916977, -0.0570584312081337, 0.11734677106142044, 0.6822019815444946, 0.07497955113649368, 0.08174433559179306, 0.1965331733226776, -0.1867588460445404, -0.06413932144641876, 0.19466909766197205, -0.32779577374458313, -0.21012023091316223, 0.3620021641254425, 0.12041151523590088, -0.1950116604566574, -0.03866845369338989, -0.033519305288791656, -0.05064013600349426, -0.0443219356238842, -0.34934601187705994, -0.11438103020191193, 0.03683304041624069, 0.13337284326553345, 0.16905876994132996, -0.04859664663672447, -0.0415797159075737, 0.3022805154323578, -0.34041279554367065, -0.2858086824417114, -0.31470218300819397, 0.3260335326194763, 0.2794240415096283, -0.17171771824359894, 0.05373995006084442, 0.13760554790496826, 0.05021551996469498, -0.2001727670431137, -0.1356634795665741, 0.18756002187728882, 0.029026560485363007, 0.17810282111167908, -0.036474935710430145, 0.18096396327018738, 0.3300218880176544, -0.08104683458805084, -0.01402517594397068, 0.2520906627178192, -0.08684326708316803, -0.17566362023353577, 0.2104862928390503, 0.27291110157966614, -0.21152456104755402, 0.1099126935005188, 0.07591462135314941, -0.08814044296741486, 0.11127296090126038, -0.044437047094106674, -0.04005555808544159, 0.08165137469768524, 0.34083855152130127, -0.36809229850769043, 0.47540611028671265, 0.0031173210591077805, -0.40744468569755554, 0.14277997612953186, 0.12165451049804688, -0.007623190060257912, -0.07383493334054947, -0.2171000838279724, 0.021391555666923523, 0.1650446653366089, 0.1171233132481575, 0.2829395532608032, 0.5696573853492737, 0.07821119576692581, 0.2508566379547119, -0.11773491650819778, 0.026876844465732574, -0.15472590923309326, -0.06747149676084518, 0.14257755875587463, 0.6344330310821533, 0.36770540475845337, 0.15409405529499054, -0.0034479955211281776, -0.19571992754936218, -0.0354565754532814, 0.1856653243303299, -0.021744681522250175, -0.036059051752090454, 0.3940182030200958, -0.2547287046909332, -0.0025076568126678467, -0.4811199903488159, 0.15211905539035797, -0.034803759306669235, -0.015665940940380096, -0.08894400298595428, 0.5858088731765747, -0.013804273679852486, 0.1379178911447525, -0.05993746593594551, 0.2029966115951538, 0.03480371832847595, -0.2375185638666153, -0.21152178943157196, -0.21985039114952087, -0.11833921819925308, -0.00458337739109993, -0.054120857268571854, -0.11602835357189178, 0.4848763942718506, 0.11556576937437057, -0.5529154539108276, -0.06901158392429352, 0.18491113185882568, -0.028402157127857208, -0.08813409507274628, -0.1381765753030777, -0.05951635539531708, -0.05612853169441223, -0.056624822318553925, -0.12415782362222672, 0.22682251036167145, -0.6403189897537231, 0.0034461338073015213, 0.027131307870149612, -0.02161373198032379, -0.09213744103908539, 0.10621365904808044, -0.3307017385959625, -0.4303399920463562, -0.25505122542381287, 0.14046519994735718, -0.20558077096939087, 0.11887682974338531, 0.0840291976928711, -0.15682466328144073, -0.22552353143692017, 0.19612161815166473, -0.0752667784690857, -0.01987924985587597, -0.20871976017951965, 0.039935849606990814, -0.21590180695056915, -0.14391274750232697, -0.4435667395591736, -0.1847890466451645, -0.22608906030654907, 0.561245858669281, -0.42092955112457275, -0.08417020738124847, -0.07395793497562408, 0.05332144722342491, -0.2973601520061493, -0.21504175662994385, 0.2062540203332901, -0.17472931742668152, 0.0239137914031744, -0.07042408734560013, 0.004435531795024872, 0.08124353736639023, 0.086054727435112, 0.16298219561576843, -0.08782652765512466, 0.1188386008143425, 0.022607412189245224, 0.937781810760498, 0.23410558700561523, 0.06790156662464142, 0.1514916568994522, -0.14922210574150085, -0.12777778506278992, -0.1189708486199379, -0.4036746323108673, 0.3819473385810852, -0.10460495948791504, -0.44300252199172974, 0.23181407153606415, -0.25538355112075806, -0.41014695167541504, 0.11807240545749664, -0.09022818505764008, 0.25341227650642395, -0.20608371496200562, 0.13099755346775055, -0.3799059987068176, 0.41509824991226196, -0.03295225277543068, 0.11170872300863266, -0.07008801400661469, -0.2038087546825409, -0.09386155009269714, -0.3125103712081909, 0.06911540776491165, -0.08815379440784454, -0.1339694857597351, 0.08238527178764343, -0.437674343585968, -0.06768400967121124, 0.2755720317363739, 0.334157794713974, -0.07777463644742966, -0.06749275326728821, 0.3463958501815796, 0.08987440168857574, 0.8163260221481323, 0.35128897428512573, 0.10478284955024719, -0.0181876253336668, -0.41278213262557983, -0.16563595831394196, -0.177177295088768, -0.18599927425384521, 0.5800562500953674, 0.3224269449710846, -0.08606851100921631, -0.3620748817920685, -0.1528100073337555, 0.14074254035949707, 0.03346068412065506, -0.06654049456119537, -0.30308830738067627, -0.3126663565635681, -0.20933935046195984, 0.035709939897060394, 0.6531063914299011, 0.20982465147972107, 0.1536625772714615, -0.26525723934173584, -0.21560600399971008, -0.027150502428412437, 0.12514454126358032, -0.07827840745449066, 0.07042591273784637, 0.17366304993629456, 0.03832872956991196, 0.4827836751937866, 0.3801490366458893, 0.3556094765663147, 0.5275116562843323, 0.4789283871650696, -0.1418624371290207, -0.2557712197303772, 0.15426424145698547, 0.10544180870056152, 0.06543245911598206, 0.5280023217201233, 0.0026733470149338245, -0.06656982749700546, 0.02069801837205887, 0.19840407371520996, -0.32944267988204956, -0.19913533329963684, 0.40317633748054504, -0.1236598938703537, -0.49713146686553955, -0.47236302495002747, 0.08087948709726334, -0.061496373265981674, -0.02129290997982025, 0.4977680444717407, -0.6380181908607483, -0.11919863522052765, 0.2236892729997635, 0.04176592454314232, 0.7814138531684875, -0.0027183890342712402, 0.17712372541427612, 0.30557623505592346, 0.205935999751091, 0.05154256522655487, -0.0033279918134212494, 0.49479901790618896, -0.32356658577919006, -0.6020666360855103, 0.18950994312763214, -0.21921437978744507, -0.1308647096157074, 0.29044055938720703, 0.31410741806030273, 0.06486082077026367, -0.018583565950393677, -0.2583656311035156, -0.16455349326133728, 0.28180283308029175, 0.0013328474014997482, -0.12898418307304382, -0.11249049007892609, 0.07333505898714066, -0.14260143041610718, 0.12104560434818268, -0.07722864300012589, -0.13800431787967682, 0.12131364643573761, 0.10230612754821777, -0.06065993383526802, -0.04087056219577789, -0.35177454352378845, 0.25177669525146484, 0.07163120806217194, -0.5539745688438416, -0.12704315781593323, 0.24912308156490326, 0.030384019017219543, -0.3217948079109192, 0.049285560846328735, 0.3050149381160736, 0.011975027620792389, 0.13803249597549438, 0.02300921268761158, -0.1871677041053772, 0.26084649562835693, -0.026469990611076355, -0.1692158281803131, -0.26638975739479065, 0.026007160544395447, -0.4193498492240906, -0.004699423909187317, 0.32173067331314087, 0.3189461827278137, -0.03366243466734886, 0.06928689777851105, 0.11178862303495407, -0.038348399102687836, -0.3003869354724884, 0.09746216237545013, 0.13777580857276917, -0.26414617896080017, 0.42383795976638794, -0.31399089097976685, -0.3669891953468323, -0.11701804399490356, 0.19699455797672272, 0.195725679397583, 0.361106276512146, 0.42157843708992004, -0.1705794334411621, -0.11073028296232224, -0.13313201069831848, -0.019899968057870865, 0.08036397397518158, -0.26114413142204285, 0.4422668516635895, -0.26757481694221497, 0.18040455877780914, -0.034023087471723557, -0.00004579871892929077, 0.12601017951965332, 0.038724303245544434, -0.11532934010028839, -0.15336951613426208, -0.21953783929347992, -0.232264444231987, 0.03854100778698921, 0.1539985090494156, 0.1771584451198578, 0.14575065672397614, -0.11566709727048874, 0.38219431042671204, -0.2679535150527954, -0.28084367513656616, -0.1438080221414566, 0.11764821410179138, -0.03826342895627022, -0.1323326826095581, 0.25268641114234924, -0.0186309851706028, 0.023233065381646156, 0.17662227153778076, 0.07040061056613922, -0.16890737414360046, -0.05693669244647026, 0.08682841062545776, 0.019719082862138748, 0.06537801772356033, -0.08221472054719925, -0.40070176124572754, -0.05182327702641487, -0.27611443400382996, 0.30315837264060974, 0.2474299669265747, 0.06915979087352753, 0.08222320675849915, 0.48034417629241943, 0.022428087890148163, 0.05271445959806442, 0.3258547782897949, -0.05966261029243469, -0.13305597007274628, -0.0006743352860212326, 0.2450975924730301, 0.2531960904598236, -0.0253949873149395, -0.24105097353458405, -0.21229106187820435, 0.3027550280094147, -0.05550885945558548, 0.15609502792358398, -0.1349906325340271, 0.004979360848665237, 0.14673490822315216, 0.3964516818523407, 0.6535426378250122, -0.23908837139606476, -0.1862969845533371, 0.20424562692642212, 0.11737532168626785, 0.00736091285943985, -0.2018069475889206, 0.32255634665489197, -0.030483141541481018, 0.06860305368900299, 0.34255796670913696, 0.13495184481143951, -0.0795910507440567, -0.1602052003145218, 0.1310984194278717, 0.1608523726463318, -0.4705706834793091, 0.18557056784629822, 0.02895285375416279, 0.32695963978767395, -0.05362166836857796, 0.24710802733898163, 0.22618098556995392, 0.15478593111038208, 0.11101411283016205, 0.14044146239757538, 0.5335496068000793, 0.16173216700553894, -0.18759191036224365, -0.010595723986625671, -0.19667118787765503, -0.31546124815940857, -0.1281084418296814, -0.34544798731803894, 0.04249174892902374, -0.0196014866232872, 0.20075508952140808, -0.4355347156524658, -0.4690881073474884, -0.14124847948551178, 0.04633806645870209, -0.18898653984069824, 0.050315018743276596, -0.07157886773347855, 0.05427902191877365, 0.037009067833423615, -0.014717180281877518, 0.04169607162475586, -0.009185552597045898, 0.5697567462921143, 0.18338902294635773, -0.0660780817270279, -0.47352704405784607, 0.04413796216249466, 0.18499192595481873, 0.35598617792129517, -0.29705479741096497, -0.01332816667854786, -0.15718810260295868, -0.022859543561935425, 0.0008493140339851379, 0.3153189420700073, 0.12053345143795013, 0.3091118633747101, -0.08811713755130768, -0.1585012823343277, 0.24865567684173584, 0.03374961018562317, -0.10015111416578293, 0.4475933313369751, -0.10532282292842865, 0.16231471300125122, 0.4003782868385315, 0.00804121419787407, -0.1537727415561676, 0.04379318654537201, 0.43729647994041443, -0.18768589198589325, -0.27451640367507935, 0.6409144401550293, -0.06180405616760254, -0.17174303531646729, 0.09710494428873062, 0.037641704082489014, -0.2671402096748352, 0.05889490619301796, 0.23776046931743622, -0.4326748847961426, 0.21527689695358276, -0.043284524232149124, 0.034605540335178375, -0.2130313217639923, 0.5432325005531311, 0.018898513168096542, 0.233570396900177, -0.28823181986808777, 0.018414326012134552, -0.4456024467945099, 0.31017255783081055, -0.3749842643737793, -0.05684675648808479, 0.045918893069028854, 0.27224797010421753, -0.09743843227624893, -0.057304687798023224, -0.16247893869876862, -0.3162626028060913, -0.03408204764127731, 0.6070189476013184, -0.21963395178318024, -0.1292687952518463, -0.5112317800521851, 0.2617301344871521, 0.24064141511917114, -0.3800877630710602, 0.16256877779960632, -0.09966952353715897, -0.03765975683927536, 0.34467852115631104, -0.04806585609912872, 0.13904671370983124, -0.020807713270187378, -0.02829139679670334, 0.11951892077922821, 0.3678627610206604, -0.09867764264345169, -0.005602112039923668, -0.28074535727500916, -0.2106759399175644, -0.3988848030567169, 0.20681306719779968, 0.07291370630264282, 0.20714803040027618, -0.18904633820056915, -0.04129211977124214, -0.2826367914676666, 0.1772051751613617, 0.03879636526107788, 0.03842060640454292, -0.047160498797893524, 0.11059525609016418, 0.011520080268383026, 0.48660868406295776, 0.22763656079769135, 0.5645205974578857, -0.012442134320735931, 0.0072302259504795074, -0.23530316352844238, -0.2648499608039856, 0.2814093828201294, -0.4936082363128662, -0.3519534170627594, -0.10182717442512512, 0.3315039277076721, 0.11954984068870544, 0.011434879153966904, -0.14833775162696838, -0.04707566648721695, 0.2855328917503357, -0.24427467584609985, 0.04708502069115639, 0.1651185303926468, 0.08525864779949188, -0.035461850464344025, -0.022813688963651657, 0.3612755239009857, 0.03424851596355438, -0.46516841650009155, 0.44341129064559937, -0.2114042490720749 ]
https://github.com/huggingface/datasets/issues/6436
TypeError: <lambda>() takes 0 positional arguments but 1 was given
I meet the same problem, and originally use ```python locale.getpreferredencoding = lambda : "UTF-8" ``` and change to ``` locale.getpreferredencoding = lambda x: "UTF-8" ``` and it works.
### Describe the bug ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-35-7b6becee3685>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import Dataset 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` or ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-36-652e886d387f>](https://localhost:8080/#) in <cell line: 1>() ----> 1 import datasets 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` ### Steps to reproduce the bug `import datasets` on colab ### Expected behavior work fine ### Environment info colab `!pip install datasets`
28
TypeError: <lambda>() takes 0 positional arguments but 1 was given ### Describe the bug ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-35-7b6becee3685>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import Dataset 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` or ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-36-652e886d387f>](https://localhost:8080/#) in <cell line: 1>() ----> 1 import datasets 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` ### Steps to reproduce the bug `import datasets` on colab ### Expected behavior work fine ### Environment info colab `!pip install datasets` I meet the same problem, and originally use ```python locale.getpreferredencoding = lambda : "UTF-8" ``` and change to ``` locale.getpreferredencoding = lambda x: "UTF-8" ``` and it works.
[ -0.24039383232593536, -0.23061582446098328, -0.07767070829868317, 0.1865110993385315, 0.14264242351055145, -0.09058354049921036, 0.5438991189002991, 0.35171937942504883, -0.2524186074733734, 0.11843139678239822, -0.09356827288866043, 0.37045377492904663, -0.03344399854540825, -0.1358611136674881, 0.034661516547203064, -0.4141514301300049, -0.05787614732980728, 0.18052828311920166, -0.023786582052707672, -0.16459515690803528, -0.38248148560523987, 0.1683923602104187, -0.32553890347480774, 0.26104405522346497, 0.07116760313510895, -0.2313351333141327, -0.15879857540130615, 0.04905962944030762, -0.1146927997469902, -0.5299991965293884, 0.03479026257991791, -0.2692171633243561, -0.06655295193195343, 0.42985615134239197, -0.00010712965013226494, 0.16232572495937347, 0.3993983268737793, 0.08954169601202011, -0.3298414349555969, -0.11243899166584015, -0.4476359486579895, -0.10291031002998352, 0.16192954778671265, -0.3675445318222046, 0.11288542300462723, -0.21928466856479645, -0.006707971915602684, -0.23471687734127045, 0.20501066744327545, 0.6052010655403137, 0.2560245096683502, 0.454988956451416, 0.11783502995967865, -0.172556072473526, 0.2931157052516937, 0.10526484251022339, -0.05264608561992645, 0.1316036581993103, 0.06104009598493576, 0.27547475695610046, -0.10181427747011185, 0.1235610842704773, -0.1312478929758072, 0.17228244245052338, -0.031767942011356354, 0.07220275700092316, 0.1317111998796463, -0.1903359740972519, -0.07721244543790817, -0.08774613589048386, 0.206664577126503, -0.3679187297821045, -0.2068759799003601, 0.013139352202415466, 0.028464756906032562, -0.40932223200798035, 0.13795994222164154, 0.25526341795921326, -0.23260082304477692, -0.16207297146320343, 0.02607101760804653, 0.15150830149650574, -0.33221903443336487, 0.23351141810417175, -0.022338826209306717, 0.3076317310333252, -0.021582137793302536, 0.2299233078956604, 0.006420884281396866, -0.042800530791282654, 0.19011996686458588, -0.1773281693458557, 0.03308187797665596, 0.20071761310100555, -0.3679256737232208, 0.09347131848335266, 0.20188438892364502, -0.057824961841106415, -0.08544757962226868, 0.05683206766843796, 0.005671055056154728, -0.03532234579324722, 0.2593154311180115, 0.1046905368566513, 0.2284052073955536, 0.0311896950006485, 0.1610082983970642, 0.2621506452560425, 0.14149120450019836, 0.1571507751941681, 0.09459365904331207, -0.022017598152160645, 0.08425577729940414, -0.39969316124916077, 0.24832917749881744, 0.2029063105583191, 0.46024417877197266, 0.1271873563528061, -0.16597601771354675, -0.036469124257564545, -0.4115714430809021, 0.021329296752810478, 0.14688406884670258, 0.28121107816696167, 0.19835256040096283, 0.02724520117044449, 0.2653855085372925, 0.08382581919431686, -0.2399144321680069, -0.37904515862464905, -0.2773502767086029, 0.2032874971628189, -0.05589419603347778, -0.27545908093452454, 0.004884012043476105, -0.008578917011618614, 0.14493463933467865, 0.2615651786327362, 0.17643293738365173, 0.11831168830394745, 0.09208156913518906, -0.2829616367816925, -0.18926098942756653, 0.2874831557273865, -0.021291010081768036, 0.06621662527322769, 0.1835775077342987, -0.1166435182094574, 0.04410810023546219, 0.16353726387023926, -0.014188244938850403, -0.1912933886051178, -0.2678998112678528, 0.285275399684906, 0.2861364483833313, 0.18591897189617157, -0.6022893190383911, -0.07584333419799805, 0.20490345358848572, -0.10351858288049698, 0.07592573761940002, -0.3018614649772644, 0.14288462698459625, -0.3510836660861969, 0.11621133238077164, 0.27259141206741333, -0.16870556771755219, 0.09289397299289703, -0.30412954092025757, -0.03548554331064224, 0.167430579662323, 0.14949029684066772, -0.21368135511875153, 0.2863464951515198, -0.20002402365207672, 0.3774840831756592, 0.5248387455940247, -0.2156543880701065, -0.15476888418197632, 0.11086329072713852, -0.15699854493141174, -0.22458961606025696, -0.056619517505168915, 0.02795414812862873, 0.05630594119429588, 0.15255768597126007, 0.09401283413171768, 0.00188521109521389, -0.002086576074361801, 0.13271965086460114, -0.17223478853702545, 0.12519028782844543, -0.11086277663707733, 0.13493314385414124, -0.04139794036746025, -0.1269785761833191, 0.1550924926996231, -0.07103029638528824, 0.13655224442481995, -0.2072681486606598, 0.017171885818243027, 0.304324746131897, 0.1748984456062317, -0.24399732053279877, -0.051388371735811234, -0.2914770245552063, -0.4152144193649292, -0.009502943605184555, -0.2699531316757202, 0.09329261630773544, -0.20829392969608307, 0.06969892978668213, -0.13616997003555298, 0.2353944629430771, -0.15869367122650146, -0.04613326117396355, 0.20967525243759155, 0.20273388922214508, -0.0265491995960474, 0.11093436181545258, -0.1408223956823349, 0.13587255775928497, -0.19127441942691803, 0.05382121354341507, -0.18077044188976288, 0.2236056923866272, -0.24294449388980865, -0.4264938533306122, 0.05940372496843338, -0.23462241888046265, 0.341000497341156, 0.025264328345656395, -0.20242151618003845, 0.4115034341812134, 0.2522808611392975, 0.08636444807052612, -0.32658132910728455, -0.14054132997989655, 0.1758255958557129, -0.07089103758335114, -0.12158641964197159, 0.08631928265094757, 0.3300366997718811, -0.00304272398352623, -0.14432856440544128, 0.23921546339988708, 0.10464487969875336, 0.19874528050422668, -0.013852130621671677, 0.05395883321762085, 0.10767973959445953, 0.10977347195148468, 0.09074611961841583, 0.05637805908918381, 0.30310919880867004, 0.2901153266429901, 0.21318361163139343, 0.10182256996631622, -0.43050456047058105, -0.06581927090883255, 0.4048107862472534, 0.0031640902161598206, 0.22735372185707092, 0.11787725985050201, -0.18423962593078613, 0.047364287078380585, 0.5184704065322876, -0.1338752955198288, 0.5118929743766785, 0.16169075667858124, -0.19482353329658508, -0.04032687097787857, -0.11391228437423706, -0.21128180623054504, 0.34685584902763367, -0.029186435043811798, 0.06422345340251923, -0.0752522423863411, 0.34783148765563965, 0.023949190974235535, -0.2599250376224518, -0.18115317821502686, 0.011919837445020676, 0.250505268573761, -0.5249246954917908, 0.17736096680164337, -0.2895844876766205, -0.13590605556964874, -0.1880211979150772, 0.11367819458246231, 0.10849134624004364, -0.4264054000377655, -0.09255272150039673, 0.25522857904434204, -0.08090654015541077, 0.3088034987449646, 0.0824851393699646, 0.0826617032289505, 0.3595997095108032, -0.11631739884614944, -0.3247409462928772, 0.09893680363893509, -0.235032856464386, 0.1019357442855835, 0.03041091561317444, 0.08630535006523132, 0.2961696982383728, -0.05675818771123886, -0.10303149372339249, -0.4529976546764374, -0.27332010865211487, -0.02492925524711609, -0.06362520158290863, 0.2582590579986572, 0.4544528126716614, 0.07620669156312943, -0.3573736548423767, -0.3642462491989136, 0.2945438623428345, 0.016091803088784218, -0.34025731682777405, 0.23292163014411926, -0.08551908284425735, 0.012616216205060482, -0.23041725158691406, -0.30200818181037903, -0.11178331822156906, -0.5146058797836304, 0.30788853764533997, 0.09169483184814453, 0.2656404972076416, -0.09918180108070374, 0.16748549044132233, 0.3358348309993744, 0.021250635385513306, 0.1293439269065857, -0.044235434383153915, 0.14066749811172485, 0.24108193814754486, -0.1707914173603058, -0.3287402093410492, -0.29190900921821594, -0.17632508277893066, 0.32346516847610474, 0.03612275794148445, -0.327480673789978, -0.3213784992694855, -0.16848108172416687, 0.4865463376045227, -0.18079300224781036, 0.13419082760810852, 0.352461576461792, 0.21195736527442932, -0.12413732707500458, -0.09917917847633362, -0.11971883475780487, -0.024461105465888977, 0.18937614560127258, 0.011387184262275696, 0.1744270622730255, 0.39765673875808716, 0.09464438259601593, 0.6955875158309937, 0.16605497896671295, -0.35589009523391724, 0.4887019395828247, -0.3963988125324249, -0.08533176779747009, -0.13536739349365234, -0.6017588973045349, 0.10819831490516663, 0.0419330969452858, 0.13875895738601685, -0.1413831263780594, -0.2725907862186432, -0.48764345049858093, -0.04937351495027542, -0.18201278150081635, -0.4025411903858185, -0.13869193196296692, 0.1262284219264984, 0.004638317972421646, 0.15375974774360657, -0.125625342130661, 0.0025645270943641663, -0.3156733214855194, 0.03547285124659538, 0.013005698099732399, -0.09898367524147034, 0.018405646085739136, -0.14959360659122467, 0.13179844617843628, 0.06756146252155304, -0.230837881565094, 0.4696364402770996, 0.09804121404886246, 0.11361628025770187, 0.02324778214097023, 0.07686299830675125, 0.18925952911376953, -0.1807582825422287, 0.46595603227615356, -0.05832815170288086, 0.007260318845510483, 0.2736276090145111, -0.0434255450963974, -0.6028879880905151, 0.147485613822937, -0.5035708546638489, 0.32591235637664795, 0.17921622097492218, 0.19375652074813843, -0.3657662570476532, -0.1025518849492073, 0.1703886091709137, 0.03860558196902275, -0.040288809686899185, 0.09451855719089508, -0.15106628835201263, -0.43197759985923767, -0.3088272511959076, 0.28285884857177734, 0.14766117930412292, 0.21766981482505798, 0.24034172296524048, -0.008393120020627975, -0.2651214003562927, -0.11427786946296692, -0.1954336315393448, -0.02097190171480179, 0.10490673780441284, -0.07722833752632141, 0.003076668828725815, -0.1675523817539215, 0.15678080916404724, 0.4747394919395447, 0.29095980525016785, 0.1219554990530014, -0.4345981478691101, -0.022777732461690903, 0.017732959240674973, 0.25368863344192505, 0.20652499794960022, -0.16305455565452576, -0.008436940610408783, -0.2059677541255951, 0.29452162981033325, 0.08853277564048767, 0.1598709225654602, 0.6020025014877319, 0.1027030199766159, 0.08195900171995163, -0.1615227907896042, 0.3280462324619293, -0.01450623944401741, -0.0660046935081482, 0.5228307247161865, 0.2431044727563858, -0.32800665497779846, 0.20859485864639282, 0.2508373260498047, 0.7374529242515564, 0.32111185789108276, 0.055154964327812195, 0.7244294881820679, -0.21125555038452148, 0.2740151286125183, 0.2221679836511612, 0.3060358762741089, -0.3891392648220062, 0.007080980576574802, -0.08057952672243118, -0.25356948375701904, 0.11080797761678696, 0.05471855029463768, -0.34851738810539246, 0.035985879600048065, -0.34817129373550415, 0.04441584646701813, 0.0586262047290802, 0.12595872581005096, 0.006638099439442158, -0.20647211372852325, -0.4696236252784729, 0.2127157300710678, -0.2583480477333069, -0.05032282695174217, -0.08314960449934006, -0.05849192291498184, -0.028132256120443344, -0.3715788722038269, -0.30797329545021057, 0.13295748829841614, -0.3804602324962616, 0.396317720413208, -0.13981769979000092, -0.13656234741210938, 0.033827800303697586, 0.2793579399585724, -0.15286096930503845, 0.03843837231397629, 0.1270422339439392, 0.12864837050437927, 0.4166536331176758, 0.14633101224899292, -0.03543467074632645, -0.0533045157790184, 0.1883789449930191, -0.1618579924106598, -0.30835896730422974, 0.1758348047733307, -0.044752299785614014, -0.48616117238998413, 0.030189543962478638, 0.22716866433620453, -0.08999238908290863, -0.22965040802955627, -0.06842084228992462, -0.28970199823379517, -0.13447903096675873, -0.24616029858589172, 0.18484418094158173, -0.076479971408844, -0.12337220460176468, 0.14377591013908386, -0.058682214468717575, -0.17806237936019897, -0.05678838863968849, 0.5387619733810425, 0.05331277847290039, 0.13523085415363312, 0.39040860533714294, 0.1872549057006836, -0.22895903885364532, -0.24651598930358887, 0.2591041326522827, 0.0566401369869709, -0.5392209887504578, 0.4411163330078125, -0.16409802436828613, 0.05745099484920502, -0.09225500375032425, 0.3634656071662903, -0.025743387639522552, 0.21435478329658508, -0.10427378118038177, -0.11717075854539871, -0.14456720650196075, 0.21408526599407196, -0.08417624235153198, 0.06739478558301926, 0.24190428853034973, 0.15435004234313965, 0.21184520423412323, -0.025124577805399895, -0.38074010610580444, 0.032678619027137756, -0.2951480746269226, 0.23626092076301575, 0.16926750540733337, -0.12558332085609436, 0.06674398481845856, 0.18252429366111755, 0.33019691705703735, 0.18600791692733765, -0.049443669617176056, -0.3439481854438782, -0.08825507760047913, 0.09414806962013245, -0.1817288100719452, -0.09338823705911636, 0.08795051276683807, -0.222365602850914, -0.14998842775821686, -0.07703906297683716, -0.02208365872502327, 0.031043782830238342, -0.13547077775001526, -0.01194791030138731, 0.33723288774490356, -0.029790475964546204, 0.022841885685920715, -0.00871078297495842, -0.2073637843132019, -0.08909285068511963, -0.22589482367038727, 0.2695666551589966, 0.09709031879901886, -0.1739286482334137, 0.0016920575872063637, -0.05258160084486008, -0.0008842721581459045, 0.0722917914390564, 0.2613564431667328, -0.2268865555524826, -0.24505649507045746, -0.19125483930110931, 0.14459460973739624, 0.1597009152173996, -0.2452450543642044, 0.05623447895050049, -0.1687038242816925, 0.2582169473171234, -0.2304033637046814, -0.14855647087097168, 0.21107052266597748, 0.09888998419046402, 0.14916016161441803, 0.10547380894422531, -0.25109797716140747, 0.04900580644607544, 0.043246783316135406, 0.10689940303564072, 0.10893924534320831, -0.2647359371185303, -0.06595519185066223, 0.21376092731952667, -0.3455418050289154, -0.09938687086105347, 0.2993786334991455, 0.20197449624538422, 0.25009581446647644, 0.30464082956314087, -0.2830733060836792, 0.019474707543849945, -0.05814950168132782, -0.10348975658416748, 0.2518547475337982, -0.0368027426302433, -0.08361609280109406, 0.03389948606491089, -0.1405887007713318, 0.050531744956970215, 0.09842491894960403, 0.18109187483787537, 0.058092303574085236, -0.2538588345050812, -0.19667205214500427, 0.34125712513923645, -0.3169653117656708, 0.10588961839675903, -0.6179501414299011, 0.03174300491809845, -0.21382907032966614, -0.15634813904762268, 0.03163014352321625, 0.011639401316642761, 0.7944273948669434, 0.17600154876708984, 0.03390863910317421, -0.3952224850654602, 0.14860810339450836, 0.1874294877052307, 0.18828517198562622, -0.19963468611240387, 0.3671615421772003, 0.39850252866744995, 0.05599427968263626, -0.20721617341041565, 0.3221140205860138, 0.5091574788093567, 0.4500730037689209, -0.14542482793331146, 0.05018900707364082, 0.05661235377192497, -0.22804193198680878, -0.13786929845809937, 0.038157202303409576, -0.03805883973836899, 0.47474223375320435, 0.2780981659889221, 0.2717224657535553, -0.19277013838291168, 0.19703954458236694, 0.11352391541004181, 0.14353972673416138, -0.31919771432876587, 0.5229285955429077, -0.22392666339874268, -0.17629358172416687, 0.0067910607904195786, -0.13116392493247986, -0.2691861391067505, 0.10968740284442902, 0.38120684027671814, 0.07683612406253815, 0.13571196794509888, -0.1187630295753479, 0.11775293946266174, 0.049753472208976746, 0.28851228952407837, 0.13196659088134766, 0.28825142979621887, -0.397015243768692, -0.061219893395900726, -0.40045350790023804, 0.2279335856437683, -0.06156792864203453, -0.12623152136802673, 0.18310017883777618, 0.2680623531341553, -0.05791532248258591, 0.21150752902030945, 0.323996365070343, -0.15925495326519012, -0.04236574098467827, 0.24544930458068848, -0.4888632893562317, 0.03696908801794052, 0.13468071818351746, -0.23115220665931702, 0.06808332353830338, -0.37622350454330444, 0.22293658554553986, -0.1795521080493927, 0.2082422971725464, -0.14948908984661102, -0.19374330341815948, 0.36685091257095337, 0.011052414774894714, 0.3899172842502594, 0.09704963862895966, 0.1781264841556549, -0.130041241645813, -0.08491311222314835, 0.06377607583999634, -0.22209839522838593, -0.3201145827770233, 0.2860092520713806, -0.016673661768436432, 0.5083800554275513, -0.02426748163998127, -0.19442324340343475, -0.2502587139606476, 0.3414948284626007, 0.029657259583473206, -0.04717230051755905, -0.10064475238323212, 0.3129524290561676, -0.21604901552200317, 0.024206262081861496, -0.13002659380435944, 0.02486760914325714, 0.026971692219376564, 0.14285902678966522, -0.29669976234436035, -0.7130290865898132, 0.5385369658470154, -0.6111281514167786, -0.28940603137016296, 0.0458260104060173, 0.08120547235012054, 0.003305591642856598, 0.11518238484859467, -0.373872846364975, -0.12980733811855316, 0.5502603054046631, -0.16306054592132568, -0.3971306383609772, 0.1399138867855072, 0.09744830429553986, -0.009635992348194122, -0.1300763636827469, 0.22771653532981873, 0.09985152631998062, -0.1518777459859848, 0.08439813554286957, -0.32301580905914307 ]
https://github.com/huggingface/datasets/issues/6432
load_dataset does not load all of the data in my input file
You should use `datasets.load_dataset` instead of `nlp.load_dataset`, as the `nlp` package is outdated. If switching to `datasets.load_dataset` doesn't fix the issue, sharing the JSON file (feel free to replace the data with dummy data) would be nice so that we can reproduce it ourselves.
### Describe the bug I have 127 elements in my input dataset. When I do a len on the dataset after loaded, it is only 124 elements. ### Steps to reproduce the bug train_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.TRAIN) valid_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.VALIDATION) logger.info(len(train_dataset)) logger.info(len(valid_dataset)) Both train and valid input are 127 items. However, they both only load 124 items. The input format is in json. At the end of the day, I am trying to create .pt files. ### Expected behavior I see all 127 elements in my dataset when performing len ### Environment info Python 3.10. CentOS operating system. nlp==0.40, datasets==2.14.5, transformers==4.26.1
44
load_dataset does not load all of the data in my input file ### Describe the bug I have 127 elements in my input dataset. When I do a len on the dataset after loaded, it is only 124 elements. ### Steps to reproduce the bug train_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.TRAIN) valid_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.VALIDATION) logger.info(len(train_dataset)) logger.info(len(valid_dataset)) Both train and valid input are 127 items. However, they both only load 124 items. The input format is in json. At the end of the day, I am trying to create .pt files. ### Expected behavior I see all 127 elements in my dataset when performing len ### Environment info Python 3.10. CentOS operating system. nlp==0.40, datasets==2.14.5, transformers==4.26.1 You should use `datasets.load_dataset` instead of `nlp.load_dataset`, as the `nlp` package is outdated. If switching to `datasets.load_dataset` doesn't fix the issue, sharing the JSON file (feel free to replace the data with dummy data) would be nice so that we can reproduce it ourselves.
[ -0.224443718791008, -0.25275957584381104, 0.0006522201001644135, 0.5328266620635986, 0.18958553671836853, -0.07044351100921631, 0.3324059844017029, 0.4615917503833771, -0.04259952902793884, -0.11367644369602203, 0.1374281644821167, 0.3046747148036957, 0.01671113446354866, 0.24982483685016632, 0.16968481242656708, 0.12781672179698944, 0.0996900349855423, 0.348788857460022, 0.10077066719532013, -0.2723931074142456, -0.36264482140541077, 0.07417941093444824, -0.4020255208015442, -0.09890931844711304, -0.352175772190094, 0.26073744893074036, 0.0624215230345726, 0.23463174700737, 0.12456781417131424, -0.4364352524280548, 0.18611760437488556, -0.13271556794643402, 0.36001327633857727, 0.17085562646389008, -0.00012177028838777915, 0.028943710029125214, 0.5684621334075928, -0.01503960881382227, -0.551904559135437, -0.07738225162029266, -0.07485389709472656, -0.49630028009414673, 0.3936576843261719, -0.1668049544095993, 0.030418142676353455, -0.08346337825059891, -0.10060745477676392, -0.006236173212528229, 0.3090464770793915, 0.22580140829086304, 0.08592864871025085, 0.32362061738967896, 0.04154946282505989, 0.28020423650741577, 0.22360491752624512, 0.23021407425403595, 0.08257477730512619, 0.35655921697616577, 0.3005424737930298, -0.18386787176132202, -0.10722307115793228, 0.06807065010070801, 0.15647554397583008, 0.10571978986263275, 0.30371007323265076, 0.030421048402786255, 0.2394530177116394, -0.15045671164989471, -0.05563229322433472, 0.38704562187194824, 0.335528701543808, -0.05746127665042877, -0.20106209814548492, -0.4094570279121399, 0.03108653798699379, -0.39972299337387085, 0.14803488552570343, 0.3133983910083771, -0.27239227294921875, -0.11231064796447754, -0.4547339081764221, 0.06105491891503334, -0.1430191546678543, 0.40296226739883423, -0.20040303468704224, 0.1657598614692688, -0.0762978345155716, 0.18328872323036194, 0.04885256662964821, -0.005453813821077347, -0.19280968606472015, -0.1885221153497696, -0.08351565897464752, 0.21147504448890686, -0.32072913646698, 0.1455971896648407, 0.040361739695072174, 0.008043937385082245, 0.25152549147605896, 0.3449169397354126, 0.14366748929023743, 0.2545727491378784, -0.1615852266550064, 0.0784442350268364, 0.37265726923942566, 0.20350861549377441, 0.25727808475494385, 0.12761634588241577, 0.09690524637699127, -0.09336124360561371, -0.3059864342212677, -0.04518836736679077, -0.0969349592924118, -0.18278679251670837, 0.3994844853878021, -0.3624851703643799, 0.11544759571552277, -0.05506683886051178, -0.07121165841817856, 0.08286132663488388, -0.23570218682289124, -0.2170264720916748, 0.1245281994342804, 0.15148025751113892, -0.07729668915271759, 0.5268689393997192, 0.018194008618593216, 0.23758572340011597, -0.20418378710746765, -0.2614453136920929, -0.13241633772850037, -0.15017974376678467, -0.26104608178138733, -0.12000688165426254, 0.32691091299057007, -0.4835476279258728, 0.2737447917461395, 0.1474011391401291, -0.03589700162410736, -0.43159666657447815, 0.025769805535674095, -0.1987391710281372, 0.026807449758052826, 0.09792444109916687, 0.12815555930137634, 0.10061423480510712, 0.05493408069014549, -0.23000726103782654, -0.02255386859178543, 0.3589301109313965, -0.3307252526283264, -0.018548082560300827, -0.08594076335430145, 0.08526977151632309, -0.1750212162733078, 0.27042317390441895, -0.24780812859535217, 0.14422978460788727, 0.27840545773506165, -0.04196486994624138, -0.14690685272216797, -0.3472558259963989, -0.06280902773141861, -0.23724812269210815, 0.3787120282649994, 0.369210422039032, -0.1081283837556839, -0.18531781435012817, -0.12588679790496826, 0.09513218700885773, 0.3059300184249878, 0.2293972671031952, -0.3134552836418152, 0.21763864159584045, -0.1764569878578186, 0.19762901961803436, 0.6631985902786255, -0.15026319026947021, -0.18133653700351715, 0.47148075699806213, 0.06517450511455536, -0.023745879530906677, -0.22953549027442932, 0.1344453990459442, -0.07387249171733856, 0.08530648797750473, 0.24667906761169434, 0.423403263092041, 0.12279290705919266, -0.09017918258905411, -0.41716673970222473, 0.002173151820898056, 0.41735488176345825, 0.31177830696105957, -0.020011138170957565, 0.013271145522594452, 0.0788099616765976, 0.11366629600524902, 0.305693656206131, -0.0033762603998184204, 0.14156107604503632, 0.4893268942832947, -0.17477038502693176, -0.02029401808977127, 0.15940958261489868, -0.15695348381996155, -0.19216680526733398, 0.010677851736545563, -0.17847414314746857, -0.15576118230819702, 0.5500699281692505, 0.3635919690132141, -0.42791473865509033, 0.10439383238554001, -0.08666028082370758, -0.08275225758552551, -0.031476493924856186, 0.24595394730567932, -0.0599159300327301, 0.155837744474411, -0.04284535348415375, 0.15812823176383972, -0.14592428505420685, 0.1933523267507553, -0.641118049621582, 0.1716742068529129, 0.11235872656106949, -0.05316363647580147, 0.1298668086528778, 0.2866257429122925, 0.18021735548973083, -0.07765790820121765, -0.03415384143590927, 0.27578428387641907, 0.1759345978498459, -0.060333967208862305, -0.40528005361557007, -0.15526725351810455, 0.238029345870018, -0.2026490569114685, 0.04031125083565712, 0.12584741413593292, 0.22101259231567383, -0.13857325911521912, -0.33492058515548706, 0.2347472608089447, -0.19019299745559692, 0.2219230830669403, 0.002352934330701828, -0.08681510388851166, 0.1751733124256134, -0.1883564293384552, -0.24556823074817657, 0.050371505320072174, 0.4673860967159271, -0.0683901309967041, 0.6525611877441406, 0.30990901589393616, -0.2237098217010498, -0.24047482013702393, 0.2551990747451782, -0.18096180260181427, -0.12666058540344238, 0.4378160238265991, -0.5308259725570679, -0.1935548186302185, -0.039850905537605286, -0.15967489778995514, 0.2765963077545166, 0.2005147635936737, 0.012135379016399384, -0.18515200912952423, -0.021360009908676147, -0.14263446629047394, 0.14546367526054382, 0.1326248049736023, 0.12603114545345306, 0.2972591817378998, 0.20491498708724976, 0.0495663620531559, -0.14737316966056824, 0.040746454149484634, 0.10579070448875427, 0.31737032532691956, -0.3456897437572479, 0.12180574983358383, -0.18457667529582977, -0.04791193827986717, -0.11303991079330444, -0.2269161194562912, -0.30367323756217957, -0.24626228213310242, -0.2947978377342224, -0.0784342885017395, 0.2750406861305237, -0.20445293188095093, -0.18228544294834137, -0.16961200535297394, 0.2309001237154007, -0.22255447506904602, -0.040082477033138275, 0.18419601023197174, -0.5351242423057556, -0.0827055424451828, 0.295151948928833, 0.3418934941291809, 0.09560688585042953, -0.06609360128641129, -0.07677380740642548, 0.35081401467323303, -0.3517037630081177, 0.09587696939706802, 0.12244375795125961, 0.14930732548236847, -0.17040202021598816, 0.20462414622306824, 0.016011465340852737, -0.22398367524147034, 0.22410860657691956, -0.016086941584944725, -0.1506933718919754, 0.5195221900939941, 0.0825914517045021, -0.02529548481106758, -0.09860120713710785, -0.22256287932395935, -0.07684218883514404, -0.24775928258895874, 0.4445326328277588, 0.4914020001888275, 0.11586128175258636, 0.3655413091182709, 0.10496001690626144, -0.027222059667110443, 0.15449775755405426, -0.041462287306785583, -0.16125494241714478, -0.0684647485613823, 0.43531686067581177, 0.08340084552764893, -0.3327881097793579, -0.3134317994117737, -0.24479469656944275, -0.02777768298983574, 0.2690587639808655, -0.695597767829895, 0.06148001179099083, -0.23572327196598053, 0.12186065316200256, -0.23903542757034302, 0.02463049255311489, 0.07388036698102951, -0.17119140923023224, 0.09481209516525269, 0.08961955457925797, -0.1935972273349762, 0.009976796805858612, 0.007348779588937759, 0.20384487509727478, 0.01715926267206669, 0.28166481852531433, -0.06934863328933716, 0.254371702671051, 0.3048184812068939, -0.18913690745830536, 0.2597033977508545, -0.10328111797571182, 0.23614463210105896, -0.1305757462978363, -0.24893809854984283, 0.2689815163612366, 0.04601610451936722, 0.10548880696296692, 0.37334078550338745, 0.13708268105983734, -0.29639390110969543, -0.18620429933071136, -0.08767388761043549, -0.35069289803504944, -0.13472361862659454, 0.2824743092060089, -0.3737395703792572, 0.19517531991004944, -0.004662219434976578, 0.16063666343688965, -0.08647643029689789, -0.39063358306884766, -0.3392751216888428, -0.03436616063117981, 0.2841915786266327, -0.04053505137562752, -0.5853843688964844, -0.2248716801404953, -0.2105296552181244, 0.08560732007026672, -0.04551525413990021, 0.6137228012084961, 0.03992823138833046, -0.21700921654701233, 0.24963398277759552, 0.10107020288705826, 0.516858696937561, 0.12293443828821182, 0.15485355257987976, 0.3156917095184326, 0.03167898207902908, -0.7037760615348816, -0.0448986180126667, -0.13702286779880524, 0.29372933506965637, 0.4656356871128082, 0.5780347585678101, -0.2346375584602356, -0.05989637225866318, -0.044909343123435974, 0.4081525206565857, -0.26216626167297363, -0.3109588623046875, -0.27268078923225403, -0.0804300606250763, -0.2195938378572464, -0.22150090336799622, -0.13015277683734894, 0.42894962430000305, -0.10698764771223068, -0.108858123421669, -0.10865457355976105, -0.11793006211519241, 0.24894680082798004, -0.00004627741873264313, 0.41923603415489197, 0.014432746917009354, 0.2618078291416168, -0.175442636013031, 0.013315368443727493, 0.072589211165905, 0.2881409525871277, 0.12677133083343506, -0.11000292003154755, 0.11257106065750122, -0.20745782554149628, 0.3274167776107788, 0.03123445063829422, 0.04591318219900131, -0.21163567900657654, -0.04660356044769287, 0.2516650855541229, -0.2646366357803345, 0.1668439507484436, -0.05596102774143219, -0.040091171860694885, -0.46189039945602417, -0.3559655547142029, 0.42321738600730896, -0.0381535142660141, 0.09763553738594055, 0.17758400738239288, -0.6368565559387207, -0.1762104630470276, 0.37467098236083984, -0.11902648955583572, 0.6790534853935242, -0.007510550320148468, 0.2370130568742752, 0.114930659532547, 0.23187439143657684, 0.31954818964004517, -0.4872645139694214, -0.09025249630212784, -0.5621883273124695, -0.1214451938867569, 0.05281178653240204, -0.22114096581935883, -0.14551123976707458, 0.36943715810775757, 0.08812257647514343, 0.13444384932518005, -0.04296567291021347, -0.29611265659332275, 0.05395872890949249, 0.5972747802734375, -0.01678185723721981, -0.191360741853714, -0.31629011034965515, 0.030451904982328415, -0.22065739333629608, 0.2635630965232849, 0.1330772340297699, -0.23134396970272064, -0.09304340183734894, -0.24884815514087677, -0.27794522047042847, 0.17976751923561096, 0.07097383588552475, -0.031675923615694046, 0.4418853223323822, -0.4532088041305542, -0.06073834374547005, 0.36769193410873413, 0.11317700147628784, 0.2616906464099884, -0.1373358517885208, 0.04261832311749458, -0.1678883135318756, 0.12147717922925949, 0.11303918808698654, 0.15115633606910706, 0.29472672939300537, -0.012994945049285889, -0.16297529637813568, -0.03282925486564636, -0.1263466477394104, -0.24916264414787292, -0.10080362111330032, 0.48683780431747437, 0.029975632205605507, -0.2998363971710205, -0.04076582193374634, 0.05794553831219673, -0.07194136083126068, -0.05210990086197853, 0.07114169001579285, 0.4121636152267456, -0.11696266382932663, 0.3908933401107788, 0.34005191922187805, -0.27683013677597046, 0.03037995472550392, 0.2642512917518616, 0.1776602566242218, 0.17407569289207458, 0.5823050737380981, 0.11764213442802429, 0.12647776305675507, -0.14505237340927124, 0.39444005489349365, 0.22737520933151245, -0.28987643122673035, -0.09584236145019531, 0.18216952681541443, 0.4858274459838867, -0.16693377494812012, -0.04512134566903114, -0.07508932799100876, -0.02380291372537613, 0.13440020382404327, -0.6741447448730469, -0.3951924443244934, -0.016085699200630188, 0.09692496806383133, -0.020443085581064224, 0.15878719091415405, 0.11076107621192932, 0.1869044303894043, 0.3212975561618805, -0.16259150207042694, -0.04286704212427139, -0.1255027949810028, 0.2529063820838928, 0.08775918185710907, -0.24160030484199524, -0.14518611133098602, -0.01784154400229454, 0.029859943315386772, 0.0405702106654644, 0.09683559834957123, -0.14576835930347443, -0.1036854088306427, 0.16856186091899872, 0.14719516038894653, -0.30075767636299133, -0.28939947485923767, -0.12804582715034485, -0.10810187458992004, -0.23972830176353455, -0.3859041631221771, -0.13926905393600464, -0.03678588569164276, 0.287054181098938, 0.2968312203884125, 0.23848816752433777, -0.07301543653011322, 0.15712718665599823, -0.35368648171424866, 0.30360329151153564, 0.13448022305965424, 0.16237366199493408, 0.45312654972076416, 0.1561572402715683, -0.7785106897354126, -0.11112073808908463, 0.0017854124307632446, -0.11476526409387589, 0.1901986300945282, -0.35171210765838623, 0.0638265460729599, 0.13457748293876648, 0.15997545421123505, 0.5930723547935486, -0.3299895226955414, 0.37389057874679565, 0.14464646577835083, 0.07812278717756271, -0.1526164710521698, -0.23929950594902039, 0.23135274648666382, 0.013496571220457554, -0.1881023496389389, 0.01778261363506317, 0.030279722064733505, -0.47879868745803833, -0.012254759669303894, -0.050276655703783035, 0.12082218378782272, -0.23485912382602692, -0.016231125220656395, 0.4455522894859314, -0.016097083687782288, 0.00787103921175003, 0.04652790725231171, 0.2865639626979828, -0.053787969052791595, 0.1907098889350891, 0.2402592897415161, -0.0404544398188591, -0.0683271586894989, -0.10022635757923126, -0.29146113991737366, -0.40084654092788696, -0.18763990700244904, 0.6119804978370667, -0.2682214379310608, 0.16674646735191345, 0.03154999390244484, 0.5129218101501465, 0.09641572833061218, -0.06018118932843208, -0.1925300508737564, -0.11110912263393402, -0.03388866037130356, -0.13328999280929565, -0.24160167574882507, 0.0406094565987587, -0.3312942087650299, 0.002523224800825119, -0.06479617953300476, -0.39090389013290405, 0.10468816012144089, 0.4437538981437683, -0.40553218126296997, -0.48629432916641235, -0.10080014914274216, 0.39168331027030945, -0.1409553587436676, -0.3586564064025879, 0.28013256192207336, -0.0008258894085884094, 0.03831426426768303, 0.3191934823989868, -0.2417418509721756, 0.41166701912879944, 0.392839252948761, 0.11651407182216644, 0.03279867395758629, 0.18956835567951202, -0.1359623670578003, -0.38192492723464966, 0.4151184856891632, 0.30784502625465393, 0.32027924060821533, 0.25192371010780334, 0.011987891048192978, -0.03672073781490326, 0.2499353289604187, 0.10802033543586731, 0.009085839614272118, -0.4667253792285919, 0.41281336545944214, 0.026274424046278, -0.37172576785087585, -0.4192409813404083, -0.10773444920778275, -0.3322904407978058, 0.14143289625644684, 0.14313358068466187, 0.3219359815120697, 0.26659274101257324, -0.1496928185224533, 0.021417878568172455, -0.2120053917169571, 0.18523035943508148, 0.21112146973609924, -0.24969947338104248, -0.17801977694034576, -0.2997319996356964, -0.638454258441925, 0.027545541524887085, -0.14019758999347687, -0.08874808251857758, 0.3563878834247589, 0.23140378296375275, -0.07106079906225204, 0.1294046938419342, -0.15332840383052826, 0.07896393537521362, 0.13139846920967102, 0.24864566326141357, -0.2145976424217224, -0.15692156553268433, -0.2094855159521103, 0.27723196148872375, -0.24207952618598938, -0.23956561088562012, 0.3691573441028595, -0.294220507144928, -0.04777608811855316, -0.14593474566936493, -0.05735946446657181, 0.1419578641653061, 0.7537992000579834, 0.23559962213039398, 0.23452350497245789, 0.3146168291568756, -0.12369420379400253, 0.11773469299077988, -0.2646283209323883, -0.08533056080341339, -0.19145141541957855, 0.3238665461540222, -0.1404619663953781, 0.12759366631507874, -0.18853147327899933, -0.16615916788578033, -0.05510304868221283, 0.08051679283380508, -0.11880054324865341, -0.3265734314918518, -0.03812459111213684, -0.2519034147262573, -0.12649428844451904, 0.07435336709022522, 0.17217129468917847, 0.18973767757415771, -0.009908907115459442, -0.21877829730510712, -0.11042489856481552, -0.24754507839679718, 0.13259506225585938, -0.5177541971206665, -0.3144541382789612, -0.030056308954954147, 0.1442365050315857, 0.016620025038719177, 0.1290900558233261, -0.18957065045833588, -0.03503428399562836, 0.6898506879806519, -0.14976167678833008, -0.19893614947795868, 0.20529761910438538, -0.23690205812454224, 0.11475852131843567, -0.08574935793876648, 0.23575705289840698, 0.30700576305389404, -0.3275739848613739, 0.17746420204639435, -0.29896456003189087 ]
https://github.com/huggingface/datasets/issues/6422
Allow to choose the `writer_batch_size` when using `save_to_disk`
We have a config variable that controls the batch size in `save_to_disk`: ```python import datasets datasets.config.DEFAULT_MAX_BATCH_SIZE = <smaller_batch_size> ... ds.save_to_disk(...) ```
### Feature request Add an argument in `save_to_disk` regarding batch size, which would be passed to `shard` and other methods. ### Motivation The `Dataset.save_to_disk` method currently calls `shard` without passing a `writer_batch_size` argument, thus implicitly using the default value (1000). This can result in RAM saturation when using a lot of processes on long text sequences or other modalities, or for specific IO configs. ### Your contribution I would be glad to submit a PR, as long as it does not imply extensive tests refactoring.
21
Allow to choose the `writer_batch_size` when using `save_to_disk` ### Feature request Add an argument in `save_to_disk` regarding batch size, which would be passed to `shard` and other methods. ### Motivation The `Dataset.save_to_disk` method currently calls `shard` without passing a `writer_batch_size` argument, thus implicitly using the default value (1000). This can result in RAM saturation when using a lot of processes on long text sequences or other modalities, or for specific IO configs. ### Your contribution I would be glad to submit a PR, as long as it does not imply extensive tests refactoring. We have a config variable that controls the batch size in `save_to_disk`: ```python import datasets datasets.config.DEFAULT_MAX_BATCH_SIZE = <smaller_batch_size> ... ds.save_to_disk(...) ```
[ -0.4314616024494171, -0.1805669516324997, -0.05189831554889679, -0.018587559461593628, 0.021445445716381073, -0.026461932808160782, 0.37969619035720825, 0.23060080409049988, -0.11458693444728851, 0.4054449200630188, 0.2738930881023407, -0.0001532435417175293, -0.38357529044151306, 0.3539934754371643, 0.04642868787050247, -0.07538361847400665, 0.08477131277322769, -0.05380803346633911, 0.21372604370117188, 0.1761130541563034, -0.2588251829147339, 0.11787309497594833, 0.0074287354946136475, -0.20992358028888702, -0.1458871215581894, -0.026587562635540962, -0.0050604213029146194, 0.039014145731925964, -0.15002447366714478, -0.38121309876441956, 0.004932055249810219, 0.3355003297328949, 0.3748128116130829, 0.15634219348430634, -0.00010956959158647805, -0.26680079102516174, 0.323289155960083, -0.1253470480442047, -0.31482136249542236, 0.049621425569057465, -0.20595765113830566, -0.3676259219646454, -0.1161767914891243, -0.41978561878204346, 0.19847235083580017, 0.2620992660522461, 0.2055872082710266, -0.05282259359955788, 0.07618997246026993, 0.11173351109027863, 0.2669864594936371, 0.0996711328625679, -0.09081819653511047, -0.10821695625782013, 0.3324825167655945, 0.5160637497901917, -0.3168068528175354, 0.03521142899990082, 0.23207737505435944, 0.08662720769643784, -0.26149165630340576, 0.1316985934972763, -0.18692465126514435, 0.028441881760954857, 0.26372742652893066, 0.07173287123441696, 0.37700149416923523, -0.18415828049182892, 0.11334724724292755, 0.2750404477119446, 0.42208805680274963, -0.5202154517173767, -0.31773948669433594, -0.22323280572891235, 0.034238047897815704, -0.4155111312866211, -0.129315584897995, 0.11740802973508835, -0.4603770971298218, 0.0310366153717041, -0.31201615929603577, -0.28328320384025574, -0.2156411111354828, -0.21811772882938385, 0.28151753544807434, -0.16716480255126953, -0.1571655124425888, -0.1541484296321869, 0.34673750400543213, -0.07604061812162399, 0.20416775345802307, -0.18332146108150482, -0.08427441120147705, -0.1364326775074005, -0.2599828541278839, -0.19399620592594147, 0.06470959633588791, 0.2643905580043793, 0.3019062578678131, 0.13298474252223969, 0.08580394834280014, -0.11650065332651138, 0.3670980632305145, 0.0375826470553875, -0.05356236919760704, 0.13807421922683716, 0.28905436396598816, -0.12847886979579926, 0.20907652378082275, -0.0841246172785759, 0.30000486969947815, 0.04781850427389145, 0.3662104308605194, -0.3583499789237976, 0.6581652164459229, -0.24148201942443848, 0.11234979331493378, 0.013383757323026657, 0.0888819620013237, 0.09917047619819641, 0.4678732752799988, -0.12612847983837128, -0.06932145357131958, 0.37589001655578613, 0.031158890575170517, -0.08773107826709747, -0.13029244542121887, 0.05070928484201431, -0.031086623668670654, -0.04083474725484848, -0.23258250951766968, -0.04204127565026283, 0.14579612016677856, 0.014760682359337807, 0.21097837388515472, 0.09795361757278442, -0.062434665858745575, -0.039609622210264206, 0.33484816551208496, 0.18940123915672302, 0.05078567564487457, -0.14198464155197144, 0.22458261251449585, 0.2575564980506897, -0.04816115275025368, 0.028000013902783394, -0.16867561638355255, -0.099985271692276, -0.36019352078437805, 0.4521947205066681, -0.06575565785169601, -0.3699512183666229, -0.046745769679546356, 0.22474300861358643, -0.11705230921506882, -0.042437843978405, -0.6762949824333191, 0.05872274562716484, 0.2717784643173218, 0.11101005971431732, 0.03186427056789398, -0.26763904094696045, -0.2966585159301758, -0.5773928165435791, 0.2610621452331543, 0.4037008285522461, -0.08515093475580215, 0.03127586841583252, -0.3152877688407898, -0.18527477979660034, 0.1670549511909485, 0.30950218439102173, 0.09218597412109375, -0.10048612207174301, -0.11977427452802658, 0.3470069169998169, 0.41415664553642273, -0.1110570877790451, -0.35416218638420105, 0.21766848862171173, 0.0031614452600479126, -0.17879801988601685, 0.525627076625824, 0.37208694219589233, 0.5451396703720093, -0.11139100044965744, 0.21916818618774414, 0.414331316947937, -0.19486267864704132, 0.2829260528087616, -0.4637395143508911, -0.41785961389541626, -0.28763896226882935, 0.22241534292697906, 0.1523943990468979, 0.06193653494119644, 0.02025647461414337, -0.28085121512413025, 0.30264046788215637, 0.0705416202545166, 0.3007321357727051, 0.02473127655684948, 0.49842554330825806, -0.26617199182510376, -0.15414007008075714, -0.08980701118707657, -0.16034862399101257, 0.089192695915699, 0.07008983939886093, -0.14651940762996674, 0.22388897836208344, -0.3210441470146179, 0.04339756816625595, 0.09223593026399612, 0.1993592083454132, 0.15746577084064484, 0.11611638963222504, -0.10183769464492798, -0.012887760996818542, 0.16494837403297424, -0.03650612384080887, 0.1195940300822258, -0.44860267639160156, -0.07081670314073563, -0.0066617075353860855, -0.07421217113733292, -0.037531718611717224, -0.29932722449302673, -0.10869010537862778, -0.1168544664978981, -0.17825964093208313, 0.16137072443962097, 0.01745869219303131, 0.2656540274620056, -0.11894276738166809, 0.24830172955989838, -0.19648385047912598, 0.24158456921577454, -0.1489771157503128, 0.20610034465789795, 0.29437607526779175, -0.042100924998521805, -0.07964077591896057, -0.04376403987407684, -0.13044068217277527, 0.2619667053222656, 0.004848986864089966, 0.15409353375434875, 0.06335530430078506, -0.015509411692619324, 0.06764042377471924, -0.06038511171936989, -0.045673005282878876, -0.17656275629997253, -0.00736406072974205, 0.05761483684182167, -0.028632350265979767, -0.08347078412771225, -0.16310131549835205, 0.1054891049861908, 0.4220443665981293, 0.07594622671604156, 0.23963326215744019, 0.47732609510421753, 0.019119609147310257, -0.12171918898820877, -0.04365856945514679, 0.7396148443222046, 0.5237141847610474, 0.24326154589653015, -0.045753929764032364, -0.30144602060317993, -0.09414520114660263, -0.2293175309896469, 0.3014172315597534, 0.08611704409122467, -0.2357880175113678, 0.10900814831256866, -0.057832248508930206, -0.11935035139322281, -0.09552657604217529, -0.08685566484928131, -0.11511219292879105, 0.02690039947628975, -0.14552070200443268, -0.19634880125522614, 0.1285768300294876, 0.086868055164814, -0.1744266301393509, 0.1472814977169037, -0.21668535470962524, -0.18102727830410004, 0.0921304002404213, 0.3635755777359009, -0.12000900506973267, -0.10426570475101471, 0.031240444630384445, 0.5166977643966675, -0.1882738322019577, -0.1981901079416275, -0.09563994407653809, 0.03268595412373543, 0.0891495943069458, 0.09829923510551453, 0.2639807164669037, -0.17235596477985382, 0.6056514382362366, -0.04080196097493172, 0.07532182335853577, -0.3483291268348694, 0.07283354550600052, -0.23181605339050293, 0.03513636812567711, 0.4599442183971405, 0.08905226737260818, 0.34313464164733887, 0.040314555168151855, -0.07216894626617432, 0.06804889440536499, 0.01530141569674015, -0.07315670698881149, -0.23252986371517181, 0.10924475640058517, -0.07149629294872284, -0.1155116856098175, 0.08927641063928604, -0.2855163812637329, -0.48827192187309265, 0.41492801904678345, 0.011528793722391129, 0.16275864839553833, -0.19065123796463013, 0.22059613466262817, -0.06751416623592377, 0.18435700237751007, 0.08328877389431, 0.009857955388724804, -0.45950767397880554, 0.2759060561656952, -0.296865314245224, -0.19560666382312775, -0.003069959580898285, 0.14572790265083313, -0.0902349203824997, 0.20759080350399017, -0.31093472242355347, 0.0006326176226139069, -0.435100257396698, 0.14725613594055176, 0.001787569373846054, 0.3197997510433197, 0.3340808153152466, 0.1123838797211647, -0.05174720287322998, 0.23307451605796814, -0.3816717565059662, 0.07221290469169617, 0.09723346680402756, 0.14674246311187744, 0.10486191511154175, 0.4488649368286133, 0.12696325778961182, 0.7270856499671936, 0.004457391798496246, 0.05572204291820526, 0.14463616907596588, 0.1836109608411789, 0.17067715525627136, -0.09506513923406601, -0.19873546063899994, 0.2393403798341751, -0.0258026123046875, -0.21674606204032898, 0.008101329207420349, -0.09338899701833725, 0.13222691416740417, 0.2868739068508148, -0.3353421092033386, 0.15722811222076416, -0.2894893288612366, 0.3749530613422394, 0.04460107162594795, 0.28399857878685, -0.3138514757156372, -0.22321996092796326, -0.3078226149082184, -0.17343077063560486, -0.2959786355495453, 0.37282878160476685, 0.1245008111000061, -0.08782307058572769, -0.12681175768375397, 0.13126926124095917, -0.7616198658943176, 0.14048434793949127, 0.050106946378946304, -0.0011398335918784142, -0.04053540527820587, -0.1913866400718689, 0.16696742177009583, 0.19807052612304688, 0.6697563529014587, -0.16778281331062317, -0.1513185203075409, 0.08177818357944489, -0.11831825226545334, -0.2594492733478546, 0.0300416462123394, 0.08681923151016235, 0.09836051613092422, -0.02059788629412651, 0.211100772023201, -0.09864474087953568, -0.031058751046657562, 0.14979150891304016, 0.09396608173847198, -0.16779391467571259, -0.3224251866340637, 0.0066184960305690765, -0.06342080235481262, -0.3528912365436554, 0.2599160373210907, 0.34176793694496155, 0.05650315061211586, -0.21746452152729034, 0.1656908094882965, -0.16227534413337708, -0.08304676413536072, 0.2288682758808136, -0.06724372506141663, 0.26976466178894043, -0.2312767207622528, 0.23192772269248962, -0.4209913909435272, -0.2923598289489746, 0.24746613204479218, -0.17452390491962433, -0.3954790532588959, 0.04666353017091751, -0.0652385801076889, -0.028371751308441162, 0.2581401765346527, 0.299358069896698, -0.08546752482652664, 0.17843155562877655, -0.048065751791000366, 0.24240462481975555, -0.44041207432746887, -0.2571854591369629, -0.00796680897474289, -0.2087154984474182, -0.35712671279907227, -0.22784040868282318, 0.4524223208427429, 0.053822536021471024, 0.002557508647441864, 0.09889747202396393, 0.14100709557533264, -0.35650190711021423, 0.46709489822387695, 0.22050926089286804, 0.882439911365509, -0.03464280068874359, 0.6052799224853516, -0.17812243103981018, 0.04631964862346649, -0.17045246064662933, 0.09891600906848907, 0.07924652099609375, -0.2877946197986603, -0.009170142002403736, 0.1404329389333725, -0.09591172635555267, 0.14744505286216736, 0.1107219010591507, -0.2887924909591675, -0.08689309656620026, -0.011784300208091736, -0.18711264431476593, -0.1700734943151474, 0.23554491996765137, -0.5055404305458069, -0.4020981788635254, -0.027243755757808685, 0.17338068783283234, 0.0902537852525711, -0.40993446111679077, 0.08497652411460876, -0.15001985430717468, 0.15738317370414734, -0.11647526919841766, -0.37938374280929565, -0.3259366750717163, -0.17444871366024017, 0.20059393346309662, -0.20929019153118134, -0.351235032081604, 0.29373860359191895, 0.29529455304145813, 0.45955657958984375, 0.360052227973938, -0.09703367203474045, 0.0356166735291481, 0.0711766853928566, 0.1792953610420227, 0.10729844868183136, -0.18977589905261993, 0.2448703497648239, -0.023765910416841507, -0.07663054764270782, -0.023432321846485138, 0.1663472056388855, -0.4879135489463806, -0.4171101748943329, 0.06299879401922226, 0.11109469830989838, -0.19398115575313568, -0.4861151874065399, -0.23459979891777039, -0.22280021011829376, -0.07117822766304016, 0.21293696761131287, 0.37726670503616333, 0.040741175413131714, 0.6749993562698364, -0.3576521873474121, -0.052940674126148224, -0.18257911503314972, 0.26520246267318726, 0.0828242301940918, -0.0919177234172821, 0.09626409411430359, -0.19448325037956238, -0.1614377200603485, -0.20483067631721497, 0.17771869897842407, -0.23473027348518372, -0.012115612626075745, 0.5112614035606384, 0.011773278005421162, -0.0007118582725524902, -0.1809483915567398, 0.053686127066612244, 0.06693291664123535, 0.026862654834985733, -0.20862643420696259, -0.00038839131593704224, -0.3570917546749115, 0.006019853055477142, 0.0313117615878582, 0.47913575172424316, -0.03212222829461098, -0.0735924243927002, -0.026111863553524017, 0.07176662981510162, -0.3823256492614746, 0.06212317943572998, 0.14218279719352722, -0.05545759201049805, 0.26662275195121765, 0.14645661413669586, 0.13992726802825928, -0.060796141624450684, 0.002317149192094803, 0.22049778699874878, -0.14221511781215668, -0.2848784327507019, -0.21335884928703308, 0.09180539101362228, -0.1750517189502716, 0.10367914289236069, 0.10559920966625214, -0.209806427359581, -0.10160328447818756, -0.2049647569656372, 0.19725634157657623, 0.37854424118995667, -0.238973930478096, 0.03932114690542221, 0.27791664004325867, 0.10183728486299515, 0.15099138021469116, 0.21165184676647186, 0.0016813427209854126, 0.01866936683654785, -0.019895896315574646, 0.3364908695220947, -0.1706216037273407, -0.09647565335035324, 0.0035647829063236713, 0.08781765401363373, 0.13143415749073029, 0.14478178322315216, -0.038539253175258636, 0.06068447232246399, -0.35708126425743103, 0.11735149472951889, 0.33099403977394104, -0.05506107211112976, -0.19474926590919495, -0.030533581972122192, 0.30249902606010437, 0.31206077337265015, 0.053905293345451355, -0.25336337089538574, 0.17677855491638184, -0.1332913190126419, 0.015144150704145432, 0.18755295872688293, 0.02519867941737175, 0.05319914221763611, -0.1504112333059311, 0.17361649870872498, 0.2493678778409958, -0.5100586414337158, -0.016690069809556007, 0.18856799602508545, 0.06402842700481415, 0.12165281176567078, 0.2836872339248657, 0.12044647336006165, 0.5465453863143921, 0.47463905811309814, 0.03745531663298607, 0.5213939547538757, 0.036298904567956924, -0.1306021362543106, 0.05031171813607216, -0.268176406621933, 0.23440682888031006, -0.07527662813663483, -0.3427914083003998, 0.39240849018096924, 0.010091021656990051, 0.3855288624763489, -0.08051279187202454, 0.04450836777687073, -0.374705046415329, -0.030044112354516983, -0.2568835914134979, -0.3456111550331116, 0.23895281553268433, -0.05699920654296875, 0.0835261195898056, 0.08486731350421906, -0.10398061573505402, -0.07168595492839813, 0.22940987348556519, 0.07681206613779068, 0.2042756974697113, 0.2786433696746826, 0.09847521781921387, 0.0006836391985416412, 0.134996235370636, -0.3642529547214508, -0.3546147048473358, -0.19471795856952667, -0.1368861347436905, -0.058193858712911606, 0.32813119888305664, 0.4996626377105713, 0.2987617254257202, 0.23397651314735413, 0.03573112562298775, 0.005390126258134842, 0.0734056755900383, -0.29202309250831604, -0.03309457376599312, 0.22835081815719604, 0.25282981991767883, 0.0807151347398758, 0.21217845380306244, -0.17886096239089966, -0.03035733476281166, 0.08225719630718231, -0.20195388793945312, -0.27708935737609863, 0.13770578801631927, 0.22348633408546448, -0.5397497415542603, -0.12056893110275269, 0.08121107518672943, -0.2966519296169281, -0.1341203898191452, 0.5850855708122253, -0.16552145779132843, 0.0297902412712574, -0.2749035656452179, 0.11207859218120575, -0.01814255118370056, 0.22374625504016876, -0.0005928054451942444, -0.2543959617614746, -0.42146599292755127, 0.02879747748374939, -0.34599560499191284, -0.1756451427936554, 0.11064931750297546, 0.24803340435028076, 0.0345325767993927, 0.26288971304893494, -0.10991578549146652, -0.03243596851825714, 0.052173860371112823, -0.25347450375556946, -0.43069779872894287, 0.48479360342025757, -0.08130703866481781, -0.007231209427118301, 0.133920356631279, -0.2587222158908844, 0.2888546288013458, -0.33730754256248474, 0.20764395594596863, 0.005380475893616676, 0.11004797369241714, -0.3636627793312073, 0.33056676387786865, 0.41724035143852234, 0.044185616075992584, 0.20704106986522675, -0.05230972170829773, -0.05203104019165039, -0.11623982340097427, -0.19656670093536377, -0.1011526882648468, 0.2542453706264496, -0.1824263632297516, -0.22837623953819275, 0.1728820502758026, 0.5438421964645386, -0.397937148809433, -0.1186394989490509, -0.18548768758773804, 0.21814581751823425, -0.14308404922485352, -0.12655207514762878, 0.14352545142173767, -0.05337221175432205, 0.1641128957271576, 0.07754330337047577, 0.16229335963726044, 0.24305325746536255, -0.06920754909515381, 0.34448933601379395, -0.3540254235267639, -0.34352898597717285, 0.17909124493598938, -0.08546503633260727, -0.059756286442279816, -0.24511446058750153, 0.32890307903289795, -0.15607118606567383, 0.07558976113796234, -0.41462716460227966, -0.09055468440055847, 0.1136866956949234, 0.046050749719142914, -0.05597947910428047, 0.5045402646064758, 0.0071005625650286674, 0.15213070809841156, -0.03729885444045067, 0.24107509851455688, -0.1131930872797966, -0.07714904099702835, -0.1659940630197525, -0.42231571674346924 ]
https://github.com/huggingface/datasets/issues/6422
Allow to choose the `writer_batch_size` when using `save_to_disk`
Thank you for your answer! From what I am reading in `https://github.com/huggingface/datasets/blob/2.14.5/src/datasets/arrow_dataset.py`, every function involved (`select`, `shard`, ...) has a default hardcoded batch size of 1000, as such: ```python def select( self, indices: Iterable, keep_in_memory: bool = False, indices_cache_file_name: Optional[str] = None, writer_batch_size: Optional[int] = 1000, new_fingerprint: Optional[str] = None, ) -> "Dataset": ... ``` Then, `ArrowWriter` is instantiated with the specified `writer_batch_size`. In `ArrowWriter`, `writer_batch_size` is set to `datasets.config.DEFAULT_MAX_BATCH_SIZE` if it is `None`(https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L345C14-L345C31). However, in our case, it is already set to 1000 by "parent" methods, so it won't happen. Nevertheless, due to this: ```python def _save_to_disk_single(job_id: int, shard: "Dataset", fpath: str, storage_options: Optional[dict]): batch_size = config.DEFAULT_MAX_BATCH_SIZE ... ``` it seems to work. I will use it as such, but it should maybe be added to documentation? And maybe improved in next versions?
### Feature request Add an argument in `save_to_disk` regarding batch size, which would be passed to `shard` and other methods. ### Motivation The `Dataset.save_to_disk` method currently calls `shard` without passing a `writer_batch_size` argument, thus implicitly using the default value (1000). This can result in RAM saturation when using a lot of processes on long text sequences or other modalities, or for specific IO configs. ### Your contribution I would be glad to submit a PR, as long as it does not imply extensive tests refactoring.
134
Allow to choose the `writer_batch_size` when using `save_to_disk` ### Feature request Add an argument in `save_to_disk` regarding batch size, which would be passed to `shard` and other methods. ### Motivation The `Dataset.save_to_disk` method currently calls `shard` without passing a `writer_batch_size` argument, thus implicitly using the default value (1000). This can result in RAM saturation when using a lot of processes on long text sequences or other modalities, or for specific IO configs. ### Your contribution I would be glad to submit a PR, as long as it does not imply extensive tests refactoring. Thank you for your answer! From what I am reading in `https://github.com/huggingface/datasets/blob/2.14.5/src/datasets/arrow_dataset.py`, every function involved (`select`, `shard`, ...) has a default hardcoded batch size of 1000, as such: ```python def select( self, indices: Iterable, keep_in_memory: bool = False, indices_cache_file_name: Optional[str] = None, writer_batch_size: Optional[int] = 1000, new_fingerprint: Optional[str] = None, ) -> "Dataset": ... ``` Then, `ArrowWriter` is instantiated with the specified `writer_batch_size`. In `ArrowWriter`, `writer_batch_size` is set to `datasets.config.DEFAULT_MAX_BATCH_SIZE` if it is `None`(https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L345C14-L345C31). However, in our case, it is already set to 1000 by "parent" methods, so it won't happen. Nevertheless, due to this: ```python def _save_to_disk_single(job_id: int, shard: "Dataset", fpath: str, storage_options: Optional[dict]): batch_size = config.DEFAULT_MAX_BATCH_SIZE ... ``` it seems to work. I will use it as such, but it should maybe be added to documentation? And maybe improved in next versions?
[ -0.45306676626205444, -0.10187312215566635, 0.004923377186059952, 0.059071000665426254, 0.054249107837677, -0.09289413690567017, 0.3411106765270233, 0.13401758670806885, -0.17516401410102844, 0.23810960352420807, 0.20967544615268707, 0.07316288352012634, -0.35989850759506226, 0.14290834963321686, 0.07427020370960236, -0.04007488489151001, -0.013588108122348785, -0.031116724014282227, 0.09774653613567352, 0.14091330766677856, -0.27193784713745117, 0.16300655901432037, -0.0007355734705924988, -0.14165043830871582, -0.20352724194526672, -0.012424388900399208, 0.11872154474258423, 0.10953032225370407, -0.17624951899051666, -0.3793947398662567, 0.12910473346710205, 0.19089244306087494, 0.25690147280693054, 0.1466156244277954, -0.0001178411694127135, -0.14627087116241455, 0.36276042461395264, -0.279098242521286, -0.41889145970344543, -0.040114134550094604, -0.06359951943159103, -0.22566591203212738, 0.015738019719719887, -0.35903501510620117, 0.20145893096923828, 0.007404795847833157, 0.232001394033432, -0.15977057814598083, 0.14663366973400116, 0.09340999275445938, 0.20365597307682037, 0.15672877430915833, -0.013312991708517075, -0.04397270455956459, 0.2864333987236023, 0.565453290939331, -0.32695284485816956, 0.07571542263031006, 0.13552236557006836, 0.18820489943027496, -0.29632505774497986, 0.24456317722797394, 0.018149150535464287, -0.04417626932263374, 0.3535664677619934, 0.14819985628128052, 0.235725998878479, -0.09904825687408447, 0.2162330448627472, 0.2120661437511444, 0.3638293147087097, -0.5132628679275513, -0.4135499596595764, -0.3123790919780731, 0.0013515835162252188, -0.39335495233535767, -0.05183149129152298, 0.24180328845977783, -0.3728879690170288, -0.023784589022397995, -0.17016124725341797, -0.29481375217437744, -0.2415369302034378, -0.13292989134788513, 0.41800493001937866, -0.2036679983139038, -0.34382784366607666, 0.01060079038143158, 0.4825285077095032, -0.03951790928840637, 0.09930472075939178, -0.23996779322624207, -0.11463844776153564, -0.020001161843538284, -0.3087065815925598, -0.06010846048593521, -0.00665215402841568, 0.2530299127101898, 0.2930012345314026, 0.2527163326740265, 0.1871579885482788, -0.14510035514831543, 0.2894243597984314, -0.006230682134628296, 0.030357083305716515, 0.16896528005599976, 0.39413174986839294, -0.10980343073606491, 0.07842378318309784, 0.01703544519841671, 0.38424697518348694, 0.020952314138412476, 0.33869674801826477, -0.39675062894821167, 0.6198194622993469, -0.27212128043174744, 0.23486419022083282, 0.04017722234129906, 0.060126736760139465, 0.09150771051645279, 0.3219810128211975, -0.12130936235189438, 0.009805815294384956, 0.3766140639781952, 0.09609773755073547, -0.0682334378361702, -0.09823262691497803, 0.11764924973249435, -0.01734958216547966, 0.06895667314529419, -0.18642766773700714, -0.0894174873828888, 0.15741614997386932, 0.11671453714370728, 0.20120109617710114, -0.0579218827188015, 0.11690356582403183, -0.11620333790779114, 0.2754729688167572, 0.19513508677482605, 0.030688298866152763, -0.186991885304451, 0.30352795124053955, 0.3075616657733917, -0.061783622950315475, 0.11402354389429092, -0.21355311572551727, -0.04581534489989281, -0.2477264702320099, 0.44477468729019165, -0.08378029614686966, -0.4755197763442993, -0.1266089677810669, 0.09010156989097595, -0.04825481027364731, 0.05301520228385925, -0.8855423331260681, 0.048063404858112335, 0.3660002648830414, 0.10322695970535278, 0.17468342185020447, -0.2596284747123718, -0.2366848737001419, -0.5514508485794067, 0.24643102288246155, 0.35533368587493896, -0.10222861170768738, -0.06461019068956375, -0.29226258397102356, -0.11015625298023224, 0.17198693752288818, 0.26815956830978394, -0.06977491825819016, -0.20226681232452393, -0.11915744096040726, 0.41336435079574585, 0.4177938997745514, -0.042022597044706345, -0.4729042649269104, 0.1895241141319275, -0.09113696962594986, -0.09528220444917679, 0.455546110868454, 0.18317650258541107, 0.4098994731903076, -0.1880856454372406, 0.1991967111825943, 0.3282220959663391, -0.068657286465168, 0.18042662739753723, -0.4000811278820038, -0.4918177127838135, -0.46315842866897583, 0.045193593949079514, 0.006912317126989365, -0.07952212542295456, 0.009917058050632477, -0.3118094503879547, 0.3858053982257843, 0.03396314010024071, 0.42837387323379517, 0.18180420994758606, 0.46263784170150757, -0.33342885971069336, -0.08315794169902802, 0.0015109367668628693, -0.4732656478881836, 0.10657493025064468, -0.036772213876247406, -0.37679633498191833, -0.02486509084701538, -0.3269754648208618, 0.054352231323719025, 0.08206634223461151, 0.03984098881483078, 0.1598786562681198, 0.019211720675230026, 0.0081668421626091, 0.11205153167247772, 0.01804530620574951, -0.06898445636034012, -0.00045101530849933624, -0.46144747734069824, 0.043000612407922745, -0.13869737088680267, -0.10483977198600769, 0.12124212831258774, -0.36720630526542664, -0.17357096076011658, -0.14737677574157715, -0.1669192612171173, 0.04346821829676628, 0.010890454053878784, 0.41479361057281494, -0.09051502496004105, 0.2942729592323303, -0.2271268665790558, 0.12219569087028503, -0.17692144215106964, 0.07357189059257507, 0.21669651567935944, -0.09572701156139374, -0.03355900198221207, 0.06553340703248978, -0.25861164927482605, 0.26241832971572876, -0.12475822865962982, 0.275428831577301, 0.08025047183036804, -0.08476784825325012, -0.07375414669513702, 0.10088670253753662, -0.06046360731124878, -0.1898917853832245, -0.13599811494350433, 0.05535484105348587, 0.17424112558364868, 0.027788516134023666, -0.20869652926921844, 0.1331835389137268, 0.39268970489501953, 0.10813228785991669, 0.2398930788040161, 0.46541956067085266, -0.09948510676622391, -0.1690288782119751, 0.05942846089601517, 0.6300264596939087, 0.6138898730278015, 0.20277287065982819, -0.03303913399577141, -0.4044078588485718, 0.0023542651906609535, -0.20015016198158264, 0.38690194487571716, 0.029936525970697403, -0.045207154005765915, 0.09259653091430664, -0.06397222727537155, -0.17334632575511932, -0.2477971315383911, 0.10922104120254517, -0.04929275065660477, -0.08984845131635666, -0.2290482372045517, -0.13443990051746368, 0.1509695053100586, 0.27761802077293396, -0.2097872495651245, 0.031138844788074493, -0.0661056637763977, -0.20685790479183197, 0.0104542076587677, 0.38718679547309875, -0.1455213725566864, -0.013802807778120041, -0.16699431836605072, 0.46281421184539795, -0.18112505972385406, -0.37343478202819824, -0.11025278270244598, 0.0946694165468216, 0.07916199415922165, 0.02807164564728737, 0.23695160448551178, -0.1569862961769104, 0.44353947043418884, 0.09369004517793655, 0.041435178369283676, -0.43671905994415283, 0.051411084830760956, -0.19660814106464386, -0.05449311435222626, 0.41394737362861633, 0.12044582515954971, 0.33520960807800293, -0.10222817957401276, -0.05558015778660774, 0.10410784929990768, 0.05167493224143982, -0.153528094291687, -0.23253075778484344, 0.010285238735377789, 0.037226226180791855, -0.1338830292224884, 0.13700748980045319, -0.24030758440494537, -0.39235469698905945, 0.5711014270782471, 0.04860478267073631, 0.1756463348865509, -0.046186476945877075, 0.1560349464416504, -0.01340487040579319, 0.06393610686063766, 0.11481048911809921, -0.02434825897216797, -0.37880855798721313, 0.30081117153167725, -0.2871308922767639, -0.13140074908733368, -0.07275141775608063, 0.06890302896499634, -0.013847094029188156, 0.18832999467849731, -0.3372423052787781, -0.057664502412080765, -0.42068666219711304, 0.08700805902481079, -0.002527177333831787, 0.4436231255531311, 0.4498935341835022, 0.18226855993270874, -0.008407264947891235, 0.14295589923858643, -0.32669103145599365, 0.2253025472164154, 0.08552753180265427, 0.28714343905448914, 0.2170669436454773, 0.31831124424934387, 0.14039523899555206, 0.9834317564964294, 0.22560790181159973, 0.049773674458265305, 0.21091914176940918, 0.13546492159366608, 0.2574143409729004, -0.20072802901268005, -0.1461365520954132, 0.23265999555587769, -0.16751223802566528, -0.01895376294851303, -0.05768005549907684, -0.12397956103086472, 0.24464672803878784, 0.38892993330955505, -0.26499348878860474, 0.03916851431131363, -0.40715861320495605, 0.43542441725730896, -0.08018714189529419, 0.14527007937431335, -0.28384312987327576, -0.1480136215686798, -0.25934121012687683, -0.11239489167928696, -0.17161719501018524, 0.24199818074703217, 0.18213024735450745, -0.025210430845618248, -0.08037155121564865, 0.24502988159656525, -0.8326386213302612, 0.24817612767219543, -0.029077304527163506, -0.04107220098376274, 0.1517796665430069, -0.28025707602500916, 0.18836334347724915, 0.07419122010469437, 0.5120726227760315, -0.04979316145181656, -0.17016105353832245, -0.09720563888549805, -0.08147776126861572, -0.5407683253288269, 0.08499206602573395, 0.051651667803525925, 0.2056068480014801, -0.28568729758262634, 0.0953110083937645, -0.4218766987323761, -0.1506885439157486, 0.16021429002285004, 0.07646356523036957, -0.07942180335521698, -0.16937071084976196, 0.005365993827581406, -0.06247498840093613, -0.28244107961654663, 0.26704832911491394, 0.24263323843479156, 0.13597089052200317, -0.14783935248851776, 0.233167365193367, -0.19997310638427734, -0.2102457582950592, 0.07469213753938675, -0.15567874908447266, 0.39817503094673157, -0.19008980691432953, 0.2055581659078598, -0.1772570013999939, -0.0973423570394516, 0.45013490319252014, 0.19317826628684998, -0.4575483202934265, -0.06262238323688507, 0.002023497596383095, 0.013600132428109646, 0.3570789396762848, 0.45031511783599854, -0.2282206416130066, 0.19734659790992737, 0.10431207716464996, 0.18130698800086975, -0.32505500316619873, -0.28980743885040283, 0.06078682839870453, -0.2669949233531952, -0.17878103256225586, -0.0373542383313179, 0.564068078994751, 0.12970541417598724, -0.01455080509185791, 0.33529216051101685, 0.49663954973220825, -0.3263477087020874, 0.34479302167892456, 0.28442156314849854, 0.9122339487075806, 0.12686783075332642, 0.5766199231147766, -0.16663092374801636, -0.05210017412900925, -0.2058565765619278, 0.26290398836135864, -0.003195159137248993, -0.2879732549190521, 0.06962837278842926, 0.195438414812088, -0.08890633285045624, 0.05616782605648041, 0.1400884985923767, -0.17045657336711884, -0.10770611464977264, -0.11882705241441727, -0.14111298322677612, -0.23180894553661346, 0.20263557136058807, -0.6039839386940002, -0.5135987401008606, -0.09896189719438553, 0.058752357959747314, 0.10242987424135208, -0.29095032811164856, 0.13490119576454163, -0.17797844111919403, 0.04514430835843086, -0.3213317394256592, -0.3270973563194275, -0.27521422505378723, -0.5325656533241272, 0.14111149311065674, -0.017132658511400223, -0.4250738024711609, 0.2908090353012085, 0.3040628433227539, 0.28369322419166565, 0.16973833739757538, -0.15354245901107788, 0.015389988198876381, 0.016281019896268845, 0.2660944163799286, 0.040636997669935226, -0.31823983788490295, 0.21937195956707, 0.11353125423192978, 0.008277326822280884, -0.014026068150997162, -0.013236251659691334, -0.4497719407081604, -0.1849181056022644, 0.05402345955371857, -0.0852741003036499, -0.1771070808172226, -0.6211732029914856, -0.22315073013305664, -0.29678526520729065, -0.0466158352792263, 0.10478225350379944, 0.33596259355545044, 0.13385170698165894, 0.49534356594085693, -0.33452391624450684, -0.05982750281691551, -0.12194442749023438, 0.32428333163261414, -0.0059090107679367065, -0.05716288834810257, 0.34229564666748047, -0.28558969497680664, -0.0575021430850029, -0.10453857481479645, 0.22144266963005066, 0.20664702355861664, -0.3631868362426758, 0.5074688792228699, 0.11707096546888351, 0.023418396711349487, -0.09942404180765152, 0.22918716073036194, 0.08850331604480743, 0.1234629899263382, -0.33561983704566956, 0.024559132754802704, -0.37395524978637695, 0.265325129032135, -0.05723843351006508, 0.4660065770149231, -0.08259811997413635, -0.22498807311058044, -0.006010565906763077, 0.1817016750574112, -0.29965972900390625, 0.11852499097585678, 0.1733669936656952, -0.01512749120593071, 0.20118500292301178, 0.1934967339038849, 0.37317928671836853, -0.033031854778528214, -0.07264701277017593, 0.24265511333942413, -0.21082286536693573, -0.186065673828125, -0.23561549186706543, 0.11877948045730591, -0.07286037504673004, 0.012104514986276627, 0.016530197113752365, -0.26373612880706787, -0.09772109985351562, -0.2513132691383362, 0.2978709936141968, 0.29733824729919434, -0.22273312509059906, -0.09014792740345001, 0.34982505440711975, 0.06958454847335815, 0.01973804458975792, 0.1144246831536293, -0.0570119172334671, 0.09429770708084106, -0.04499237984418869, 0.3160054683685303, -0.14418622851371765, -0.1471439003944397, 0.04038248956203461, 0.13183146715164185, 0.2106524109840393, 0.17966151237487793, -0.1927550733089447, -0.03498709946870804, -0.5035116672515869, -0.09783502668142319, 0.37717553973197937, 0.1441342979669571, -0.08310400694608688, -0.10737799853086472, 0.09649350494146347, 0.21531009674072266, 0.08196740597486496, -0.18739308416843414, -0.0006680171936750412, -0.13418805599212646, 0.02692844346165657, 0.2828211188316345, -0.020936626940965652, 0.1034616231918335, -0.024511970579624176, 0.12792468070983887, -0.017043206840753555, -0.48182862997055054, 0.0013676963280886412, 0.29104071855545044, 0.06758373975753784, 0.11185561865568161, 0.4474762976169586, 0.14821432530879974, 0.6987134218215942, 0.3349679112434387, -0.15039223432540894, 0.512401282787323, 0.12022417038679123, -0.10361303389072418, 0.12842203676700592, -0.39179325103759766, 0.12905271351337433, -0.10318338871002197, -0.2396751344203949, 0.3351060748100281, 0.06124667078256607, 0.6317186951637268, -0.03498189523816109, -0.025171617045998573, -0.28337037563323975, 0.004582013934850693, -0.260666161775589, -0.5054053664207458, -0.03796791285276413, -0.09230776131153107, 0.05764055252075195, 0.077752023935318, -0.25205540657043457, -0.22088448703289032, 0.37745538353919983, -0.02800803631544113, 0.20398879051208496, 0.08861237019300461, 0.01830427534878254, 0.13040876388549805, 0.1761167347431183, -0.288277268409729, -0.04524063318967819, -0.02027641236782074, -0.13177695870399475, -0.12104372680187225, 0.402233362197876, 0.43454331159591675, 0.211952805519104, 0.2465369999408722, -0.004646997898817062, 0.1570402830839157, 0.022833911702036858, -0.2560170292854309, -0.0388500839471817, 0.2442718893289566, -0.05889078602194786, 0.15696878731250763, 0.13444142043590546, -0.17455044388771057, -0.04559860751032829, 0.10809297859668732, -0.08239981532096863, -0.1880289763212204, 0.13490842282772064, 0.07538656890392303, -0.5534675717353821, -0.07761123031377792, 0.09366672486066818, -0.19886651635169983, -0.08400297909975052, 0.5521769523620605, -0.16628636419773102, 0.025731049478054047, -0.2636163532733917, 0.059842973947525024, 0.055140186101198196, 0.4157383441925049, 0.06249796226620674, -0.3266477882862091, -0.4197821021080017, 0.07850801944732666, -0.31951382756233215, -0.2562510669231415, 0.04912390932440758, 0.29853978753089905, 0.03129234537482262, 0.32912999391555786, 0.03855397179722786, 0.0012995637953281403, 0.2066088169813156, -0.017142845317721367, -0.20234104990959167, 0.5144085884094238, -0.08786952495574951, 0.05986953526735306, 0.3417541980743408, -0.1718990057706833, 0.2759658992290497, -0.39888685941696167, 0.15771353244781494, 0.05698082968592644, -0.0223633274435997, -0.3445320725440979, 0.31360235810279846, 0.3589508831501007, -0.03542621433734894, 0.3624971807003021, -0.07844360917806625, -0.13157781958580017, -0.07867495715618134, -0.2903759479522705, -0.08008325099945068, 0.27158546447753906, -0.16946829855442047, -0.14801186323165894, 0.2461419552564621, 0.7021610736846924, -0.3369838297367096, -0.17782460153102875, -0.23160956799983978, 0.15373019874095917, -0.09519565105438232, -0.13862863183021545, 0.15840332210063934, 0.07284219563007355, 0.00202970951795578, 0.0867290198802948, 0.13481755554676056, 0.26495859026908875, -0.03755214810371399, 0.31680551171302795, -0.421444833278656, -0.4320560097694397, 0.3350280523300171, -0.09439481049776077, 0.057133663445711136, -0.07141288369894028, 0.35124140977859497, 0.04607594013214111, -0.06122647970914841, -0.5044710040092468, 0.009009942412376404, 0.1008102297782898, -0.0006307847797870636, -0.12079921364784241, 0.28594890236854553, -0.016057459637522697, 0.2532142996788025, -0.10067622363567352, 0.467242956161499, -0.09553011506795883, -0.07401181757450104, -0.24753162264823914, -0.4644656181335449 ]
https://github.com/huggingface/datasets/issues/6417
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error
Very strange: `datasets-cli env` > > Copy-and-paste the text below in your GitHub issue. > > - `datasets` version: 2.9.0 > - Platform: macOS-14.0-arm64-arm-64bit > - Python version: 3.9.13 > - PyArrow version: 8.0.0 > - Pandas version: 1.3.5 After updating datasets and pyarrow on base environment, although I am using a different one called layoutLM > Copy-and-paste the text below in your GitHub issue. > > - `datasets` version: 2.14.6 > - Platform: macOS-14.0-arm64-arm-64bit > - Python version: 3.9.18 > - Huggingface_hub version: 0.17.3 > - PyArrow version: 14.0.1 > - Pandas version: 2.1.3
### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0
95
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error ### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0 Very strange: `datasets-cli env` > > Copy-and-paste the text below in your GitHub issue. > > - `datasets` version: 2.9.0 > - Platform: macOS-14.0-arm64-arm-64bit > - Python version: 3.9.13 > - PyArrow version: 8.0.0 > - Pandas version: 1.3.5 After updating datasets and pyarrow on base environment, although I am using a different one called layoutLM > Copy-and-paste the text below in your GitHub issue. > > - `datasets` version: 2.14.6 > - Platform: macOS-14.0-arm64-arm-64bit > - Python version: 3.9.18 > - Huggingface_hub version: 0.17.3 > - PyArrow version: 14.0.1 > - Pandas version: 2.1.3
[ -0.12534506618976593, -0.6960603594779968, 0.06675899028778076, 0.31610435247421265, 0.3677387833595276, -0.2172713279724121, 0.5709386467933655, 0.08089055866003036, -0.18083731830120087, -0.04032093286514282, -0.07140607386827469, 0.6541167497634888, -0.0781998410820961, 0.20544643700122833, -0.13464465737342834, -0.21977421641349792, 0.11867936700582504, 0.04870546981692314, -0.27933552861213684, -0.0983457863330841, -0.24747493863105774, 0.36471736431121826, -0.31691497564315796, 0.14043858647346497, -0.13122417032718658, -0.04667344689369202, 0.07013525813817978, -0.006347686052322388, -0.007894720882177353, -0.1661829948425293, 0.33295074105262756, -0.34380170702934265, 0.09941370785236359, 0.1848178505897522, -0.00012145262735430151, -0.03654617443680763, 0.4414541721343994, -0.008131716400384903, -0.09745022654533386, -0.09651198983192444, 0.09714221209287643, -0.21189159154891968, 0.253510981798172, -0.2662363052368164, -0.10398901253938675, 0.007917743176221848, -0.528936505317688, -0.2778090834617615, 0.4964022636413574, 0.3365887403488159, 0.15733136236667633, 0.39866477251052856, 0.09910599887371063, -0.10035814344882965, 0.6133679151535034, 0.45614397525787354, -0.34079158306121826, 0.36632269620895386, 0.23519572615623474, -0.028368454426527023, 0.2728925347328186, 0.48420706391334534, -0.1933595836162567, 0.12886954843997955, 0.3461790978908539, 0.2166592925786972, -0.03984852880239487, 0.019346462562680244, -0.12752765417099, 0.30198508501052856, 0.237193763256073, -0.3270745575428009, -0.2531386613845825, -0.37092188000679016, 0.01962333172559738, -0.4381139874458313, 0.31141358613967896, 0.011742479167878628, -0.130360946059227, -0.0214107446372509, -0.21591930091381073, 0.03575238585472107, -0.34416666626930237, 0.12440342456102371, 0.015376575291156769, 0.32715386152267456, -0.3175138235092163, 0.13804051280021667, -0.1114540845155716, -0.030133813619613647, 0.2301262766122818, 0.2110554426908493, -0.01189165934920311, -0.07308705151081085, -0.17842718958854675, -0.038462236523628235, -0.1027686819434166, -0.17662787437438965, 0.004212636500597, -0.12136498093605042, 0.04474754258990288, -0.19944024085998535, 0.3090401291847229, 0.021742504090070724, -0.1182149201631546, 0.32300904393196106, 0.03924592211842537, 0.24495385587215424, 0.09794576466083527, 0.21658022701740265, 0.30306899547576904, -0.040462225675582886, -0.008604969829320908, -0.16112269461154938, -0.29502996802330017, 0.04039725661277771, 0.44665688276290894, 0.011044908314943314, -0.2988698184490204, 0.19922307133674622, -0.23719197511672974, 0.04368872568011284, 0.043480727821588516, 0.3199760913848877, 0.020674727857112885, -0.013129506260156631, 0.09933868050575256, 0.23359011113643646, -0.306007444858551, 0.18282851576805115, 0.023083090782165527, 0.1466054767370224, -0.2768853008747101, -0.17735759913921356, -0.14081265032291412, 0.3085518181324005, 0.08264961838722229, -0.07189029455184937, -0.18546245992183685, 0.07684820890426636, -0.23436997830867767, 0.18289679288864136, 0.27133041620254517, 0.19087541103363037, -0.3392235040664673, 0.0022310223430395126, -0.017079878598451614, 0.2504510283470154, -0.18041245639324188, 0.10067789256572723, -0.17757204174995422, -0.14915044605731964, -0.34003689885139465, 0.07882311940193176, -0.25863468647003174, 0.0852714478969574, -0.2883617579936981, 0.10571722686290741, -0.021334372460842133, 0.13276052474975586, 0.4869846701622009, -0.19292418658733368, -0.05577734485268593, -0.09742320328950882, 0.2688083052635193, 0.1255897730588913, -0.11502149701118469, -0.29422688484191895, -0.14110781252384186, 0.11133459210395813, 0.15547585487365723, 0.37615081667900085, 0.04414302483201027, -0.037883661687374115, -0.1765688806772232, 0.049533993005752563, 0.394487589597702, -0.452708899974823, -0.5630807280540466, -0.008011928759515285, -0.14294806122779846, 0.04148378223180771, 0.023633964359760284, -0.021918928250670433, -0.1574047952890396, 0.27572739124298096, -0.06347507238388062, 0.4356178045272827, 0.0038285013288259506, 0.051536038517951965, -0.2261921763420105, -0.13279186189174652, 0.22791901230812073, -0.023634621873497963, -0.13603052496910095, -0.25632765889167786, 0.1048794537782669, -0.2988584339618683, 0.14848147332668304, -0.17245997488498688, -0.1274380087852478, 0.1323692351579666, 0.5291131734848022, -0.05682988464832306, 0.1426967978477478, -0.12669536471366882, -0.8501926064491272, 0.008993633091449738, -0.025660555809736252, 0.04298894479870796, -0.27019113302230835, 0.00905705988407135, -0.19500288367271423, 0.14051330089569092, -0.21366874873638153, -0.3861227333545685, -0.017982980236411095, -0.10737287998199463, 0.052379775792360306, -0.005741778761148453, -0.18663224577903748, 0.0405639186501503, 0.007464120164513588, 0.2530505955219269, -0.45828795433044434, 0.2814982533454895, 0.000005943700671195984, -0.3530205488204956, -0.1227162778377533, 0.3778163492679596, 0.004822827875614166, -0.20007947087287903, -0.18731918931007385, 0.3001507818698883, 0.23274405300617218, 0.03586430102586746, -0.2922215163707733, -0.05498921871185303, 0.34518468379974365, -0.3689197301864624, -0.027368342503905296, 0.14702406525611877, 0.06704927980899811, 0.35911092162132263, -0.403346449136734, 0.5544770359992981, -0.06644043326377869, 0.17391237616539001, -0.15052205324172974, 0.3405343294143677, -0.044748298823833466, 0.08824685215950012, -0.12829844653606415, -0.3568283021450043, 0.2587123215198517, 0.2882642149925232, 0.3878120481967926, -0.022545987740159035, -0.13106322288513184, 0.11304189264774323, 0.31306999921798706, -0.0013260133564472198, 0.2666395306587219, 0.11391983181238174, -0.40573951601982117, 0.11362876743078232, 0.43939781188964844, 0.01437220349907875, 0.3231249451637268, 0.053332339972257614, -0.17925989627838135, 0.32240691781044006, -0.12242317944765091, -0.0508023239672184, 0.23256979882717133, -0.00933150202035904, 0.2779373526573181, 0.008430149406194687, 0.3019271790981293, 0.149384006857872, -0.2412199079990387, -0.06631147116422653, -0.11576305329799652, 0.06766754388809204, -0.4863757789134979, 0.01368175633251667, -0.20913860201835632, -0.2462707757949829, -0.1445528119802475, -0.3842095136642456, -0.2303253710269928, -0.013407756574451923, -0.10567295551300049, 0.13073945045471191, -0.030446812510490417, 0.360516756772995, 0.2868971526622772, 0.2851729989051819, 0.27416056394577026, -0.08059713244438171, -0.18203938007354736, -0.13337142765522003, -0.28291434049606323, -0.07664019614458084, 0.10501367598772049, 0.08370031416416168, 0.026246652007102966, -0.08540327847003937, -0.007224131375551224, -0.41613054275512695, -0.6337040066719055, 0.22306044399738312, -0.33539462089538574, 0.39845508337020874, 0.45292627811431885, -0.17412136495113373, 0.011148776859045029, 0.18781974911689758, 0.5270148515701294, 0.017197726294398308, -0.40267297625541687, 0.17506161332130432, 0.03573403134942055, -0.19708088040351868, -0.12016905844211578, -0.10372521728277206, -0.05495500564575195, -0.18533360958099365, 0.6761676669120789, -0.3940763473510742, -0.02733474224805832, 0.3297746777534485, 0.16103148460388184, 0.19279395043849945, -0.1391066610813141, -0.05957784503698349, -0.046951934695243835, 0.37236058712005615, 0.3424871861934662, -0.14806652069091797, -0.261753112077713, -0.2423418164253235, -0.061282847076654434, 0.16320988535881042, 0.20356127619743347, -0.36004412174224854, -0.25766462087631226, -0.47878706455230713, 0.31231454014778137, -0.12855230271816254, 0.13562177121639252, 0.32702121138572693, 0.060885392129421234, 0.18834634125232697, -0.1748056411743164, -0.32148921489715576, 0.25642406940460205, 0.14768880605697632, 0.025034330785274506, 0.1313941925764084, 0.4285263121128082, -0.11590705811977386, 0.2050415426492691, 0.2291432023048401, -0.017827089875936508, 0.3091297745704651, -0.19373342394828796, 0.30828550457954407, -0.12413040548563004, -0.26101022958755493, 0.27619469165802, -0.02553902566432953, -0.10072386264801025, -0.029432684183120728, -0.03553083911538124, -0.0006778156384825706, -0.017551029101014137, -0.12254169583320618, -0.027470845729112625, -0.17841120064258575, -0.07338827848434448, -0.02878076583147049, 0.02629677578806877, -0.2159404158592224, 0.23374074697494507, 0.0003517456352710724, -0.04705997556447983, 0.40236642956733704, 0.01587345451116562, 0.016926757991313934, -0.0008368197595700622, -0.466143399477005, -0.40187668800354004, -0.25948789715766907, 0.3158986568450928, 0.05696747824549675, 0.4691302478313446, -0.034273840487003326, -0.28202444314956665, 0.056439194828271866, 0.07886959612369537, 0.25997331738471985, -0.0817270427942276, -0.11436162889003754, 0.017312414944171906, -0.05934425815939903, -0.42600753903388977, -0.301887184381485, -0.1127411425113678, -0.02761196158826351, 0.045249272137880325, 0.855457603931427, -0.07230634987354279, -0.04765607789158821, 0.17061744630336761, -0.18661457300186157, 0.1315014511346817, -0.23054741322994232, -0.15937654674053192, -0.08812103420495987, -0.044695813208818436, 0.07655007392168045, 0.26703014969825745, 0.039861585944890976, 0.19734884798526764, -0.11832930147647858, -0.1842266172170639, -0.3291718363761902, -0.23950059711933136, 0.3331972658634186, 0.2562544047832489, -0.2115096151828766, 0.10378541052341461, 0.028548162430524826, 0.29201024770736694, 0.28017088770866394, 0.6490309238433838, 0.11834412813186646, -0.8898870944976807, -0.02178620547056198, -0.20390143990516663, 0.4125307500362396, 0.3699437975883484, -0.13044410943984985, -0.013272583484649658, -0.2471320629119873, 0.1234067976474762, -0.1446632295846939, -0.04308117553591728, 0.41048938035964966, 0.220987007021904, 0.21564729511737823, 0.22042231261730194, 0.46600013971328735, 0.10989217460155487, 0.06906743347644806, 0.32544180750846863, 0.01836293935775757, -0.26559504866600037, 0.15802115201950073, 0.3544387221336365, 0.6253800392150879, 0.11413954943418503, 0.15462663769721985, 0.5849329233169556, -0.31790679693222046, 0.49124807119369507, 0.5121310353279114, 0.1963280588388443, -0.4185543656349182, -0.21944032609462738, -0.0037057064473628998, -0.27628931403160095, 0.18027600646018982, -0.32073456048965454, -0.09642603248357773, 0.026056461036205292, -0.02547253668308258, 0.19785626232624054, -0.11078207194805145, -0.05868683010339737, 0.07036947458982468, -0.18929190933704376, -0.518875002861023, -0.02230897545814514, -0.06283546984195709, 0.17362824082374573, 0.0709080770611763, -0.04200449585914612, -0.4873078465461731, -0.300564169883728, -0.40076351165771484, 0.17019036412239075, -0.6829380393028259, -0.11726264655590057, 0.4424041509628296, -0.6239645481109619, 0.08363531529903412, 0.16587340831756592, 0.07737860828638077, -0.09358109533786774, -0.17096631228923798, 0.05606701597571373, 0.3395838439464569, 0.12933191657066345, 0.18834245204925537, -0.26194894313812256, 0.10020186752080917, -0.0552976056933403, 0.18069162964820862, 0.15926215052604675, -0.017400506883859634, 0.002411462366580963, 0.028206780552864075, -0.08800721168518066, 0.13893966376781464, -0.12213702499866486, -0.017336944118142128, -0.41569244861602783, 0.23797065019607544, -0.13953880965709686, -0.00015821680426597595, -0.2167278677225113, -0.038719404488801956, 0.01204836368560791, -0.1686810851097107, -0.30524829030036926, -0.1305018663406372, 0.013389959931373596, -0.23716363310813904, -0.06145911663770676, 0.13001668453216553, 0.4529450535774231, -0.11587785929441452, -0.05017849802970886, 0.21420744061470032, 0.4644377529621124, -0.5296168923377991, 0.06173054873943329, -0.3326200544834137, -0.37486791610717773, -0.022757334634661674, 0.7615775465965271, 0.398811399936676, -0.15083464980125427, 0.03779832646250725, -0.11003167182207108, -0.3412106931209564, 0.2185746431350708, -0.20928244292736053, 0.11530254781246185, 0.017258483916521072, 0.024131476879119873, -0.07387842983007431, -0.16520534455776215, -0.18768347799777985, -0.06989184767007828, 0.2611861526966095, -0.0016179420053958893, -0.005190683528780937, -0.10902904719114304, 0.1347077339887619, -0.04666886478662491, 0.059182390570640564, 0.16988644003868103, 0.009749535471200943, -0.056344058364629745, -0.19875983893871307, 0.12615692615509033, 0.06289593875408173, -0.27076971530914307, -0.09711514413356781, -0.04875645786523819, -0.1611095368862152, -0.3481003940105438, 0.10281252861022949, 0.07572155445814133, 0.02552715316414833, 0.09101532399654388, -0.12447278201580048, -0.1757660210132599, -0.012744953855872154, 0.17341965436935425, -0.0661039650440216, -0.03404971957206726, 0.03806396201252937, 0.1380966305732727, 0.004340099636465311, 0.15124808251857758, -0.012886268086731434, -0.07505113631486893, -0.17658771574497223, 0.12895694375038147, 0.1843489110469818, -0.3119109272956848, -0.2712923586368561, -0.0043252697214484215, 0.30958375334739685, 0.37249255180358887, -0.18981069326400757, -0.24351508915424347, 0.2774919271469116, 0.10312005877494812, -0.30705225467681885, -0.06895487755537033, 0.08008037507534027, 0.17156994342803955, 0.04578794911503792, 0.46865370869636536, 0.15126217901706696, 0.17747533321380615, -0.12751175463199615, 0.15692859888076782, 0.15787464380264282, 0.16691024601459503, 0.13826075196266174, 0.19820868968963623, -0.014045316725969315, 0.19762590527534485, 0.445770800113678, 0.085214763879776, 0.3879314959049225, 0.08608730882406235, 0.1779724657535553, -0.2575433850288391, 0.11328791081905365, 0.2974449396133423, 0.11310947686433792, -0.12281835079193115, -0.27615946531295776, -0.3235756456851959, 0.08263780921697617, 0.20239150524139404, 0.04749869555234909, 0.4028928279876709, -0.16235774755477905, -0.4137311577796936, -0.11730117350816727, 0.11574728786945343, -0.34357407689094543, -0.047809962183237076, 0.14972823858261108, 0.056782059371471405, -0.19291535019874573, 0.04203745350241661, -0.29910916090011597, 0.12514567375183105, 0.7464714050292969, 0.15188902616500854, 0.013101622462272644, -0.202969491481781, -0.038774095475673676, 0.4236523509025574, 0.19753077626228333, -0.2921438217163086, 0.5381500720977783, -0.13089150190353394, -0.11470916867256165, -0.24734237790107727, 0.33939531445503235, 0.4388270676136017, 0.44756439328193665, -0.3689436614513397, -0.25780779123306274, 0.053047530353069305, -0.020327381789684296, 0.05460497736930847, 0.0827099159359932, 0.15596094727516174, 0.21761071681976318, 0.16701747477054596, 0.04905101656913757, -0.0018974244594573975, 0.39786726236343384, -0.21078883111476898, 0.0021759048104286194, -0.06791885942220688, -0.08580241352319717, -0.4921211898326874, -0.07012492418289185, -0.14329837262630463, -0.15550515055656433, -0.3343082666397095, 0.08154948055744171, 0.34060075879096985, 0.1142052635550499, 0.0347905233502388, 0.023553140461444855, 0.016059592366218567, 0.08494742214679718, 0.39854785799980164, 0.47035446763038635, 0.21631655097007751, -0.1133326068520546, -0.17388589680194855, -0.22850054502487183, 0.22218680381774902, -0.07417698204517365, -0.3110209107398987, 0.4102828800678253, 0.08553597331047058, 0.08264797925949097, 0.05065550655126572, 0.3875895142555237, 0.19302071630954742, 0.0407257042825222, 0.235711932182312, -0.45667001605033875, -0.06057855859398842, 0.20981065928936005, -0.2070326805114746, 0.12582185864448547, -0.15178057551383972, 0.13190506398677826, 0.09488359838724136, -0.17469224333763123, -0.1435374915599823, 0.09554862976074219, -0.12985393404960632, 0.20121324062347412, 0.2892596125602722, 0.13929691910743713, 0.07166826725006104, -0.0037493575364351273, -0.32989701628685, -0.2197146713733673, -0.1284877210855484, -0.2368423342704773, 0.43758365511894226, -0.09658519923686981, 0.22665777802467346, -0.09698529541492462, 0.215990349650383, -0.5038159489631653, 0.27774330973625183, 0.3622271418571472, -0.08471933007240295, -0.14157842099666595, 0.5312910079956055, -0.3111187517642975, -0.019477371126413345, 0.12038932740688324, 0.28187045454978943, 0.0020252950489521027, 0.3601284623146057, -0.31873205304145813, -0.44793179631233215, 0.3616081476211548, -0.4161415994167328, -0.1680961549282074, 0.27484437823295593, 0.040631264448165894, 0.49539294838905334, -0.05714767426252365, -0.6938849091529846, -0.2602965831756592, 0.19602760672569275, -0.03726127743721008, -0.12597021460533142, 0.016873029991984367, 0.1971939206123352, -0.011753112077713013, -0.12864358723163605, 0.7149358987808228, -0.01684710383415222, -0.18918193876743317, 0.06020243093371391, -0.2248123586177826 ]
https://github.com/huggingface/datasets/issues/6417
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error
Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`.
### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0
26
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error ### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0 Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`.
[ -0.12534506618976593, -0.6960603594779968, 0.06675899028778076, 0.31610435247421265, 0.3677387833595276, -0.2172713279724121, 0.5709386467933655, 0.08089055866003036, -0.18083731830120087, -0.04032093286514282, -0.07140607386827469, 0.6541167497634888, -0.0781998410820961, 0.20544643700122833, -0.13464465737342834, -0.21977421641349792, 0.11867936700582504, 0.04870546981692314, -0.27933552861213684, -0.0983457863330841, -0.24747493863105774, 0.36471736431121826, -0.31691497564315796, 0.14043858647346497, -0.13122417032718658, -0.04667344689369202, 0.07013525813817978, -0.006347686052322388, -0.007894720882177353, -0.1661829948425293, 0.33295074105262756, -0.34380170702934265, 0.09941370785236359, 0.1848178505897522, -0.00012145262735430151, -0.03654617443680763, 0.4414541721343994, -0.008131716400384903, -0.09745022654533386, -0.09651198983192444, 0.09714221209287643, -0.21189159154891968, 0.253510981798172, -0.2662363052368164, -0.10398901253938675, 0.007917743176221848, -0.528936505317688, -0.2778090834617615, 0.4964022636413574, 0.3365887403488159, 0.15733136236667633, 0.39866477251052856, 0.09910599887371063, -0.10035814344882965, 0.6133679151535034, 0.45614397525787354, -0.34079158306121826, 0.36632269620895386, 0.23519572615623474, -0.028368454426527023, 0.2728925347328186, 0.48420706391334534, -0.1933595836162567, 0.12886954843997955, 0.3461790978908539, 0.2166592925786972, -0.03984852880239487, 0.019346462562680244, -0.12752765417099, 0.30198508501052856, 0.237193763256073, -0.3270745575428009, -0.2531386613845825, -0.37092188000679016, 0.01962333172559738, -0.4381139874458313, 0.31141358613967896, 0.011742479167878628, -0.130360946059227, -0.0214107446372509, -0.21591930091381073, 0.03575238585472107, -0.34416666626930237, 0.12440342456102371, 0.015376575291156769, 0.32715386152267456, -0.3175138235092163, 0.13804051280021667, -0.1114540845155716, -0.030133813619613647, 0.2301262766122818, 0.2110554426908493, -0.01189165934920311, -0.07308705151081085, -0.17842718958854675, -0.038462236523628235, -0.1027686819434166, -0.17662787437438965, 0.004212636500597, -0.12136498093605042, 0.04474754258990288, -0.19944024085998535, 0.3090401291847229, 0.021742504090070724, -0.1182149201631546, 0.32300904393196106, 0.03924592211842537, 0.24495385587215424, 0.09794576466083527, 0.21658022701740265, 0.30306899547576904, -0.040462225675582886, -0.008604969829320908, -0.16112269461154938, -0.29502996802330017, 0.04039725661277771, 0.44665688276290894, 0.011044908314943314, -0.2988698184490204, 0.19922307133674622, -0.23719197511672974, 0.04368872568011284, 0.043480727821588516, 0.3199760913848877, 0.020674727857112885, -0.013129506260156631, 0.09933868050575256, 0.23359011113643646, -0.306007444858551, 0.18282851576805115, 0.023083090782165527, 0.1466054767370224, -0.2768853008747101, -0.17735759913921356, -0.14081265032291412, 0.3085518181324005, 0.08264961838722229, -0.07189029455184937, -0.18546245992183685, 0.07684820890426636, -0.23436997830867767, 0.18289679288864136, 0.27133041620254517, 0.19087541103363037, -0.3392235040664673, 0.0022310223430395126, -0.017079878598451614, 0.2504510283470154, -0.18041245639324188, 0.10067789256572723, -0.17757204174995422, -0.14915044605731964, -0.34003689885139465, 0.07882311940193176, -0.25863468647003174, 0.0852714478969574, -0.2883617579936981, 0.10571722686290741, -0.021334372460842133, 0.13276052474975586, 0.4869846701622009, -0.19292418658733368, -0.05577734485268593, -0.09742320328950882, 0.2688083052635193, 0.1255897730588913, -0.11502149701118469, -0.29422688484191895, -0.14110781252384186, 0.11133459210395813, 0.15547585487365723, 0.37615081667900085, 0.04414302483201027, -0.037883661687374115, -0.1765688806772232, 0.049533993005752563, 0.394487589597702, -0.452708899974823, -0.5630807280540466, -0.008011928759515285, -0.14294806122779846, 0.04148378223180771, 0.023633964359760284, -0.021918928250670433, -0.1574047952890396, 0.27572739124298096, -0.06347507238388062, 0.4356178045272827, 0.0038285013288259506, 0.051536038517951965, -0.2261921763420105, -0.13279186189174652, 0.22791901230812073, -0.023634621873497963, -0.13603052496910095, -0.25632765889167786, 0.1048794537782669, -0.2988584339618683, 0.14848147332668304, -0.17245997488498688, -0.1274380087852478, 0.1323692351579666, 0.5291131734848022, -0.05682988464832306, 0.1426967978477478, -0.12669536471366882, -0.8501926064491272, 0.008993633091449738, -0.025660555809736252, 0.04298894479870796, -0.27019113302230835, 0.00905705988407135, -0.19500288367271423, 0.14051330089569092, -0.21366874873638153, -0.3861227333545685, -0.017982980236411095, -0.10737287998199463, 0.052379775792360306, -0.005741778761148453, -0.18663224577903748, 0.0405639186501503, 0.007464120164513588, 0.2530505955219269, -0.45828795433044434, 0.2814982533454895, 0.000005943700671195984, -0.3530205488204956, -0.1227162778377533, 0.3778163492679596, 0.004822827875614166, -0.20007947087287903, -0.18731918931007385, 0.3001507818698883, 0.23274405300617218, 0.03586430102586746, -0.2922215163707733, -0.05498921871185303, 0.34518468379974365, -0.3689197301864624, -0.027368342503905296, 0.14702406525611877, 0.06704927980899811, 0.35911092162132263, -0.403346449136734, 0.5544770359992981, -0.06644043326377869, 0.17391237616539001, -0.15052205324172974, 0.3405343294143677, -0.044748298823833466, 0.08824685215950012, -0.12829844653606415, -0.3568283021450043, 0.2587123215198517, 0.2882642149925232, 0.3878120481967926, -0.022545987740159035, -0.13106322288513184, 0.11304189264774323, 0.31306999921798706, -0.0013260133564472198, 0.2666395306587219, 0.11391983181238174, -0.40573951601982117, 0.11362876743078232, 0.43939781188964844, 0.01437220349907875, 0.3231249451637268, 0.053332339972257614, -0.17925989627838135, 0.32240691781044006, -0.12242317944765091, -0.0508023239672184, 0.23256979882717133, -0.00933150202035904, 0.2779373526573181, 0.008430149406194687, 0.3019271790981293, 0.149384006857872, -0.2412199079990387, -0.06631147116422653, -0.11576305329799652, 0.06766754388809204, -0.4863757789134979, 0.01368175633251667, -0.20913860201835632, -0.2462707757949829, -0.1445528119802475, -0.3842095136642456, -0.2303253710269928, -0.013407756574451923, -0.10567295551300049, 0.13073945045471191, -0.030446812510490417, 0.360516756772995, 0.2868971526622772, 0.2851729989051819, 0.27416056394577026, -0.08059713244438171, -0.18203938007354736, -0.13337142765522003, -0.28291434049606323, -0.07664019614458084, 0.10501367598772049, 0.08370031416416168, 0.026246652007102966, -0.08540327847003937, -0.007224131375551224, -0.41613054275512695, -0.6337040066719055, 0.22306044399738312, -0.33539462089538574, 0.39845508337020874, 0.45292627811431885, -0.17412136495113373, 0.011148776859045029, 0.18781974911689758, 0.5270148515701294, 0.017197726294398308, -0.40267297625541687, 0.17506161332130432, 0.03573403134942055, -0.19708088040351868, -0.12016905844211578, -0.10372521728277206, -0.05495500564575195, -0.18533360958099365, 0.6761676669120789, -0.3940763473510742, -0.02733474224805832, 0.3297746777534485, 0.16103148460388184, 0.19279395043849945, -0.1391066610813141, -0.05957784503698349, -0.046951934695243835, 0.37236058712005615, 0.3424871861934662, -0.14806652069091797, -0.261753112077713, -0.2423418164253235, -0.061282847076654434, 0.16320988535881042, 0.20356127619743347, -0.36004412174224854, -0.25766462087631226, -0.47878706455230713, 0.31231454014778137, -0.12855230271816254, 0.13562177121639252, 0.32702121138572693, 0.060885392129421234, 0.18834634125232697, -0.1748056411743164, -0.32148921489715576, 0.25642406940460205, 0.14768880605697632, 0.025034330785274506, 0.1313941925764084, 0.4285263121128082, -0.11590705811977386, 0.2050415426492691, 0.2291432023048401, -0.017827089875936508, 0.3091297745704651, -0.19373342394828796, 0.30828550457954407, -0.12413040548563004, -0.26101022958755493, 0.27619469165802, -0.02553902566432953, -0.10072386264801025, -0.029432684183120728, -0.03553083911538124, -0.0006778156384825706, -0.017551029101014137, -0.12254169583320618, -0.027470845729112625, -0.17841120064258575, -0.07338827848434448, -0.02878076583147049, 0.02629677578806877, -0.2159404158592224, 0.23374074697494507, 0.0003517456352710724, -0.04705997556447983, 0.40236642956733704, 0.01587345451116562, 0.016926757991313934, -0.0008368197595700622, -0.466143399477005, -0.40187668800354004, -0.25948789715766907, 0.3158986568450928, 0.05696747824549675, 0.4691302478313446, -0.034273840487003326, -0.28202444314956665, 0.056439194828271866, 0.07886959612369537, 0.25997331738471985, -0.0817270427942276, -0.11436162889003754, 0.017312414944171906, -0.05934425815939903, -0.42600753903388977, -0.301887184381485, -0.1127411425113678, -0.02761196158826351, 0.045249272137880325, 0.855457603931427, -0.07230634987354279, -0.04765607789158821, 0.17061744630336761, -0.18661457300186157, 0.1315014511346817, -0.23054741322994232, -0.15937654674053192, -0.08812103420495987, -0.044695813208818436, 0.07655007392168045, 0.26703014969825745, 0.039861585944890976, 0.19734884798526764, -0.11832930147647858, -0.1842266172170639, -0.3291718363761902, -0.23950059711933136, 0.3331972658634186, 0.2562544047832489, -0.2115096151828766, 0.10378541052341461, 0.028548162430524826, 0.29201024770736694, 0.28017088770866394, 0.6490309238433838, 0.11834412813186646, -0.8898870944976807, -0.02178620547056198, -0.20390143990516663, 0.4125307500362396, 0.3699437975883484, -0.13044410943984985, -0.013272583484649658, -0.2471320629119873, 0.1234067976474762, -0.1446632295846939, -0.04308117553591728, 0.41048938035964966, 0.220987007021904, 0.21564729511737823, 0.22042231261730194, 0.46600013971328735, 0.10989217460155487, 0.06906743347644806, 0.32544180750846863, 0.01836293935775757, -0.26559504866600037, 0.15802115201950073, 0.3544387221336365, 0.6253800392150879, 0.11413954943418503, 0.15462663769721985, 0.5849329233169556, -0.31790679693222046, 0.49124807119369507, 0.5121310353279114, 0.1963280588388443, -0.4185543656349182, -0.21944032609462738, -0.0037057064473628998, -0.27628931403160095, 0.18027600646018982, -0.32073456048965454, -0.09642603248357773, 0.026056461036205292, -0.02547253668308258, 0.19785626232624054, -0.11078207194805145, -0.05868683010339737, 0.07036947458982468, -0.18929190933704376, -0.518875002861023, -0.02230897545814514, -0.06283546984195709, 0.17362824082374573, 0.0709080770611763, -0.04200449585914612, -0.4873078465461731, -0.300564169883728, -0.40076351165771484, 0.17019036412239075, -0.6829380393028259, -0.11726264655590057, 0.4424041509628296, -0.6239645481109619, 0.08363531529903412, 0.16587340831756592, 0.07737860828638077, -0.09358109533786774, -0.17096631228923798, 0.05606701597571373, 0.3395838439464569, 0.12933191657066345, 0.18834245204925537, -0.26194894313812256, 0.10020186752080917, -0.0552976056933403, 0.18069162964820862, 0.15926215052604675, -0.017400506883859634, 0.002411462366580963, 0.028206780552864075, -0.08800721168518066, 0.13893966376781464, -0.12213702499866486, -0.017336944118142128, -0.41569244861602783, 0.23797065019607544, -0.13953880965709686, -0.00015821680426597595, -0.2167278677225113, -0.038719404488801956, 0.01204836368560791, -0.1686810851097107, -0.30524829030036926, -0.1305018663406372, 0.013389959931373596, -0.23716363310813904, -0.06145911663770676, 0.13001668453216553, 0.4529450535774231, -0.11587785929441452, -0.05017849802970886, 0.21420744061470032, 0.4644377529621124, -0.5296168923377991, 0.06173054873943329, -0.3326200544834137, -0.37486791610717773, -0.022757334634661674, 0.7615775465965271, 0.398811399936676, -0.15083464980125427, 0.03779832646250725, -0.11003167182207108, -0.3412106931209564, 0.2185746431350708, -0.20928244292736053, 0.11530254781246185, 0.017258483916521072, 0.024131476879119873, -0.07387842983007431, -0.16520534455776215, -0.18768347799777985, -0.06989184767007828, 0.2611861526966095, -0.0016179420053958893, -0.005190683528780937, -0.10902904719114304, 0.1347077339887619, -0.04666886478662491, 0.059182390570640564, 0.16988644003868103, 0.009749535471200943, -0.056344058364629745, -0.19875983893871307, 0.12615692615509033, 0.06289593875408173, -0.27076971530914307, -0.09711514413356781, -0.04875645786523819, -0.1611095368862152, -0.3481003940105438, 0.10281252861022949, 0.07572155445814133, 0.02552715316414833, 0.09101532399654388, -0.12447278201580048, -0.1757660210132599, -0.012744953855872154, 0.17341965436935425, -0.0661039650440216, -0.03404971957206726, 0.03806396201252937, 0.1380966305732727, 0.004340099636465311, 0.15124808251857758, -0.012886268086731434, -0.07505113631486893, -0.17658771574497223, 0.12895694375038147, 0.1843489110469818, -0.3119109272956848, -0.2712923586368561, -0.0043252697214484215, 0.30958375334739685, 0.37249255180358887, -0.18981069326400757, -0.24351508915424347, 0.2774919271469116, 0.10312005877494812, -0.30705225467681885, -0.06895487755537033, 0.08008037507534027, 0.17156994342803955, 0.04578794911503792, 0.46865370869636536, 0.15126217901706696, 0.17747533321380615, -0.12751175463199615, 0.15692859888076782, 0.15787464380264282, 0.16691024601459503, 0.13826075196266174, 0.19820868968963623, -0.014045316725969315, 0.19762590527534485, 0.445770800113678, 0.085214763879776, 0.3879314959049225, 0.08608730882406235, 0.1779724657535553, -0.2575433850288391, 0.11328791081905365, 0.2974449396133423, 0.11310947686433792, -0.12281835079193115, -0.27615946531295776, -0.3235756456851959, 0.08263780921697617, 0.20239150524139404, 0.04749869555234909, 0.4028928279876709, -0.16235774755477905, -0.4137311577796936, -0.11730117350816727, 0.11574728786945343, -0.34357407689094543, -0.047809962183237076, 0.14972823858261108, 0.056782059371471405, -0.19291535019874573, 0.04203745350241661, -0.29910916090011597, 0.12514567375183105, 0.7464714050292969, 0.15188902616500854, 0.013101622462272644, -0.202969491481781, -0.038774095475673676, 0.4236523509025574, 0.19753077626228333, -0.2921438217163086, 0.5381500720977783, -0.13089150190353394, -0.11470916867256165, -0.24734237790107727, 0.33939531445503235, 0.4388270676136017, 0.44756439328193665, -0.3689436614513397, -0.25780779123306274, 0.053047530353069305, -0.020327381789684296, 0.05460497736930847, 0.0827099159359932, 0.15596094727516174, 0.21761071681976318, 0.16701747477054596, 0.04905101656913757, -0.0018974244594573975, 0.39786726236343384, -0.21078883111476898, 0.0021759048104286194, -0.06791885942220688, -0.08580241352319717, -0.4921211898326874, -0.07012492418289185, -0.14329837262630463, -0.15550515055656433, -0.3343082666397095, 0.08154948055744171, 0.34060075879096985, 0.1142052635550499, 0.0347905233502388, 0.023553140461444855, 0.016059592366218567, 0.08494742214679718, 0.39854785799980164, 0.47035446763038635, 0.21631655097007751, -0.1133326068520546, -0.17388589680194855, -0.22850054502487183, 0.22218680381774902, -0.07417698204517365, -0.3110209107398987, 0.4102828800678253, 0.08553597331047058, 0.08264797925949097, 0.05065550655126572, 0.3875895142555237, 0.19302071630954742, 0.0407257042825222, 0.235711932182312, -0.45667001605033875, -0.06057855859398842, 0.20981065928936005, -0.2070326805114746, 0.12582185864448547, -0.15178057551383972, 0.13190506398677826, 0.09488359838724136, -0.17469224333763123, -0.1435374915599823, 0.09554862976074219, -0.12985393404960632, 0.20121324062347412, 0.2892596125602722, 0.13929691910743713, 0.07166826725006104, -0.0037493575364351273, -0.32989701628685, -0.2197146713733673, -0.1284877210855484, -0.2368423342704773, 0.43758365511894226, -0.09658519923686981, 0.22665777802467346, -0.09698529541492462, 0.215990349650383, -0.5038159489631653, 0.27774330973625183, 0.3622271418571472, -0.08471933007240295, -0.14157842099666595, 0.5312910079956055, -0.3111187517642975, -0.019477371126413345, 0.12038932740688324, 0.28187045454978943, 0.0020252950489521027, 0.3601284623146057, -0.31873205304145813, -0.44793179631233215, 0.3616081476211548, -0.4161415994167328, -0.1680961549282074, 0.27484437823295593, 0.040631264448165894, 0.49539294838905334, -0.05714767426252365, -0.6938849091529846, -0.2602965831756592, 0.19602760672569275, -0.03726127743721008, -0.12597021460533142, 0.016873029991984367, 0.1971939206123352, -0.011753112077713013, -0.12864358723163605, 0.7149358987808228, -0.01684710383415222, -0.18918193876743317, 0.06020243093371391, -0.2248123586177826 ]
https://github.com/huggingface/datasets/issues/6417
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error
> Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`. Thanks for the info and the latest release, it seems this has also solved my issue. First run after the update worked and I am training right now :D Will close the Issu
### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0
60
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error ### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0 > Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`. Thanks for the info and the latest release, it seems this has also solved my issue. First run after the update worked and I am training right now :D Will close the Issu
[ -0.12534506618976593, -0.6960603594779968, 0.06675899028778076, 0.31610435247421265, 0.3677387833595276, -0.2172713279724121, 0.5709386467933655, 0.08089055866003036, -0.18083731830120087, -0.04032093286514282, -0.07140607386827469, 0.6541167497634888, -0.0781998410820961, 0.20544643700122833, -0.13464465737342834, -0.21977421641349792, 0.11867936700582504, 0.04870546981692314, -0.27933552861213684, -0.0983457863330841, -0.24747493863105774, 0.36471736431121826, -0.31691497564315796, 0.14043858647346497, -0.13122417032718658, -0.04667344689369202, 0.07013525813817978, -0.006347686052322388, -0.007894720882177353, -0.1661829948425293, 0.33295074105262756, -0.34380170702934265, 0.09941370785236359, 0.1848178505897522, -0.00012145262735430151, -0.03654617443680763, 0.4414541721343994, -0.008131716400384903, -0.09745022654533386, -0.09651198983192444, 0.09714221209287643, -0.21189159154891968, 0.253510981798172, -0.2662363052368164, -0.10398901253938675, 0.007917743176221848, -0.528936505317688, -0.2778090834617615, 0.4964022636413574, 0.3365887403488159, 0.15733136236667633, 0.39866477251052856, 0.09910599887371063, -0.10035814344882965, 0.6133679151535034, 0.45614397525787354, -0.34079158306121826, 0.36632269620895386, 0.23519572615623474, -0.028368454426527023, 0.2728925347328186, 0.48420706391334534, -0.1933595836162567, 0.12886954843997955, 0.3461790978908539, 0.2166592925786972, -0.03984852880239487, 0.019346462562680244, -0.12752765417099, 0.30198508501052856, 0.237193763256073, -0.3270745575428009, -0.2531386613845825, -0.37092188000679016, 0.01962333172559738, -0.4381139874458313, 0.31141358613967896, 0.011742479167878628, -0.130360946059227, -0.0214107446372509, -0.21591930091381073, 0.03575238585472107, -0.34416666626930237, 0.12440342456102371, 0.015376575291156769, 0.32715386152267456, -0.3175138235092163, 0.13804051280021667, -0.1114540845155716, -0.030133813619613647, 0.2301262766122818, 0.2110554426908493, -0.01189165934920311, -0.07308705151081085, -0.17842718958854675, -0.038462236523628235, -0.1027686819434166, -0.17662787437438965, 0.004212636500597, -0.12136498093605042, 0.04474754258990288, -0.19944024085998535, 0.3090401291847229, 0.021742504090070724, -0.1182149201631546, 0.32300904393196106, 0.03924592211842537, 0.24495385587215424, 0.09794576466083527, 0.21658022701740265, 0.30306899547576904, -0.040462225675582886, -0.008604969829320908, -0.16112269461154938, -0.29502996802330017, 0.04039725661277771, 0.44665688276290894, 0.011044908314943314, -0.2988698184490204, 0.19922307133674622, -0.23719197511672974, 0.04368872568011284, 0.043480727821588516, 0.3199760913848877, 0.020674727857112885, -0.013129506260156631, 0.09933868050575256, 0.23359011113643646, -0.306007444858551, 0.18282851576805115, 0.023083090782165527, 0.1466054767370224, -0.2768853008747101, -0.17735759913921356, -0.14081265032291412, 0.3085518181324005, 0.08264961838722229, -0.07189029455184937, -0.18546245992183685, 0.07684820890426636, -0.23436997830867767, 0.18289679288864136, 0.27133041620254517, 0.19087541103363037, -0.3392235040664673, 0.0022310223430395126, -0.017079878598451614, 0.2504510283470154, -0.18041245639324188, 0.10067789256572723, -0.17757204174995422, -0.14915044605731964, -0.34003689885139465, 0.07882311940193176, -0.25863468647003174, 0.0852714478969574, -0.2883617579936981, 0.10571722686290741, -0.021334372460842133, 0.13276052474975586, 0.4869846701622009, -0.19292418658733368, -0.05577734485268593, -0.09742320328950882, 0.2688083052635193, 0.1255897730588913, -0.11502149701118469, -0.29422688484191895, -0.14110781252384186, 0.11133459210395813, 0.15547585487365723, 0.37615081667900085, 0.04414302483201027, -0.037883661687374115, -0.1765688806772232, 0.049533993005752563, 0.394487589597702, -0.452708899974823, -0.5630807280540466, -0.008011928759515285, -0.14294806122779846, 0.04148378223180771, 0.023633964359760284, -0.021918928250670433, -0.1574047952890396, 0.27572739124298096, -0.06347507238388062, 0.4356178045272827, 0.0038285013288259506, 0.051536038517951965, -0.2261921763420105, -0.13279186189174652, 0.22791901230812073, -0.023634621873497963, -0.13603052496910095, -0.25632765889167786, 0.1048794537782669, -0.2988584339618683, 0.14848147332668304, -0.17245997488498688, -0.1274380087852478, 0.1323692351579666, 0.5291131734848022, -0.05682988464832306, 0.1426967978477478, -0.12669536471366882, -0.8501926064491272, 0.008993633091449738, -0.025660555809736252, 0.04298894479870796, -0.27019113302230835, 0.00905705988407135, -0.19500288367271423, 0.14051330089569092, -0.21366874873638153, -0.3861227333545685, -0.017982980236411095, -0.10737287998199463, 0.052379775792360306, -0.005741778761148453, -0.18663224577903748, 0.0405639186501503, 0.007464120164513588, 0.2530505955219269, -0.45828795433044434, 0.2814982533454895, 0.000005943700671195984, -0.3530205488204956, -0.1227162778377533, 0.3778163492679596, 0.004822827875614166, -0.20007947087287903, -0.18731918931007385, 0.3001507818698883, 0.23274405300617218, 0.03586430102586746, -0.2922215163707733, -0.05498921871185303, 0.34518468379974365, -0.3689197301864624, -0.027368342503905296, 0.14702406525611877, 0.06704927980899811, 0.35911092162132263, -0.403346449136734, 0.5544770359992981, -0.06644043326377869, 0.17391237616539001, -0.15052205324172974, 0.3405343294143677, -0.044748298823833466, 0.08824685215950012, -0.12829844653606415, -0.3568283021450043, 0.2587123215198517, 0.2882642149925232, 0.3878120481967926, -0.022545987740159035, -0.13106322288513184, 0.11304189264774323, 0.31306999921798706, -0.0013260133564472198, 0.2666395306587219, 0.11391983181238174, -0.40573951601982117, 0.11362876743078232, 0.43939781188964844, 0.01437220349907875, 0.3231249451637268, 0.053332339972257614, -0.17925989627838135, 0.32240691781044006, -0.12242317944765091, -0.0508023239672184, 0.23256979882717133, -0.00933150202035904, 0.2779373526573181, 0.008430149406194687, 0.3019271790981293, 0.149384006857872, -0.2412199079990387, -0.06631147116422653, -0.11576305329799652, 0.06766754388809204, -0.4863757789134979, 0.01368175633251667, -0.20913860201835632, -0.2462707757949829, -0.1445528119802475, -0.3842095136642456, -0.2303253710269928, -0.013407756574451923, -0.10567295551300049, 0.13073945045471191, -0.030446812510490417, 0.360516756772995, 0.2868971526622772, 0.2851729989051819, 0.27416056394577026, -0.08059713244438171, -0.18203938007354736, -0.13337142765522003, -0.28291434049606323, -0.07664019614458084, 0.10501367598772049, 0.08370031416416168, 0.026246652007102966, -0.08540327847003937, -0.007224131375551224, -0.41613054275512695, -0.6337040066719055, 0.22306044399738312, -0.33539462089538574, 0.39845508337020874, 0.45292627811431885, -0.17412136495113373, 0.011148776859045029, 0.18781974911689758, 0.5270148515701294, 0.017197726294398308, -0.40267297625541687, 0.17506161332130432, 0.03573403134942055, -0.19708088040351868, -0.12016905844211578, -0.10372521728277206, -0.05495500564575195, -0.18533360958099365, 0.6761676669120789, -0.3940763473510742, -0.02733474224805832, 0.3297746777534485, 0.16103148460388184, 0.19279395043849945, -0.1391066610813141, -0.05957784503698349, -0.046951934695243835, 0.37236058712005615, 0.3424871861934662, -0.14806652069091797, -0.261753112077713, -0.2423418164253235, -0.061282847076654434, 0.16320988535881042, 0.20356127619743347, -0.36004412174224854, -0.25766462087631226, -0.47878706455230713, 0.31231454014778137, -0.12855230271816254, 0.13562177121639252, 0.32702121138572693, 0.060885392129421234, 0.18834634125232697, -0.1748056411743164, -0.32148921489715576, 0.25642406940460205, 0.14768880605697632, 0.025034330785274506, 0.1313941925764084, 0.4285263121128082, -0.11590705811977386, 0.2050415426492691, 0.2291432023048401, -0.017827089875936508, 0.3091297745704651, -0.19373342394828796, 0.30828550457954407, -0.12413040548563004, -0.26101022958755493, 0.27619469165802, -0.02553902566432953, -0.10072386264801025, -0.029432684183120728, -0.03553083911538124, -0.0006778156384825706, -0.017551029101014137, -0.12254169583320618, -0.027470845729112625, -0.17841120064258575, -0.07338827848434448, -0.02878076583147049, 0.02629677578806877, -0.2159404158592224, 0.23374074697494507, 0.0003517456352710724, -0.04705997556447983, 0.40236642956733704, 0.01587345451116562, 0.016926757991313934, -0.0008368197595700622, -0.466143399477005, -0.40187668800354004, -0.25948789715766907, 0.3158986568450928, 0.05696747824549675, 0.4691302478313446, -0.034273840487003326, -0.28202444314956665, 0.056439194828271866, 0.07886959612369537, 0.25997331738471985, -0.0817270427942276, -0.11436162889003754, 0.017312414944171906, -0.05934425815939903, -0.42600753903388977, -0.301887184381485, -0.1127411425113678, -0.02761196158826351, 0.045249272137880325, 0.855457603931427, -0.07230634987354279, -0.04765607789158821, 0.17061744630336761, -0.18661457300186157, 0.1315014511346817, -0.23054741322994232, -0.15937654674053192, -0.08812103420495987, -0.044695813208818436, 0.07655007392168045, 0.26703014969825745, 0.039861585944890976, 0.19734884798526764, -0.11832930147647858, -0.1842266172170639, -0.3291718363761902, -0.23950059711933136, 0.3331972658634186, 0.2562544047832489, -0.2115096151828766, 0.10378541052341461, 0.028548162430524826, 0.29201024770736694, 0.28017088770866394, 0.6490309238433838, 0.11834412813186646, -0.8898870944976807, -0.02178620547056198, -0.20390143990516663, 0.4125307500362396, 0.3699437975883484, -0.13044410943984985, -0.013272583484649658, -0.2471320629119873, 0.1234067976474762, -0.1446632295846939, -0.04308117553591728, 0.41048938035964966, 0.220987007021904, 0.21564729511737823, 0.22042231261730194, 0.46600013971328735, 0.10989217460155487, 0.06906743347644806, 0.32544180750846863, 0.01836293935775757, -0.26559504866600037, 0.15802115201950073, 0.3544387221336365, 0.6253800392150879, 0.11413954943418503, 0.15462663769721985, 0.5849329233169556, -0.31790679693222046, 0.49124807119369507, 0.5121310353279114, 0.1963280588388443, -0.4185543656349182, -0.21944032609462738, -0.0037057064473628998, -0.27628931403160095, 0.18027600646018982, -0.32073456048965454, -0.09642603248357773, 0.026056461036205292, -0.02547253668308258, 0.19785626232624054, -0.11078207194805145, -0.05868683010339737, 0.07036947458982468, -0.18929190933704376, -0.518875002861023, -0.02230897545814514, -0.06283546984195709, 0.17362824082374573, 0.0709080770611763, -0.04200449585914612, -0.4873078465461731, -0.300564169883728, -0.40076351165771484, 0.17019036412239075, -0.6829380393028259, -0.11726264655590057, 0.4424041509628296, -0.6239645481109619, 0.08363531529903412, 0.16587340831756592, 0.07737860828638077, -0.09358109533786774, -0.17096631228923798, 0.05606701597571373, 0.3395838439464569, 0.12933191657066345, 0.18834245204925537, -0.26194894313812256, 0.10020186752080917, -0.0552976056933403, 0.18069162964820862, 0.15926215052604675, -0.017400506883859634, 0.002411462366580963, 0.028206780552864075, -0.08800721168518066, 0.13893966376781464, -0.12213702499866486, -0.017336944118142128, -0.41569244861602783, 0.23797065019607544, -0.13953880965709686, -0.00015821680426597595, -0.2167278677225113, -0.038719404488801956, 0.01204836368560791, -0.1686810851097107, -0.30524829030036926, -0.1305018663406372, 0.013389959931373596, -0.23716363310813904, -0.06145911663770676, 0.13001668453216553, 0.4529450535774231, -0.11587785929441452, -0.05017849802970886, 0.21420744061470032, 0.4644377529621124, -0.5296168923377991, 0.06173054873943329, -0.3326200544834137, -0.37486791610717773, -0.022757334634661674, 0.7615775465965271, 0.398811399936676, -0.15083464980125427, 0.03779832646250725, -0.11003167182207108, -0.3412106931209564, 0.2185746431350708, -0.20928244292736053, 0.11530254781246185, 0.017258483916521072, 0.024131476879119873, -0.07387842983007431, -0.16520534455776215, -0.18768347799777985, -0.06989184767007828, 0.2611861526966095, -0.0016179420053958893, -0.005190683528780937, -0.10902904719114304, 0.1347077339887619, -0.04666886478662491, 0.059182390570640564, 0.16988644003868103, 0.009749535471200943, -0.056344058364629745, -0.19875983893871307, 0.12615692615509033, 0.06289593875408173, -0.27076971530914307, -0.09711514413356781, -0.04875645786523819, -0.1611095368862152, -0.3481003940105438, 0.10281252861022949, 0.07572155445814133, 0.02552715316414833, 0.09101532399654388, -0.12447278201580048, -0.1757660210132599, -0.012744953855872154, 0.17341965436935425, -0.0661039650440216, -0.03404971957206726, 0.03806396201252937, 0.1380966305732727, 0.004340099636465311, 0.15124808251857758, -0.012886268086731434, -0.07505113631486893, -0.17658771574497223, 0.12895694375038147, 0.1843489110469818, -0.3119109272956848, -0.2712923586368561, -0.0043252697214484215, 0.30958375334739685, 0.37249255180358887, -0.18981069326400757, -0.24351508915424347, 0.2774919271469116, 0.10312005877494812, -0.30705225467681885, -0.06895487755537033, 0.08008037507534027, 0.17156994342803955, 0.04578794911503792, 0.46865370869636536, 0.15126217901706696, 0.17747533321380615, -0.12751175463199615, 0.15692859888076782, 0.15787464380264282, 0.16691024601459503, 0.13826075196266174, 0.19820868968963623, -0.014045316725969315, 0.19762590527534485, 0.445770800113678, 0.085214763879776, 0.3879314959049225, 0.08608730882406235, 0.1779724657535553, -0.2575433850288391, 0.11328791081905365, 0.2974449396133423, 0.11310947686433792, -0.12281835079193115, -0.27615946531295776, -0.3235756456851959, 0.08263780921697617, 0.20239150524139404, 0.04749869555234909, 0.4028928279876709, -0.16235774755477905, -0.4137311577796936, -0.11730117350816727, 0.11574728786945343, -0.34357407689094543, -0.047809962183237076, 0.14972823858261108, 0.056782059371471405, -0.19291535019874573, 0.04203745350241661, -0.29910916090011597, 0.12514567375183105, 0.7464714050292969, 0.15188902616500854, 0.013101622462272644, -0.202969491481781, -0.038774095475673676, 0.4236523509025574, 0.19753077626228333, -0.2921438217163086, 0.5381500720977783, -0.13089150190353394, -0.11470916867256165, -0.24734237790107727, 0.33939531445503235, 0.4388270676136017, 0.44756439328193665, -0.3689436614513397, -0.25780779123306274, 0.053047530353069305, -0.020327381789684296, 0.05460497736930847, 0.0827099159359932, 0.15596094727516174, 0.21761071681976318, 0.16701747477054596, 0.04905101656913757, -0.0018974244594573975, 0.39786726236343384, -0.21078883111476898, 0.0021759048104286194, -0.06791885942220688, -0.08580241352319717, -0.4921211898326874, -0.07012492418289185, -0.14329837262630463, -0.15550515055656433, -0.3343082666397095, 0.08154948055744171, 0.34060075879096985, 0.1142052635550499, 0.0347905233502388, 0.023553140461444855, 0.016059592366218567, 0.08494742214679718, 0.39854785799980164, 0.47035446763038635, 0.21631655097007751, -0.1133326068520546, -0.17388589680194855, -0.22850054502487183, 0.22218680381774902, -0.07417698204517365, -0.3110209107398987, 0.4102828800678253, 0.08553597331047058, 0.08264797925949097, 0.05065550655126572, 0.3875895142555237, 0.19302071630954742, 0.0407257042825222, 0.235711932182312, -0.45667001605033875, -0.06057855859398842, 0.20981065928936005, -0.2070326805114746, 0.12582185864448547, -0.15178057551383972, 0.13190506398677826, 0.09488359838724136, -0.17469224333763123, -0.1435374915599823, 0.09554862976074219, -0.12985393404960632, 0.20121324062347412, 0.2892596125602722, 0.13929691910743713, 0.07166826725006104, -0.0037493575364351273, -0.32989701628685, -0.2197146713733673, -0.1284877210855484, -0.2368423342704773, 0.43758365511894226, -0.09658519923686981, 0.22665777802467346, -0.09698529541492462, 0.215990349650383, -0.5038159489631653, 0.27774330973625183, 0.3622271418571472, -0.08471933007240295, -0.14157842099666595, 0.5312910079956055, -0.3111187517642975, -0.019477371126413345, 0.12038932740688324, 0.28187045454978943, 0.0020252950489521027, 0.3601284623146057, -0.31873205304145813, -0.44793179631233215, 0.3616081476211548, -0.4161415994167328, -0.1680961549282074, 0.27484437823295593, 0.040631264448165894, 0.49539294838905334, -0.05714767426252365, -0.6938849091529846, -0.2602965831756592, 0.19602760672569275, -0.03726127743721008, -0.12597021460533142, 0.016873029991984367, 0.1971939206123352, -0.011753112077713013, -0.12864358723163605, 0.7149358987808228, -0.01684710383415222, -0.18918193876743317, 0.06020243093371391, -0.2248123586177826 ]
https://github.com/huggingface/datasets/issues/6412
User token is printed out!
Indeed, this is not a good practice. I've opened a PR that removes the token value from the (deprecation) warning.
This line prints user token on command line! Is it safe? https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/load.py#L2091
20
User token is printed out! This line prints user token on command line! Is it safe? https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/load.py#L2091 Indeed, this is not a good practice. I've opened a PR that removes the token value from the (deprecation) warning.
[ -0.0031757652759552, -0.15867872536182404, -0.12456424534320831, -0.017054550349712372, 0.22019349038600922, 0.023465357720851898, 0.4189116656780243, -0.06820280849933624, 0.0075026266276836395, 0.07574682682752609, -0.00391933461651206, 0.028364168480038643, -0.00901156198233366, 0.2457590252161026, 0.095916248857975, 0.2645987570285797, 0.13086414337158203, -0.2871975898742676, 0.11329600214958191, -0.06774598360061646, -0.08722585439682007, 0.09822729974985123, -0.06782329082489014, 0.7201299071311951, -0.30594709515571594, -0.09293121099472046, 0.19415375590324402, 0.07527542114257812, -0.08779086917638779, -0.24780625104904175, 0.05053766816854477, -0.03200234845280647, -0.02834472618997097, 0.2842460870742798, -0.00011234121484449133, -0.06370169669389725, 0.3810608983039856, 0.19185979664325714, -0.20292718708515167, -0.16070513427257538, 0.14187517762184143, 0.07580292969942093, 0.18500418961048126, -0.45469993352890015, 0.21268025040626526, -0.04570740461349487, 0.06386742740869522, -0.14864876866340637, 0.4330034852027893, 0.02889663353562355, 0.21573202311992645, 0.42259567975997925, -0.12723423540592194, 0.3366924226284027, -0.1194637343287468, 0.3828554153442383, 0.1586284637451172, -0.15408171713352203, -0.04328857362270355, 0.10856720805168152, 0.30738818645477295, 0.12477192282676697, -0.06990325450897217, -0.4561876654624939, 0.15832623839378357, 0.19110795855522156, 0.07886828482151031, -0.17067565023899078, 0.15761253237724304, 0.18304207921028137, 0.25185585021972656, -0.17934221029281616, -0.15757137537002563, 0.018420591950416565, -0.04072510451078415, -0.2965848445892334, 0.10343141853809357, 0.24732428789138794, -0.11716890335083008, 0.20764774084091187, -0.4296737313270569, -0.43781691789627075, -0.017273172736167908, -0.13419218361377716, -0.2345736026763916, 0.644611120223999, -0.26826757192611694, 0.2434138059616089, -0.044329430907964706, -0.1737080216407776, -0.4097253680229187, 0.12116533517837524, -0.48011091351509094, -0.06626550853252411, 0.004239942878484726, -0.2869262099266052, -0.3372965157032013, -0.07006625086069107, 0.10401006788015366, 0.013341713696718216, -0.0250815711915493, -0.1253454089164734, -0.13037562370300293, 0.07267112284898758, 0.3744807541370392, -0.07281933724880219, 0.23558542132377625, 0.06299694627523422, 0.23661933839321136, -0.2508525252342224, 0.5304465293884277, -0.1263488531112671, -0.02241317182779312, -0.07347869873046875, 0.24433483183383942, -0.04229585826396942, 0.25875425338745117, -0.3255324065685272, -0.28853747248649597, 0.11833538115024567, 0.01757434755563736, -0.040078386664390564, 0.004168394953012466, 0.39784860610961914, -0.002143553225323558, -0.23682034015655518, 0.04688522219657898, -0.09587655961513519, -0.12079782783985138, -0.4324074387550354, -0.10524049401283264, -0.02724270150065422, -0.23759576678276062, -0.10168870538473129, -0.5798221230506897, 0.09186141192913055, 0.05575515329837799, -0.031320225447416306, 0.21837660670280457, -0.13547411561012268, -0.06524195522069931, 0.1385517418384552, 0.4145582616329193, 0.2432895302772522, -0.0036243051290512085, 0.16071180999279022, 0.029360104352235794, -0.02484935149550438, -0.0862586572766304, 0.3603276312351227, -0.49369990825653076, -0.26987913250923157, -0.23966209590435028, 0.18074074387550354, -0.2706240713596344, -0.10807853937149048, -0.40939512848854065, -0.10890132188796997, 0.4183792173862457, 0.35690611600875854, 0.43824926018714905, -0.009698137640953064, -0.16604307293891907, -0.1531032919883728, 0.10335409641265869, 0.18472394347190857, -0.08118672668933868, -0.2222364842891693, 0.2526663839817047, -0.344251424074173, 0.31959080696105957, 0.4336465001106262, -0.15561453998088837, 0.3844423294067383, -0.19846346974372864, 0.2826893925666809, 0.20865662395954132, -0.18263374269008636, 0.026608042418956757, 0.3562932014465332, -0.1224849596619606, -0.2692115008831024, 0.005106672644615173, -0.03412698209285736, 0.21197357773780823, -0.40408822894096375, -0.004841767251491547, 0.036038585007190704, 0.2576482594013214, 0.22489500045776367, -0.23159179091453552, -0.3266614079475403, -0.0028143227100372314, -0.194550558924675, 0.1355864703655243, -0.014511413872241974, 0.02617020159959793, -0.10378091037273407, 0.5955884456634521, -0.04919463023543358, 0.09656890481710434, -0.09815475344657898, 0.4252532124519348, 0.49357402324676514, -0.2930968999862671, 0.6098146438598633, -0.022143147885799408, -0.18118590116500854, 0.2650010883808136, -0.1492474526166916, -0.10591006278991699, -0.5035414099693298, 0.07035843282938004, 0.2983766198158264, -0.26775702834129333, 0.17766022682189941, -0.016963498666882515, 0.025263607501983643, 0.12324400246143341, 0.1749575287103653, -0.03718622773885727, 0.08882323652505875, -0.2544059455394745, 0.2635519206523895, -0.2877199947834015, 0.06484334915876389, 0.03062324784696102, 0.22444291412830353, -0.2198999524116516, -0.01041366159915924, 0.16836586594581604, -0.28752896189689636, 0.08107110112905502, 0.5250740051269531, -0.12978225946426392, 0.256447970867157, -0.2240343689918518, 0.3185499906539917, 0.2607169449329376, -0.06997138261795044, 0.0888318419456482, -0.19792531430721283, 0.02696719765663147, 0.24190518260002136, 0.09294895082712173, 0.4558594226837158, 0.08586429059505463, -0.3397848308086395, -0.30287420749664307, 0.1693931519985199, -0.14612875878810883, 0.0575522743165493, -0.0596027597784996, -0.013623185455799103, -0.20175273716449738, 0.12909600138664246, -0.1717759519815445, -0.05358441174030304, -0.06290474534034729, -0.20917853713035583, 0.11699344962835312, -0.40404269099235535, -0.05446489900350571, -0.06321316212415695, 0.391006737947464, -0.12299664318561554, 0.24835211038589478, -0.05965894088149071, 0.09704168885946274, 0.19162514805793762, -0.0005825869739055634, 0.09418178349733353, 0.10640551894903183, -0.09365499764680862, 0.1222958117723465, 0.09594347327947617, -0.28523844480514526, -0.15792065858840942, -0.2858129143714905, 0.053743548691272736, -0.15487338602542877, 0.26050230860710144, 0.08048558980226517, 0.13576912879943848, -0.5313037633895874, 0.2592986524105072, 0.08130806684494019, -0.15076544880867004, 0.06633350998163223, -0.20595723390579224, -0.22274556756019592, -0.38467395305633545, -0.002072032541036606, -0.19118638336658478, -0.29964956641197205, 0.23547549545764923, -0.015475340187549591, 0.11323381960391998, -0.06905975937843323, 0.17080478370189667, -0.3355361819267273, 0.14082543551921844, 0.009623244404792786, 0.0717526227235794, 0.040330104529857635, -0.13168010115623474, 0.5824399590492249, -0.23075172305107117, -0.07815880328416824, -0.5710620880126953, -0.24492228031158447, 0.23181386291980743, -0.18795350193977356, -0.08024810254573822, 0.1509665697813034, -0.084403395652771, -0.11978590488433838, 0.1401422768831253, -0.16572599112987518, -0.5238727927207947, 0.005007954314351082, -0.35153821110725403, 0.15143583714962006, -0.09161332249641418, -0.3150947093963623, 0.20991434156894684, -0.278508722782135, 0.2031940221786499, 0.07626602053642273, 0.07059136033058167, 0.14794570207595825, 0.011590198613703251, -0.2324528992176056, -0.07151461392641068, -0.1492137759923935, -0.29209190607070923, -0.4607374370098114, -0.6043421626091003, -0.16446822881698608, -0.054884832352399826, -0.2023138701915741, 0.08860768377780914, 0.2581555247306824, 0.14857074618339539, -0.0699630007147789, -0.5034683346748352, -0.33519062399864197, -0.008653843775391579, 0.1301068663597107, -0.19653838872909546, 0.07572876662015915, -0.29950428009033203, -0.2057671695947647, -0.005180111154913902, 0.2254142463207245, 0.05857411399483681, 0.1596938669681549, -0.3231019377708435, 0.1532393842935562, 0.17954376339912415, 0.18375295400619507, 0.0694381445646286, 0.3353601098060608, -0.024949559941887856, 0.004588913172483444, 0.03851056098937988, -0.1232660636305809, 0.7318991422653198, 0.20846295356750488, 0.06406678259372711, -0.07340236008167267, 0.23608866333961487, -0.22425860166549683, 0.06320099532604218, 0.10499142110347748, 0.4402552843093872, 0.31696733832359314, -0.13194553554058075, -0.15442007780075073, -0.4114394187927246, -0.16110152006149292, 0.33602333068847656, -0.11759244650602341, -0.0023611020296812057, 0.2234395444393158, 0.1414375901222229, -0.17210370302200317, 0.16304543614387512, 0.6010730862617493, 0.15616893768310547, 0.06398213654756546, -0.48116400837898254, 0.09225215762853622, -0.654445230960846, 0.37945622205734253, -0.2117067128419876, 0.2288445383310318, -0.03422015905380249, -0.1361081600189209, 0.18947649002075195, -0.04405364394187927, 0.5284060835838318, 0.1399570107460022, 0.4141468405723572, -0.08634287118911743, -0.19007882475852966, 0.3500826358795166, -0.0964837521314621, -0.2529028356075287, 0.046082258224487305, 0.4763781726360321, 0.16548539698123932, -0.15995538234710693, -0.3303373157978058, 0.09511794149875641, -0.5765706300735474, -0.31496337056159973, -0.10635056346654892, -0.27314236760139465, -0.3188053071498871, -0.11764100939035416, 0.03381257876753807, -0.07130149751901627, -0.19164608418941498, -0.13877485692501068, -0.08858834207057953, -0.07928071916103363, 0.00051070936024189, 0.11803750693798065, -0.08463707566261292, 0.01420819852501154, -0.07437523454427719, -0.22259002923965454, 0.20088402926921844, 0.26343104243278503, 0.1113884225487709, 0.16100217401981354, 0.04152264446020126, -0.04433169960975647, -0.12766292691230774, -0.05907188728451729, 0.5131096839904785, 0.3734557628631592, -0.20032040774822235, 0.08707703649997711, -0.1733805388212204, 0.4732588529586792, -0.14415644109249115, 0.08109947293996811, 0.23575527966022491, 0.38414478302001953, -0.4848455488681793, -0.2767658829689026, -0.07041215151548386, 0.012207679450511932, -0.10220223665237427, 0.05114610493183136, 0.33298414945602417, -0.4146130681037903, 0.09681539237499237, 0.4138469398021698, 0.8183954954147339, -0.2572377920150757, 0.3583577275276184, 0.455124169588089, 0.26928216218948364, 0.5411075353622437, -0.13739916682243347, -0.4631275534629822, -0.5678379535675049, 0.2299267202615738, -0.07611885666847229, 0.09816363453865051, 0.013893850147724152, -0.24327807128429413, -0.28827786445617676, 0.17173103988170624, -0.12495587766170502, 0.17482870817184448, -0.2001163512468338, 0.2255028784275055, 0.11985372751951218, 0.05119994282722473, -0.23677143454551697, 0.06720102578401566, 0.22354929149150848, 0.1148342490196228, -0.2870689034461975, -0.01636570133268833, 0.2658827006816864, -0.37057244777679443, 0.084398552775383, -0.11327763646841049, -0.06434640288352966, 0.3032160997390747, 0.2771640717983246, 0.03474944829940796, -0.04012344032526016, 0.08712708950042725, 0.5422905087471008, 0.3937964141368866, 0.14811567962169647, -0.010949727147817612, -0.24484166502952576, -0.006482885219156742, -0.2918168306350708, 0.24675247073173523, 0.023753728717565536, 0.07222872972488403, -0.35461992025375366, 0.30323919653892517, 0.193522647023201, -0.18134501576423645, -0.0928044244647026, -0.1284514218568802, 0.4206128716468811, -0.4483557641506195, 0.15870535373687744, -0.11241625249385834, -0.19535982608795166, 0.14258405566215515, 0.08204290270805359, 0.18545688688755035, -0.3022920787334442, -0.029500849545001984, 0.19928163290023804, -0.4388638734817505, -0.0741921067237854, -0.13025200366973877, 0.11499904096126556, -0.20488522946834564, 0.30741339921951294, 0.029879916459321976, -0.0644475519657135, -0.22415396571159363, 0.22338265180587769, 0.0934462696313858, -0.3255036473274231, -0.051476314663887024, 0.33571115136146545, 0.12444941699504852, -0.1692568063735962, 0.22638961672782898, 0.1876836121082306, 0.09835600107908249, -0.21399934589862823, -0.17853900790214539, -0.018560092896223068, 0.06800812482833862, -0.1431371569633484, 0.08861038833856583, 0.3003412187099457, 0.13205520808696747, -0.010292794555425644, -0.21691952645778656, -0.3030804991722107, 0.07895408570766449, -0.08748867362737656, -0.030645400285720825, 0.2779082655906677, -0.053690917789936066, 0.3132043182849884, -0.05544792488217354, 0.11715607345104218, 0.03762221336364746, -0.27267712354660034, -0.16855424642562866, -0.03966537490487099, 0.12519311904907227, 0.11737940460443497, -0.2887888550758362, 0.08386748284101486, 0.04923166334629059, -0.12032125890254974, 0.09488126635551453, 0.3665523827075958, 0.5331292152404785, 0.15313948690891266, 0.2560442388057709, 0.3353843092918396, 0.22631022334098816, -0.05824359506368637, 0.13788078725337982, 0.21513265371322632, 0.2642093002796173, -0.1035318523645401, 0.268617182970047, -0.2760918438434601, -0.050156526267528534, 0.2204575091600418, 0.38025882840156555, 0.339974045753479, 0.03268708288669586, 0.043078333139419556, -0.3249930143356323, 0.07453881204128265, -0.22005458176136017, 0.23373055458068848, 0.055874019861221313, -0.457751601934433, -0.48865941166877747, 0.3148389756679535, 0.19376815855503082, 0.08299406617879868, -0.06329302489757538, -0.12817426025867462, 0.38271865248680115, -0.30967777967453003, 0.5219757556915283, 0.09659788012504578, -0.05415841192007065, 0.16449904441833496, -0.11041461676359177, 0.41939452290534973, -0.07170013338327408, 0.05611923709511757, 0.15328511595726013, -0.38013142347335815, 0.3052400052547455, 0.38507527112960815, 0.4836375415325165, 0.0012050643563270569, 0.10060973465442657, -0.1135956272482872, 0.25828254222869873, -0.01471221074461937, 0.3282911777496338, -0.1675046682357788, -0.2700033187866211, 0.05945942923426628, 0.28417545557022095, -0.26198965311050415, 0.09153981506824493, 0.18306231498718262, 0.33439427614212036, 0.27209287881851196, -0.061051707714796066, -0.29451367259025574, 0.32149118185043335, -0.3693529963493347, 0.020388096570968628, -0.0741749182343483, 0.16874754428863525, -0.06109147146344185, 0.036407191306352615, -0.054547879844903946, -0.44265711307525635, -0.3900009095668793, -0.027228087186813354, -0.004996649920940399, -0.013978628441691399, 0.1366441249847412, -0.028890706598758698, -0.03244449198246002, -0.1651657074689865, 0.00694538839161396, -0.2984108328819275, 0.2984252870082855, 0.5553314089775085, 0.17403912544250488, 0.4184674322605133, 0.2451900690793991, 0.5970751643180847, 0.1120174452662468, -0.28537002205848694, 0.2943582832813263, 0.0994703620672226, 0.2560998201370239, 0.21402446925640106, -0.04754674807190895, 0.2468009740114212, 0.0797821506857872, -0.08176781982183456, -0.17667296528816223, 0.19395887851715088, 0.08967240154743195, -0.05294015258550644, 0.5554108023643494, -0.2563455104827881, -0.2756205201148987, -0.4909018576145172, 0.05251378193497658, -0.5385041236877441, 0.19274365901947021, 0.140855073928833, -0.025798922404646873, 0.2831084132194519, -0.05501239374279976, 0.07926277816295624, -0.05571452155709267, 0.4006943106651306, 0.5329262018203735, -0.1349494457244873, -0.1574523001909256, 0.022881798446178436, -0.5486109256744385, 0.39021071791648865, 0.2360677570104599, 0.04990941286087036, 0.10802725702524185, -0.07057255506515503, -0.0025711506605148315, 0.2434946596622467, 0.06139138340950012, 0.17828787863254547, -0.42086049914360046, -0.36223071813583374, 0.011674515902996063, 0.1529177725315094, 0.09250740706920624, 0.032374754548072815, -0.0752287358045578, -0.11787168681621552, 0.335773229598999, -0.33745962381362915, -0.06907352805137634, -0.23327122628688812, 0.23445343971252441, -0.479137659072876, 0.028704779222607613, 0.28981077671051025, 0.08582224696874619, 0.11086614429950714, 0.19553202390670776, 0.09736855328083038, 0.17716147005558014, -0.06898186355829239, -0.17302846908569336, 0.17212307453155518, -0.03324427083134651, -0.1663595587015152, 0.02854715846478939, -0.03696843609213829, -0.23182019591331482, 0.12027186155319214, 0.1837177723646164, -0.42291349172592163, -0.14403727650642395, 0.12835443019866943, -0.0812436044216156, -0.20505137741565704, -0.18704497814178467, 0.08483521640300751, 0.18121761083602905, 0.23912017047405243, -0.2927095592021942, 0.15876321494579315, 0.5162736177444458, -0.6274538636207581, 0.020654290914535522, -0.4295008182525635, 0.37585222721099854, 0.3357725441455841, -0.5495491027832031, -0.510955274105072, 0.28672900795936584, 0.22139562666416168, -0.1964738667011261, -0.07012565433979034, 0.1184464544057846, -0.4452682137489319, -0.014273278415203094, -0.06239350885152817, 0.3518233597278595, 0.030310137197375298, -0.3941572308540344, 0.29748567938804626, -0.27505409717559814 ]
https://github.com/huggingface/datasets/issues/6410
Datasets does not load HuggingFace Repository properly
Hi! You can avoid the error by requesting only the `jsonl` files. `dataset = load_dataset("ai4privacy/pii-masking-200k", data_files=["*.jsonl"])`. Our data file inference does not filter out (incompatible) `json` files because `json` and `jsonl` use the same builder. Still, I think the inference should differentiate these extensions because it's safe to assume that loading them together will lead to an error. WDYT @lhoestq?
### Describe the bug Dear Datasets team, We just have published a dataset on Huggingface: https://huggingface.co/ai4privacy However, when trying to read it using the Dataset library we get an error. As I understand jsonl files are compatible, could you please clarify how we can solve the issue? Please let me know and we would be more than happy to adapt the structure of the repository or meta data so it works easier: ```python from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ``` ``` Downloading readme: 100% 11.8k/11.8k [00:00<00:00, 512kB/s] Downloading data files: 100% 1/1 [00:11<00:00, 11.16s/it] Downloading data: 100% 64.3M/64.3M [00:02<00:00, 32.9MB/s] Downloading data: 100% 113M/113M [00:03<00:00, 35.0MB/s] Downloading data: 100% 97.7M/97.7M [00:02<00:00, 46.1MB/s] Downloading data: 100% 90.8M/90.8M [00:02<00:00, 44.9MB/s] Downloading data: 100% 7.63k/7.63k [00:00<00:00, 41.0kB/s] Downloading data: 100% 1.03k/1.03k [00:00<00:00, 9.44kB/s] Extracting data files: 100% 1/1 [00:00<00:00, 29.26it/s] Generating train split: 209261/0 [00:05<00:00, 41201.25 examples/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1939 ) -> 1940 writer.write_table(table) 1941 num_examples_progress_update += len(table) 8 frames [/usr/local/lib/python3.10/dist-packages/datasets/arrow_writer.py](https://localhost:8080/#) in write_table(self, pa_table, writer_batch_size) 571 pa_table = pa_table.combine_chunks() --> 572 pa_table = table_cast(pa_table, self._schema) 573 if self.embed_local_files: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in table_cast(table, schema) 2327 if table.schema != schema: -> 2328 return cast_table_to_schema(table, schema) 2329 elif table.schema.metadata != schema.metadata: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in cast_table_to_schema(table, schema) 2285 if sorted(table.column_names) != sorted(features): -> 2286 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2287 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ValueError: Couldn't cast JOBTYPE: int64 PHONEIMEI: int64 ACCOUNTNAME: int64 VEHICLEVIN: int64 GENDER: int64 CURRENCYCODE: int64 CREDITCARDISSUER: int64 JOBTITLE: int64 SEX: int64 CURRENCYSYMBOL: int64 IP: int64 EYECOLOR: int64 MASKEDNUMBER: int64 SECONDARYADDRESS: int64 JOBAREA: int64 ACCOUNTNUMBER: int64 language: string BITCOINADDRESS: int64 MAC: int64 SSN: int64 EMAIL: int64 ETHEREUMADDRESS: int64 DOB: int64 VEHICLEVRM: int64 IPV6: int64 AMOUNT: int64 URL: int64 PHONENUMBER: int64 PIN: int64 TIME: int64 CREDITCARDNUMBER: int64 FIRSTNAME: int64 IBAN: int64 BIC: int64 COUNTY: int64 STATE: int64 LASTNAME: int64 ZIPCODE: int64 HEIGHT: int64 ORDINALDIRECTION: int64 MIDDLENAME: int64 STREET: int64 USERNAME: int64 CURRENCY: int64 PREFIX: int64 USERAGENT: int64 CURRENCYNAME: int64 LITECOINADDRESS: int64 CREDITCARDCVV: int64 AGE: int64 CITY: int64 PASSWORD: int64 BUILDINGNUMBER: int64 IPV4: int64 NEARBYGPSCOORDINATE: int64 DATE: int64 COMPANYNAME: int64 to {'masked_text': Value(dtype='string', id=None), 'unmasked_text': Value(dtype='string', id=None), 'privacy_mask': Value(dtype='string', id=None), 'span_labels': Value(dtype='string', id=None), 'bio_labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'tokenised_text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} because column names don't match The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-f1c6811e9c83>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 dataset = load_dataset("ai4privacy/pii-masking-200k") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 2151 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1959 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Thank you and have a great day ahead ### Steps to reproduce the bug Open Google Colab Notebook: Run command: !pip3 install datasets Run code: from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ### Expected behavior Download the dataset successfully from HuggingFace to the notebook so that we can start working with it ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.19.1 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
60
Datasets does not load HuggingFace Repository properly ### Describe the bug Dear Datasets team, We just have published a dataset on Huggingface: https://huggingface.co/ai4privacy However, when trying to read it using the Dataset library we get an error. As I understand jsonl files are compatible, could you please clarify how we can solve the issue? Please let me know and we would be more than happy to adapt the structure of the repository or meta data so it works easier: ```python from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ``` ``` Downloading readme: 100% 11.8k/11.8k [00:00<00:00, 512kB/s] Downloading data files: 100% 1/1 [00:11<00:00, 11.16s/it] Downloading data: 100% 64.3M/64.3M [00:02<00:00, 32.9MB/s] Downloading data: 100% 113M/113M [00:03<00:00, 35.0MB/s] Downloading data: 100% 97.7M/97.7M [00:02<00:00, 46.1MB/s] Downloading data: 100% 90.8M/90.8M [00:02<00:00, 44.9MB/s] Downloading data: 100% 7.63k/7.63k [00:00<00:00, 41.0kB/s] Downloading data: 100% 1.03k/1.03k [00:00<00:00, 9.44kB/s] Extracting data files: 100% 1/1 [00:00<00:00, 29.26it/s] Generating train split: 209261/0 [00:05<00:00, 41201.25 examples/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1939 ) -> 1940 writer.write_table(table) 1941 num_examples_progress_update += len(table) 8 frames [/usr/local/lib/python3.10/dist-packages/datasets/arrow_writer.py](https://localhost:8080/#) in write_table(self, pa_table, writer_batch_size) 571 pa_table = pa_table.combine_chunks() --> 572 pa_table = table_cast(pa_table, self._schema) 573 if self.embed_local_files: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in table_cast(table, schema) 2327 if table.schema != schema: -> 2328 return cast_table_to_schema(table, schema) 2329 elif table.schema.metadata != schema.metadata: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in cast_table_to_schema(table, schema) 2285 if sorted(table.column_names) != sorted(features): -> 2286 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2287 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ValueError: Couldn't cast JOBTYPE: int64 PHONEIMEI: int64 ACCOUNTNAME: int64 VEHICLEVIN: int64 GENDER: int64 CURRENCYCODE: int64 CREDITCARDISSUER: int64 JOBTITLE: int64 SEX: int64 CURRENCYSYMBOL: int64 IP: int64 EYECOLOR: int64 MASKEDNUMBER: int64 SECONDARYADDRESS: int64 JOBAREA: int64 ACCOUNTNUMBER: int64 language: string BITCOINADDRESS: int64 MAC: int64 SSN: int64 EMAIL: int64 ETHEREUMADDRESS: int64 DOB: int64 VEHICLEVRM: int64 IPV6: int64 AMOUNT: int64 URL: int64 PHONENUMBER: int64 PIN: int64 TIME: int64 CREDITCARDNUMBER: int64 FIRSTNAME: int64 IBAN: int64 BIC: int64 COUNTY: int64 STATE: int64 LASTNAME: int64 ZIPCODE: int64 HEIGHT: int64 ORDINALDIRECTION: int64 MIDDLENAME: int64 STREET: int64 USERNAME: int64 CURRENCY: int64 PREFIX: int64 USERAGENT: int64 CURRENCYNAME: int64 LITECOINADDRESS: int64 CREDITCARDCVV: int64 AGE: int64 CITY: int64 PASSWORD: int64 BUILDINGNUMBER: int64 IPV4: int64 NEARBYGPSCOORDINATE: int64 DATE: int64 COMPANYNAME: int64 to {'masked_text': Value(dtype='string', id=None), 'unmasked_text': Value(dtype='string', id=None), 'privacy_mask': Value(dtype='string', id=None), 'span_labels': Value(dtype='string', id=None), 'bio_labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'tokenised_text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} because column names don't match The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-f1c6811e9c83>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 dataset = load_dataset("ai4privacy/pii-masking-200k") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 2151 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1959 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Thank you and have a great day ahead ### Steps to reproduce the bug Open Google Colab Notebook: Run command: !pip3 install datasets Run code: from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ### Expected behavior Download the dataset successfully from HuggingFace to the notebook so that we can start working with it ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.19.1 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Hi! You can avoid the error by requesting only the `jsonl` files. `dataset = load_dataset("ai4privacy/pii-masking-200k", data_files=["*.jsonl"])`. Our data file inference does not filter out (incompatible) `json` files because `json` and `jsonl` use the same builder. Still, I think the inference should differentiate these extensions because it's safe to assume that loading them together will lead to an error. WDYT @lhoestq?
[ -0.20247381925582886, -0.10110720992088318, -0.02674979344010353, 0.7637386322021484, 0.29011261463165283, -0.036524467170238495, -0.002035807818174362, 0.24975982308387756, 0.01940387487411499, 0.02537655085325241, -0.23642505705356598, 0.22523406147956848, -0.05940558761358261, 0.33194056153297424, -0.197702556848526, -0.15407513082027435, 0.07021711766719818, -0.0067133828997612, -0.0805298238992691, -0.0777130126953125, -0.18396633863449097, 0.4110555350780487, -0.22362618148326874, 0.048238303512334824, -0.029984239488840103, -0.05064855515956879, 0.17148993909358978, 0.26710373163223267, -0.2626782953739166, -0.23698051273822784, 0.41195541620254517, -0.043915215879678726, 0.22523942589759827, 0.5600349307060242, -0.00011539299157448113, 0.1615811437368393, 0.4242146611213684, -0.10914651304483414, -0.06255217641592026, -0.4684287905693054, -0.25206565856933594, -0.2341770976781845, 0.14121946692466736, -0.0691816508769989, -0.36504286527633667, -0.11138438433408737, -0.013845829293131828, -0.19534297287464142, 0.4941519498825073, 0.07767364382743835, 0.22991761565208435, 0.43579912185668945, 0.3726672828197479, 0.06933628767728806, -0.04540591686964035, 0.13839134573936462, -0.13756567239761353, 0.313513845205307, -0.061957597732543945, 0.2884894013404846, 0.050943903625011444, 0.31747207045555115, -0.05821157619357109, -0.15923377871513367, 0.3427141308784485, 0.03549183905124664, -0.17736953496932983, -0.2504197359085083, 0.12472623586654663, 0.19873884320259094, 0.49338075518608093, -0.277078241109848, -0.3841599225997925, -0.20938682556152344, -0.060792475938797, -0.12001072615385056, 0.4321158230304718, 0.10829775035381317, 0.07798635959625244, 0.3454265594482422, -0.28139761090278625, -0.21840018033981323, -0.2560521960258484, 0.2808377146720886, 0.13281871378421783, 0.11175242066383362, -0.3081073462963104, 0.09662860631942749, 0.10155429691076279, -0.21841998398303986, -0.22994980216026306, -0.004881503060460091, 0.0394446924328804, 0.15918779373168945, -0.24204419553279877, 0.06369540840387344, -0.21265578269958496, 0.22232288122177124, 0.46649986505508423, 0.4229540228843689, -0.17232076823711395, 0.0033790767192840576, -0.35443443059921265, 0.12322869896888733, 0.4183110296726227, 0.08599017560482025, -0.07033411413431168, 0.023046355694532394, 0.3201691508293152, 0.25729942321777344, 0.09269200265407562, 0.005155745893716812, -0.24215218424797058, -0.08543631434440613, -0.18892279267311096, -0.34445077180862427, 0.26180630922317505, -0.3669191002845764, -0.3093154728412628, 0.12911829352378845, -0.40077823400497437, -0.07702098041772842, 0.21579128503799438, 0.3830742835998535, -0.09406869858503342, 0.2047170102596283, 0.1130802184343338, 0.20815177261829376, -0.16297464072704315, -0.15690822899341583, -0.1751745492219925, -0.04473667964339256, -0.01565418392419815, -0.05961774289608002, 0.08046256005764008, -0.4342638850212097, 0.5156291127204895, -0.01775173842906952, 0.07787549495697021, -0.12811344861984253, -0.11275089532136917, -0.012672248296439648, -0.09444794803857803, 0.2611476182937622, 0.18274535238742828, 0.12268377095460892, 0.033325761556625366, -0.10955758392810822, -0.22089552879333496, 0.0006978735327720642, -0.2639509439468384, 0.000512436032295227, -0.04591839015483856, 0.13810168206691742, -0.30090999603271484, 0.07131409645080566, -0.6343057751655579, 0.10518446564674377, -0.12859535217285156, -0.03540215268731117, -0.034559570252895355, 0.050373539328575134, -0.08123727887868881, -0.1661003828048706, 0.46981945633888245, 0.3977956771850586, -0.13455404341220856, -0.22893992066383362, 0.05104275047779083, -0.4074135422706604, 0.09864579141139984, 0.4718937575817108, -0.07097533345222473, -0.19432547688484192, -0.19998732209205627, 0.15202093124389648, -0.002776987850666046, -0.31749480962753296, -0.6252052187919617, 0.4136505722999573, -0.054186005145311356, 0.3294575810432434, -0.0975077673792839, 0.17960914969444275, -0.14945948123931885, 0.12647688388824463, -0.06219969689846039, 0.2430829405784607, 0.0617683082818985, -0.047010742127895355, -0.15720035135746002, -0.4699111580848694, 0.14638164639472961, 0.2087666243314743, -0.11007586121559143, 0.055509746074676514, 0.07998033612966537, -0.03686186298727989, 0.3494212329387665, 0.15941913425922394, 0.0013809846714138985, 0.15586046874523163, 0.29573097825050354, 0.15482857823371887, 0.08039431273937225, 0.004562877118587494, -0.7193068861961365, 0.1443626880645752, 0.1576097309589386, -0.02833789587020874, -0.20268265902996063, -0.07543997466564178, -0.2803953289985657, 0.07065238058567047, -0.33862119913101196, -0.016489144414663315, 0.01749512553215027, -0.03720347583293915, 0.1338711977005005, 0.10760888457298279, -0.288686603307724, 0.5915173888206482, 0.07636108249425888, 0.24873073399066925, -0.7363877296447754, 0.3233526051044464, -0.12542961537837982, 0.07203573733568192, 0.3358301818370819, 0.2443685531616211, 0.14688356220722198, -0.2681548595428467, -0.08777248859405518, 0.36744481325149536, 0.0037033739499747753, 0.16281190514564514, -0.02457793802022934, 0.2279054820537567, 0.23427774012088776, -0.3399718403816223, -0.0690237358212471, 0.2293630987405777, 0.048938702791929245, 0.056464485824108124, -0.15987205505371094, 0.3210492730140686, 0.00040132924914360046, 0.17622490227222443, -0.039893195033073425, -0.04671258106827736, 0.42490890622138977, -0.030492320656776428, -0.3012361526489258, -0.15077437460422516, 0.29908373951911926, -0.06348761916160583, 0.4037567377090454, 0.1324222832918167, -0.4345090091228485, -0.2680304944515228, 0.171720489859581, -0.013787580654025078, -0.13268810510635376, 0.21244549751281738, -0.2522708773612976, 0.09649985283613205, 0.10935121774673462, 0.022893670946359634, 0.14948703348636627, 0.11884310841560364, -0.21434465050697327, 0.22422419488430023, 0.10149209201335907, -0.18704593181610107, -0.06231088191270828, 0.03780751675367355, 0.14723064005374908, 0.028224650770425797, 0.0038132392801344395, 0.08014075458049774, -0.2904886305332184, -0.02699051797389984, -0.144304558634758, 0.30486324429512024, -0.332506000995636, 0.02329966612160206, -0.24856215715408325, -0.34044358134269714, -0.1702061891555786, -0.03587136045098305, -0.3832475244998932, -0.12993621826171875, -0.31002599000930786, 0.2699487507343292, 0.0532621331512928, 0.03153034299612045, -0.13614538311958313, 0.15964943170547485, 0.049906425178050995, -0.1642218828201294, -0.2597725987434387, -0.01445763185620308, -0.3224999010562897, 0.030660327523946762, 0.451740562915802, 0.10537499189376831, 0.33262404799461365, -0.27288204431533813, -0.012041714042425156, -0.22841235995292664, -0.3156466782093048, 0.16164737939834595, -0.10869307816028595, 0.33598455786705017, 0.03785323724150658, 0.1136995330452919, 0.001905888319015503, -0.09790591895580292, 0.35575932264328003, -0.1205890104174614, -0.292610228061676, -0.0582878515124321, -0.07153282314538956, -0.22865982353687286, -0.14093050360679626, -0.36862948536872864, -0.14724144339561462, -0.19850805401802063, 0.44963735342025757, 0.05118546262383461, -0.07792946696281433, 0.23582212626934052, 0.04422350972890854, 0.10916909575462341, -0.020175186917185783, -0.11052090674638748, -0.2128290832042694, -0.5246166586875916, 0.23329958319664001, -0.17592522501945496, -0.40888532996177673, 0.06409195065498352, 0.1472480595111847, 0.18747052550315857, 0.04345507174730301, -0.5981343984603882, -0.1847369223833084, -0.12044721841812134, 0.08401425182819366, -0.07460738718509674, -0.009697629138827324, -0.10344655811786652, -0.08294658362865448, 0.19064779579639435, -0.15273934602737427, -0.3743159770965576, 0.1797843873500824, -0.2710201144218445, 0.226533904671669, 0.20180216431617737, 0.5189443826675415, -0.13793613016605377, 0.3214726150035858, 0.5626809000968933, -0.24526695907115936, 0.2880079448223114, -0.04369988292455673, 0.41803982853889465, 0.04831286892294884, -0.25480738282203674, 0.022984063252806664, 0.08070197701454163, 0.12746424973011017, 0.21698921918869019, 0.2044336199760437, 0.18240521848201752, -0.2793234586715698, -0.16923338174819946, -0.3800138235092163, -0.19066524505615234, -0.13000300526618958, 0.22610676288604736, 0.1676928699016571, 0.09864553809165955, 0.08985576778650284, 0.1228490024805069, -0.1714968979358673, 0.21571952104568481, 0.5035192370414734, 0.11829986423254013, 0.21935944259166718, -0.5257461667060852, 0.017707236111164093, -0.507720947265625, 0.27123433351516724, -0.03700747713446617, 0.254670649766922, 0.01624620333313942, 0.21616286039352417, 0.10600762814283371, -0.07404464483261108, 0.6631453037261963, 0.04926784336566925, 0.03320608660578728, -0.004812926985323429, -0.10114696621894836, -0.2398444563150406, 0.18723225593566895, -0.07081235200166702, 0.08888231962919235, 0.21213698387145996, 0.7063567638397217, -0.4514238238334656, -0.20542360842227936, 0.12118065357208252, 0.11702723801136017, -0.1359657496213913, -0.28152790665626526, -0.3058297038078308, -0.38528916239738464, -0.29757487773895264, -0.21367880702018738, -0.04433904215693474, 0.2446925789117813, 0.07425548881292343, 0.011200807988643646, -0.000026404857635498047, -0.07704181969165802, 0.18158495426177979, 0.31038200855255127, 0.37053924798965454, 0.07067549228668213, 0.3404732644557953, 0.5007097721099854, 0.2653319537639618, 0.4988623261451721, 0.8047417402267456, -0.017566125839948654, -0.45291733741760254, -0.12743812799453735, 0.041094664484262466, 0.12312135845422745, 0.050334632396698, -0.19158950448036194, 0.09310223162174225, 0.19558818638324738, 0.023464906960725784, -0.2479819655418396, 0.11186511069536209, 0.2389686405658722, 0.15938006341457367, -0.41256412863731384, -0.5046038627624512, 0.4951017498970032, 0.142174631357193, 0.13907882571220398, -0.13802841305732727, 0.3588564991950989, -0.16755878925323486, 0.08367922902107239, -0.15587249398231506, 0.73856520652771, -0.11550714075565338, -0.12011276185512543, 0.4804933965206146, -0.10578751564025879, 0.4779645502567291, -0.18989217281341553, -0.07225477695465088, -0.32549387216567993, 0.06904971599578857, -0.07889371365308762, -0.06683135777711868, 0.10766839981079102, 0.036303333938121796, 0.019811902195215225, 0.2584361732006073, -0.02345499023795128, -0.04241687431931496, -0.04444608837366104, 0.375176340341568, 0.05122353136539459, -0.03467325121164322, -0.597671627998352, 0.13821662962436676, -0.08328066766262054, 0.3743554651737213, -0.0750819742679596, -0.19063758850097656, -0.21859602630138397, -0.14320851862430573, -0.26256048679351807, 0.1527080237865448, -0.25523641705513, 0.022702395915985107, 0.3385934829711914, -0.181904599070549, 0.3040744960308075, 0.2643655240535736, 0.33130019903182983, 0.08245175331830978, -0.34315112233161926, 0.12050877511501312, -0.2951098680496216, -0.11836536973714828, -0.0331815704703331, 0.12740729749202728, 0.07646073400974274, -0.1028551310300827, 0.0038127824664115906, -0.11559445410966873, -0.013661612756550312, -0.2787894606590271, -0.014776572585105896, -0.039660245180130005, -0.08635668456554413, -0.19774380326271057, -0.25004011392593384, -0.10010424256324768, 0.1669895201921463, -0.1332102119922638, 0.045710232108831406, 0.2940506935119629, 0.12465112656354904, -0.15247651934623718, 0.2960304617881775, -0.19601798057556152, -0.13677802681922913, 0.3349497318267822, -0.21826118230819702, -0.21518927812576294, 0.3315216302871704, 0.31777143478393555, -0.12637367844581604, -0.052233051508665085, 0.10451992601156235, 0.49760445952415466, -0.3095422089099884, -0.010570480488240719, 0.05219089239835739, 0.06116338074207306, -0.11487989127635956, 0.2355176955461502, 0.2599697709083557, -0.20308583974838257, 0.29715657234191895, -0.4844920337200165, -0.2017183005809784, 0.4178645610809326, -0.08404743671417236, 0.006936464458703995, 0.21888414025306702, 0.09626355767250061, -0.19302107393741608, -0.21702595055103302, -0.22470971941947937, 0.1237979307770729, -0.24961049854755402, -0.07066787034273148, 0.3121758997440338, 0.08744172751903534, 0.31991711258888245, -0.0965956449508667, 0.061584390699863434, 0.04809548705816269, -0.2660202980041504, -0.07802994549274445, -0.3167242407798767, 0.10665599256753922, 0.11895716935396194, -0.31562539935112, -0.029634281992912292, -0.2004498839378357, -0.14277321100234985, -0.1237369179725647, 0.12520062923431396, 0.23697328567504883, 0.13535858690738678, -0.02059805765748024, -0.024470631033182144, 0.09801431745290756, -0.34452617168426514, 0.18352922797203064, 0.04641568288207054, 0.20472252368927002, 0.13039833307266235, -0.027025461196899414, -0.05414682254195213, 0.06255333125591278, -0.09366985410451889, 0.060994502156972885, 0.34885162115097046, 0.10196281224489212, 0.3680061399936676, -0.249899223446846, 0.1352098137140274, 0.4168151021003723, 0.3914455771446228, 0.3551637828350067, -0.2431183010339737, 0.11810795962810516, 0.25968578457832336, 0.13151569664478302, -0.268435537815094, -0.04142395406961441, 0.39415425062179565, 0.00007496774196624756, -0.031743839383125305, 0.17688412964344025, 0.08875863254070282, 0.32140061259269714, -0.08776310086250305, 0.10360060632228851, 0.613784670829773, 0.19308961927890778, 0.15527749061584473, 0.058872248977422714, -0.06154597923159599, 0.155495285987854, 0.09089650958776474, 0.17786070704460144, 0.22377821803092957, 0.23561795055866241, -0.15413835644721985, 0.1756540685892105, -0.12040282040834427, 0.31272563338279724, 0.1214202344417572, -0.47684386372566223, -0.31559261679649353, 0.25574517250061035, -0.059661611914634705, 0.1949254870414734, -0.09525679051876068, 0.3713388442993164, 0.02591419219970703, -0.07254143804311752, -0.07804447412490845, 0.12425269186496735, -0.14275473356246948, -0.11394990980625153, -0.0007455311715602875, -0.28741729259490967, -0.23237358033657074, 0.048020947724580765, -0.19419245421886444, -0.2181088775396347, 0.1489066779613495, 0.03446536883711815, -0.21625028550624847, -0.5780243277549744, -0.007442213594913483, 0.22299319505691528, -0.04324359446763992, -0.2477247714996338, 0.4129679501056671, 0.09426752477884293, -0.25601789355278015, 0.09598623216152191, 0.2661064863204956, 0.3129103481769562, 0.2327461689710617, 0.37607306241989136, -0.10351985692977905, -0.04503948614001274, -0.05271551012992859, -0.12349975109100342, 0.20679005980491638, 0.042973581701517105, 0.07748623192310333, 0.2280913144350052, 0.10782656818628311, -0.06359178572893143, 0.009486518800258636, -0.0003147311508655548, 0.4221016764640808, -0.43171074986457825, 0.21660250425338745, -0.7187114953994751, -0.020847439765930176, -0.34360307455062866, -0.11631595343351364, -0.1931624710559845, 0.13252706825733185, 0.11412650346755981, 0.07093153148889542, 0.1327282190322876, -0.17743580043315887, 0.0521107092499733, 0.016774971038103104, 0.42204540967941284, 0.5924479365348816, 0.02907843329012394, -0.12554016709327698, -0.2913059890270233, -0.8193529844284058, 0.29711705446243286, -0.155803382396698, 0.017960200086236, 0.06036932393908501, 0.02670573629438877, -0.007836513221263885, 0.08274242281913757, -0.08318136632442474, -0.07084067165851593, 0.1285131722688675, -0.15619602799415588, -0.2198765128850937, -0.21486683189868927, -0.02280373126268387, -0.06620629876852036, 0.03666076809167862, -0.16657492518424988, 0.2792084217071533, -0.07481151819229126, -0.10824154317378998, -0.25686585903167725, 0.28905534744262695, -0.3066962659358978, -0.19204197824001312, 0.1332460641860962, 0.2954002618789673, 0.3996940553188324, -0.08628252148628235, -0.23542368412017822, -0.33384495973587036, -0.2283172309398651, -0.2686620056629181, 0.38952305912971497, -0.10185706615447998, 0.5360653400421143, -0.27261820435523987, -0.11437872052192688, -0.4133925437927246, 0.14993204176425934, 0.017652668058872223, -0.15189528465270996, -0.34477341175079346, 0.21404406428337097, -0.3010542392730713, 0.06392909586429596, 0.11444747447967529, 0.3288857936859131, -0.04183413088321686, 0.0408686026930809, -0.12869754433631897, -0.1326177418231964, 0.4424443244934082, -0.4650462567806244, -0.08111029863357544, 0.09331609308719635, -0.07844695448875427, 0.15513235330581665, -0.3431035578250885, -0.5295788049697876, 0.1984872817993164, 0.2511199414730072, -0.017208769917488098, -0.28559520840644836, 0.1455519199371338, 0.05116674676537514, -0.10156641155481339, 0.012636806815862656, 0.37285634875297546, 0.333425909280777, -0.3731309175491333, 0.5766471028327942, -0.1030370369553566 ]
https://github.com/huggingface/datasets/issues/6410
Datasets does not load HuggingFace Repository properly
Raising an error if there is a mix of json and jsonl in the builder makes sense yea
### Describe the bug Dear Datasets team, We just have published a dataset on Huggingface: https://huggingface.co/ai4privacy However, when trying to read it using the Dataset library we get an error. As I understand jsonl files are compatible, could you please clarify how we can solve the issue? Please let me know and we would be more than happy to adapt the structure of the repository or meta data so it works easier: ```python from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ``` ``` Downloading readme: 100% 11.8k/11.8k [00:00<00:00, 512kB/s] Downloading data files: 100% 1/1 [00:11<00:00, 11.16s/it] Downloading data: 100% 64.3M/64.3M [00:02<00:00, 32.9MB/s] Downloading data: 100% 113M/113M [00:03<00:00, 35.0MB/s] Downloading data: 100% 97.7M/97.7M [00:02<00:00, 46.1MB/s] Downloading data: 100% 90.8M/90.8M [00:02<00:00, 44.9MB/s] Downloading data: 100% 7.63k/7.63k [00:00<00:00, 41.0kB/s] Downloading data: 100% 1.03k/1.03k [00:00<00:00, 9.44kB/s] Extracting data files: 100% 1/1 [00:00<00:00, 29.26it/s] Generating train split: 209261/0 [00:05<00:00, 41201.25 examples/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1939 ) -> 1940 writer.write_table(table) 1941 num_examples_progress_update += len(table) 8 frames [/usr/local/lib/python3.10/dist-packages/datasets/arrow_writer.py](https://localhost:8080/#) in write_table(self, pa_table, writer_batch_size) 571 pa_table = pa_table.combine_chunks() --> 572 pa_table = table_cast(pa_table, self._schema) 573 if self.embed_local_files: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in table_cast(table, schema) 2327 if table.schema != schema: -> 2328 return cast_table_to_schema(table, schema) 2329 elif table.schema.metadata != schema.metadata: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in cast_table_to_schema(table, schema) 2285 if sorted(table.column_names) != sorted(features): -> 2286 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2287 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ValueError: Couldn't cast JOBTYPE: int64 PHONEIMEI: int64 ACCOUNTNAME: int64 VEHICLEVIN: int64 GENDER: int64 CURRENCYCODE: int64 CREDITCARDISSUER: int64 JOBTITLE: int64 SEX: int64 CURRENCYSYMBOL: int64 IP: int64 EYECOLOR: int64 MASKEDNUMBER: int64 SECONDARYADDRESS: int64 JOBAREA: int64 ACCOUNTNUMBER: int64 language: string BITCOINADDRESS: int64 MAC: int64 SSN: int64 EMAIL: int64 ETHEREUMADDRESS: int64 DOB: int64 VEHICLEVRM: int64 IPV6: int64 AMOUNT: int64 URL: int64 PHONENUMBER: int64 PIN: int64 TIME: int64 CREDITCARDNUMBER: int64 FIRSTNAME: int64 IBAN: int64 BIC: int64 COUNTY: int64 STATE: int64 LASTNAME: int64 ZIPCODE: int64 HEIGHT: int64 ORDINALDIRECTION: int64 MIDDLENAME: int64 STREET: int64 USERNAME: int64 CURRENCY: int64 PREFIX: int64 USERAGENT: int64 CURRENCYNAME: int64 LITECOINADDRESS: int64 CREDITCARDCVV: int64 AGE: int64 CITY: int64 PASSWORD: int64 BUILDINGNUMBER: int64 IPV4: int64 NEARBYGPSCOORDINATE: int64 DATE: int64 COMPANYNAME: int64 to {'masked_text': Value(dtype='string', id=None), 'unmasked_text': Value(dtype='string', id=None), 'privacy_mask': Value(dtype='string', id=None), 'span_labels': Value(dtype='string', id=None), 'bio_labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'tokenised_text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} because column names don't match The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-f1c6811e9c83>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 dataset = load_dataset("ai4privacy/pii-masking-200k") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 2151 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1959 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Thank you and have a great day ahead ### Steps to reproduce the bug Open Google Colab Notebook: Run command: !pip3 install datasets Run code: from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ### Expected behavior Download the dataset successfully from HuggingFace to the notebook so that we can start working with it ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.19.1 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
18
Datasets does not load HuggingFace Repository properly ### Describe the bug Dear Datasets team, We just have published a dataset on Huggingface: https://huggingface.co/ai4privacy However, when trying to read it using the Dataset library we get an error. As I understand jsonl files are compatible, could you please clarify how we can solve the issue? Please let me know and we would be more than happy to adapt the structure of the repository or meta data so it works easier: ```python from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ``` ``` Downloading readme: 100% 11.8k/11.8k [00:00<00:00, 512kB/s] Downloading data files: 100% 1/1 [00:11<00:00, 11.16s/it] Downloading data: 100% 64.3M/64.3M [00:02<00:00, 32.9MB/s] Downloading data: 100% 113M/113M [00:03<00:00, 35.0MB/s] Downloading data: 100% 97.7M/97.7M [00:02<00:00, 46.1MB/s] Downloading data: 100% 90.8M/90.8M [00:02<00:00, 44.9MB/s] Downloading data: 100% 7.63k/7.63k [00:00<00:00, 41.0kB/s] Downloading data: 100% 1.03k/1.03k [00:00<00:00, 9.44kB/s] Extracting data files: 100% 1/1 [00:00<00:00, 29.26it/s] Generating train split: 209261/0 [00:05<00:00, 41201.25 examples/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1939 ) -> 1940 writer.write_table(table) 1941 num_examples_progress_update += len(table) 8 frames [/usr/local/lib/python3.10/dist-packages/datasets/arrow_writer.py](https://localhost:8080/#) in write_table(self, pa_table, writer_batch_size) 571 pa_table = pa_table.combine_chunks() --> 572 pa_table = table_cast(pa_table, self._schema) 573 if self.embed_local_files: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in table_cast(table, schema) 2327 if table.schema != schema: -> 2328 return cast_table_to_schema(table, schema) 2329 elif table.schema.metadata != schema.metadata: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in cast_table_to_schema(table, schema) 2285 if sorted(table.column_names) != sorted(features): -> 2286 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2287 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ValueError: Couldn't cast JOBTYPE: int64 PHONEIMEI: int64 ACCOUNTNAME: int64 VEHICLEVIN: int64 GENDER: int64 CURRENCYCODE: int64 CREDITCARDISSUER: int64 JOBTITLE: int64 SEX: int64 CURRENCYSYMBOL: int64 IP: int64 EYECOLOR: int64 MASKEDNUMBER: int64 SECONDARYADDRESS: int64 JOBAREA: int64 ACCOUNTNUMBER: int64 language: string BITCOINADDRESS: int64 MAC: int64 SSN: int64 EMAIL: int64 ETHEREUMADDRESS: int64 DOB: int64 VEHICLEVRM: int64 IPV6: int64 AMOUNT: int64 URL: int64 PHONENUMBER: int64 PIN: int64 TIME: int64 CREDITCARDNUMBER: int64 FIRSTNAME: int64 IBAN: int64 BIC: int64 COUNTY: int64 STATE: int64 LASTNAME: int64 ZIPCODE: int64 HEIGHT: int64 ORDINALDIRECTION: int64 MIDDLENAME: int64 STREET: int64 USERNAME: int64 CURRENCY: int64 PREFIX: int64 USERAGENT: int64 CURRENCYNAME: int64 LITECOINADDRESS: int64 CREDITCARDCVV: int64 AGE: int64 CITY: int64 PASSWORD: int64 BUILDINGNUMBER: int64 IPV4: int64 NEARBYGPSCOORDINATE: int64 DATE: int64 COMPANYNAME: int64 to {'masked_text': Value(dtype='string', id=None), 'unmasked_text': Value(dtype='string', id=None), 'privacy_mask': Value(dtype='string', id=None), 'span_labels': Value(dtype='string', id=None), 'bio_labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'tokenised_text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} because column names don't match The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-f1c6811e9c83>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 dataset = load_dataset("ai4privacy/pii-masking-200k") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 2151 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1959 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Thank you and have a great day ahead ### Steps to reproduce the bug Open Google Colab Notebook: Run command: !pip3 install datasets Run code: from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ### Expected behavior Download the dataset successfully from HuggingFace to the notebook so that we can start working with it ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.19.1 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Raising an error if there is a mix of json and jsonl in the builder makes sense yea
[ -0.20247381925582886, -0.10110720992088318, -0.02674979344010353, 0.7637386322021484, 0.29011261463165283, -0.036524467170238495, -0.002035807818174362, 0.24975982308387756, 0.01940387487411499, 0.02537655085325241, -0.23642505705356598, 0.22523406147956848, -0.05940558761358261, 0.33194056153297424, -0.197702556848526, -0.15407513082027435, 0.07021711766719818, -0.0067133828997612, -0.0805298238992691, -0.0777130126953125, -0.18396633863449097, 0.4110555350780487, -0.22362618148326874, 0.048238303512334824, -0.029984239488840103, -0.05064855515956879, 0.17148993909358978, 0.26710373163223267, -0.2626782953739166, -0.23698051273822784, 0.41195541620254517, -0.043915215879678726, 0.22523942589759827, 0.5600349307060242, -0.00011539299157448113, 0.1615811437368393, 0.4242146611213684, -0.10914651304483414, -0.06255217641592026, -0.4684287905693054, -0.25206565856933594, -0.2341770976781845, 0.14121946692466736, -0.0691816508769989, -0.36504286527633667, -0.11138438433408737, -0.013845829293131828, -0.19534297287464142, 0.4941519498825073, 0.07767364382743835, 0.22991761565208435, 0.43579912185668945, 0.3726672828197479, 0.06933628767728806, -0.04540591686964035, 0.13839134573936462, -0.13756567239761353, 0.313513845205307, -0.061957597732543945, 0.2884894013404846, 0.050943903625011444, 0.31747207045555115, -0.05821157619357109, -0.15923377871513367, 0.3427141308784485, 0.03549183905124664, -0.17736953496932983, -0.2504197359085083, 0.12472623586654663, 0.19873884320259094, 0.49338075518608093, -0.277078241109848, -0.3841599225997925, -0.20938682556152344, -0.060792475938797, -0.12001072615385056, 0.4321158230304718, 0.10829775035381317, 0.07798635959625244, 0.3454265594482422, -0.28139761090278625, -0.21840018033981323, -0.2560521960258484, 0.2808377146720886, 0.13281871378421783, 0.11175242066383362, -0.3081073462963104, 0.09662860631942749, 0.10155429691076279, -0.21841998398303986, -0.22994980216026306, -0.004881503060460091, 0.0394446924328804, 0.15918779373168945, -0.24204419553279877, 0.06369540840387344, -0.21265578269958496, 0.22232288122177124, 0.46649986505508423, 0.4229540228843689, -0.17232076823711395, 0.0033790767192840576, -0.35443443059921265, 0.12322869896888733, 0.4183110296726227, 0.08599017560482025, -0.07033411413431168, 0.023046355694532394, 0.3201691508293152, 0.25729942321777344, 0.09269200265407562, 0.005155745893716812, -0.24215218424797058, -0.08543631434440613, -0.18892279267311096, -0.34445077180862427, 0.26180630922317505, -0.3669191002845764, -0.3093154728412628, 0.12911829352378845, -0.40077823400497437, -0.07702098041772842, 0.21579128503799438, 0.3830742835998535, -0.09406869858503342, 0.2047170102596283, 0.1130802184343338, 0.20815177261829376, -0.16297464072704315, -0.15690822899341583, -0.1751745492219925, -0.04473667964339256, -0.01565418392419815, -0.05961774289608002, 0.08046256005764008, -0.4342638850212097, 0.5156291127204895, -0.01775173842906952, 0.07787549495697021, -0.12811344861984253, -0.11275089532136917, -0.012672248296439648, -0.09444794803857803, 0.2611476182937622, 0.18274535238742828, 0.12268377095460892, 0.033325761556625366, -0.10955758392810822, -0.22089552879333496, 0.0006978735327720642, -0.2639509439468384, 0.000512436032295227, -0.04591839015483856, 0.13810168206691742, -0.30090999603271484, 0.07131409645080566, -0.6343057751655579, 0.10518446564674377, -0.12859535217285156, -0.03540215268731117, -0.034559570252895355, 0.050373539328575134, -0.08123727887868881, -0.1661003828048706, 0.46981945633888245, 0.3977956771850586, -0.13455404341220856, -0.22893992066383362, 0.05104275047779083, -0.4074135422706604, 0.09864579141139984, 0.4718937575817108, -0.07097533345222473, -0.19432547688484192, -0.19998732209205627, 0.15202093124389648, -0.002776987850666046, -0.31749480962753296, -0.6252052187919617, 0.4136505722999573, -0.054186005145311356, 0.3294575810432434, -0.0975077673792839, 0.17960914969444275, -0.14945948123931885, 0.12647688388824463, -0.06219969689846039, 0.2430829405784607, 0.0617683082818985, -0.047010742127895355, -0.15720035135746002, -0.4699111580848694, 0.14638164639472961, 0.2087666243314743, -0.11007586121559143, 0.055509746074676514, 0.07998033612966537, -0.03686186298727989, 0.3494212329387665, 0.15941913425922394, 0.0013809846714138985, 0.15586046874523163, 0.29573097825050354, 0.15482857823371887, 0.08039431273937225, 0.004562877118587494, -0.7193068861961365, 0.1443626880645752, 0.1576097309589386, -0.02833789587020874, -0.20268265902996063, -0.07543997466564178, -0.2803953289985657, 0.07065238058567047, -0.33862119913101196, -0.016489144414663315, 0.01749512553215027, -0.03720347583293915, 0.1338711977005005, 0.10760888457298279, -0.288686603307724, 0.5915173888206482, 0.07636108249425888, 0.24873073399066925, -0.7363877296447754, 0.3233526051044464, -0.12542961537837982, 0.07203573733568192, 0.3358301818370819, 0.2443685531616211, 0.14688356220722198, -0.2681548595428467, -0.08777248859405518, 0.36744481325149536, 0.0037033739499747753, 0.16281190514564514, -0.02457793802022934, 0.2279054820537567, 0.23427774012088776, -0.3399718403816223, -0.0690237358212471, 0.2293630987405777, 0.048938702791929245, 0.056464485824108124, -0.15987205505371094, 0.3210492730140686, 0.00040132924914360046, 0.17622490227222443, -0.039893195033073425, -0.04671258106827736, 0.42490890622138977, -0.030492320656776428, -0.3012361526489258, -0.15077437460422516, 0.29908373951911926, -0.06348761916160583, 0.4037567377090454, 0.1324222832918167, -0.4345090091228485, -0.2680304944515228, 0.171720489859581, -0.013787580654025078, -0.13268810510635376, 0.21244549751281738, -0.2522708773612976, 0.09649985283613205, 0.10935121774673462, 0.022893670946359634, 0.14948703348636627, 0.11884310841560364, -0.21434465050697327, 0.22422419488430023, 0.10149209201335907, -0.18704593181610107, -0.06231088191270828, 0.03780751675367355, 0.14723064005374908, 0.028224650770425797, 0.0038132392801344395, 0.08014075458049774, -0.2904886305332184, -0.02699051797389984, -0.144304558634758, 0.30486324429512024, -0.332506000995636, 0.02329966612160206, -0.24856215715408325, -0.34044358134269714, -0.1702061891555786, -0.03587136045098305, -0.3832475244998932, -0.12993621826171875, -0.31002599000930786, 0.2699487507343292, 0.0532621331512928, 0.03153034299612045, -0.13614538311958313, 0.15964943170547485, 0.049906425178050995, -0.1642218828201294, -0.2597725987434387, -0.01445763185620308, -0.3224999010562897, 0.030660327523946762, 0.451740562915802, 0.10537499189376831, 0.33262404799461365, -0.27288204431533813, -0.012041714042425156, -0.22841235995292664, -0.3156466782093048, 0.16164737939834595, -0.10869307816028595, 0.33598455786705017, 0.03785323724150658, 0.1136995330452919, 0.001905888319015503, -0.09790591895580292, 0.35575932264328003, -0.1205890104174614, -0.292610228061676, -0.0582878515124321, -0.07153282314538956, -0.22865982353687286, -0.14093050360679626, -0.36862948536872864, -0.14724144339561462, -0.19850805401802063, 0.44963735342025757, 0.05118546262383461, -0.07792946696281433, 0.23582212626934052, 0.04422350972890854, 0.10916909575462341, -0.020175186917185783, -0.11052090674638748, -0.2128290832042694, -0.5246166586875916, 0.23329958319664001, -0.17592522501945496, -0.40888532996177673, 0.06409195065498352, 0.1472480595111847, 0.18747052550315857, 0.04345507174730301, -0.5981343984603882, -0.1847369223833084, -0.12044721841812134, 0.08401425182819366, -0.07460738718509674, -0.009697629138827324, -0.10344655811786652, -0.08294658362865448, 0.19064779579639435, -0.15273934602737427, -0.3743159770965576, 0.1797843873500824, -0.2710201144218445, 0.226533904671669, 0.20180216431617737, 0.5189443826675415, -0.13793613016605377, 0.3214726150035858, 0.5626809000968933, -0.24526695907115936, 0.2880079448223114, -0.04369988292455673, 0.41803982853889465, 0.04831286892294884, -0.25480738282203674, 0.022984063252806664, 0.08070197701454163, 0.12746424973011017, 0.21698921918869019, 0.2044336199760437, 0.18240521848201752, -0.2793234586715698, -0.16923338174819946, -0.3800138235092163, -0.19066524505615234, -0.13000300526618958, 0.22610676288604736, 0.1676928699016571, 0.09864553809165955, 0.08985576778650284, 0.1228490024805069, -0.1714968979358673, 0.21571952104568481, 0.5035192370414734, 0.11829986423254013, 0.21935944259166718, -0.5257461667060852, 0.017707236111164093, -0.507720947265625, 0.27123433351516724, -0.03700747713446617, 0.254670649766922, 0.01624620333313942, 0.21616286039352417, 0.10600762814283371, -0.07404464483261108, 0.6631453037261963, 0.04926784336566925, 0.03320608660578728, -0.004812926985323429, -0.10114696621894836, -0.2398444563150406, 0.18723225593566895, -0.07081235200166702, 0.08888231962919235, 0.21213698387145996, 0.7063567638397217, -0.4514238238334656, -0.20542360842227936, 0.12118065357208252, 0.11702723801136017, -0.1359657496213913, -0.28152790665626526, -0.3058297038078308, -0.38528916239738464, -0.29757487773895264, -0.21367880702018738, -0.04433904215693474, 0.2446925789117813, 0.07425548881292343, 0.011200807988643646, -0.000026404857635498047, -0.07704181969165802, 0.18158495426177979, 0.31038200855255127, 0.37053924798965454, 0.07067549228668213, 0.3404732644557953, 0.5007097721099854, 0.2653319537639618, 0.4988623261451721, 0.8047417402267456, -0.017566125839948654, -0.45291733741760254, -0.12743812799453735, 0.041094664484262466, 0.12312135845422745, 0.050334632396698, -0.19158950448036194, 0.09310223162174225, 0.19558818638324738, 0.023464906960725784, -0.2479819655418396, 0.11186511069536209, 0.2389686405658722, 0.15938006341457367, -0.41256412863731384, -0.5046038627624512, 0.4951017498970032, 0.142174631357193, 0.13907882571220398, -0.13802841305732727, 0.3588564991950989, -0.16755878925323486, 0.08367922902107239, -0.15587249398231506, 0.73856520652771, -0.11550714075565338, -0.12011276185512543, 0.4804933965206146, -0.10578751564025879, 0.4779645502567291, -0.18989217281341553, -0.07225477695465088, -0.32549387216567993, 0.06904971599578857, -0.07889371365308762, -0.06683135777711868, 0.10766839981079102, 0.036303333938121796, 0.019811902195215225, 0.2584361732006073, -0.02345499023795128, -0.04241687431931496, -0.04444608837366104, 0.375176340341568, 0.05122353136539459, -0.03467325121164322, -0.597671627998352, 0.13821662962436676, -0.08328066766262054, 0.3743554651737213, -0.0750819742679596, -0.19063758850097656, -0.21859602630138397, -0.14320851862430573, -0.26256048679351807, 0.1527080237865448, -0.25523641705513, 0.022702395915985107, 0.3385934829711914, -0.181904599070549, 0.3040744960308075, 0.2643655240535736, 0.33130019903182983, 0.08245175331830978, -0.34315112233161926, 0.12050877511501312, -0.2951098680496216, -0.11836536973714828, -0.0331815704703331, 0.12740729749202728, 0.07646073400974274, -0.1028551310300827, 0.0038127824664115906, -0.11559445410966873, -0.013661612756550312, -0.2787894606590271, -0.014776572585105896, -0.039660245180130005, -0.08635668456554413, -0.19774380326271057, -0.25004011392593384, -0.10010424256324768, 0.1669895201921463, -0.1332102119922638, 0.045710232108831406, 0.2940506935119629, 0.12465112656354904, -0.15247651934623718, 0.2960304617881775, -0.19601798057556152, -0.13677802681922913, 0.3349497318267822, -0.21826118230819702, -0.21518927812576294, 0.3315216302871704, 0.31777143478393555, -0.12637367844581604, -0.052233051508665085, 0.10451992601156235, 0.49760445952415466, -0.3095422089099884, -0.010570480488240719, 0.05219089239835739, 0.06116338074207306, -0.11487989127635956, 0.2355176955461502, 0.2599697709083557, -0.20308583974838257, 0.29715657234191895, -0.4844920337200165, -0.2017183005809784, 0.4178645610809326, -0.08404743671417236, 0.006936464458703995, 0.21888414025306702, 0.09626355767250061, -0.19302107393741608, -0.21702595055103302, -0.22470971941947937, 0.1237979307770729, -0.24961049854755402, -0.07066787034273148, 0.3121758997440338, 0.08744172751903534, 0.31991711258888245, -0.0965956449508667, 0.061584390699863434, 0.04809548705816269, -0.2660202980041504, -0.07802994549274445, -0.3167242407798767, 0.10665599256753922, 0.11895716935396194, -0.31562539935112, -0.029634281992912292, -0.2004498839378357, -0.14277321100234985, -0.1237369179725647, 0.12520062923431396, 0.23697328567504883, 0.13535858690738678, -0.02059805765748024, -0.024470631033182144, 0.09801431745290756, -0.34452617168426514, 0.18352922797203064, 0.04641568288207054, 0.20472252368927002, 0.13039833307266235, -0.027025461196899414, -0.05414682254195213, 0.06255333125591278, -0.09366985410451889, 0.060994502156972885, 0.34885162115097046, 0.10196281224489212, 0.3680061399936676, -0.249899223446846, 0.1352098137140274, 0.4168151021003723, 0.3914455771446228, 0.3551637828350067, -0.2431183010339737, 0.11810795962810516, 0.25968578457832336, 0.13151569664478302, -0.268435537815094, -0.04142395406961441, 0.39415425062179565, 0.00007496774196624756, -0.031743839383125305, 0.17688412964344025, 0.08875863254070282, 0.32140061259269714, -0.08776310086250305, 0.10360060632228851, 0.613784670829773, 0.19308961927890778, 0.15527749061584473, 0.058872248977422714, -0.06154597923159599, 0.155495285987854, 0.09089650958776474, 0.17786070704460144, 0.22377821803092957, 0.23561795055866241, -0.15413835644721985, 0.1756540685892105, -0.12040282040834427, 0.31272563338279724, 0.1214202344417572, -0.47684386372566223, -0.31559261679649353, 0.25574517250061035, -0.059661611914634705, 0.1949254870414734, -0.09525679051876068, 0.3713388442993164, 0.02591419219970703, -0.07254143804311752, -0.07804447412490845, 0.12425269186496735, -0.14275473356246948, -0.11394990980625153, -0.0007455311715602875, -0.28741729259490967, -0.23237358033657074, 0.048020947724580765, -0.19419245421886444, -0.2181088775396347, 0.1489066779613495, 0.03446536883711815, -0.21625028550624847, -0.5780243277549744, -0.007442213594913483, 0.22299319505691528, -0.04324359446763992, -0.2477247714996338, 0.4129679501056671, 0.09426752477884293, -0.25601789355278015, 0.09598623216152191, 0.2661064863204956, 0.3129103481769562, 0.2327461689710617, 0.37607306241989136, -0.10351985692977905, -0.04503948614001274, -0.05271551012992859, -0.12349975109100342, 0.20679005980491638, 0.042973581701517105, 0.07748623192310333, 0.2280913144350052, 0.10782656818628311, -0.06359178572893143, 0.009486518800258636, -0.0003147311508655548, 0.4221016764640808, -0.43171074986457825, 0.21660250425338745, -0.7187114953994751, -0.020847439765930176, -0.34360307455062866, -0.11631595343351364, -0.1931624710559845, 0.13252706825733185, 0.11412650346755981, 0.07093153148889542, 0.1327282190322876, -0.17743580043315887, 0.0521107092499733, 0.016774971038103104, 0.42204540967941284, 0.5924479365348816, 0.02907843329012394, -0.12554016709327698, -0.2913059890270233, -0.8193529844284058, 0.29711705446243286, -0.155803382396698, 0.017960200086236, 0.06036932393908501, 0.02670573629438877, -0.007836513221263885, 0.08274242281913757, -0.08318136632442474, -0.07084067165851593, 0.1285131722688675, -0.15619602799415588, -0.2198765128850937, -0.21486683189868927, -0.02280373126268387, -0.06620629876852036, 0.03666076809167862, -0.16657492518424988, 0.2792084217071533, -0.07481151819229126, -0.10824154317378998, -0.25686585903167725, 0.28905534744262695, -0.3066962659358978, -0.19204197824001312, 0.1332460641860962, 0.2954002618789673, 0.3996940553188324, -0.08628252148628235, -0.23542368412017822, -0.33384495973587036, -0.2283172309398651, -0.2686620056629181, 0.38952305912971497, -0.10185706615447998, 0.5360653400421143, -0.27261820435523987, -0.11437872052192688, -0.4133925437927246, 0.14993204176425934, 0.017652668058872223, -0.15189528465270996, -0.34477341175079346, 0.21404406428337097, -0.3010542392730713, 0.06392909586429596, 0.11444747447967529, 0.3288857936859131, -0.04183413088321686, 0.0408686026930809, -0.12869754433631897, -0.1326177418231964, 0.4424443244934082, -0.4650462567806244, -0.08111029863357544, 0.09331609308719635, -0.07844695448875427, 0.15513235330581665, -0.3431035578250885, -0.5295788049697876, 0.1984872817993164, 0.2511199414730072, -0.017208769917488098, -0.28559520840644836, 0.1455519199371338, 0.05116674676537514, -0.10156641155481339, 0.012636806815862656, 0.37285634875297546, 0.333425909280777, -0.3731309175491333, 0.5766471028327942, -0.1030370369553566 ]
https://github.com/huggingface/datasets/issues/6405
ConfigNamesError on a simple CSV file
The viewer is working now. Based on the repo commit history, the bug was due to the incorrect format of the `features` field in the README YAML (`Value` requires `dtype`, e.g., `Value("string")`, but it was not specified)
See https://huggingface.co/datasets/Nguyendo1999/mmath/discussions/1 ``` Error code: ConfigNamesError Exception: TypeError Message: __init__() missing 1 required positional argument: 'dtype' Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1512, in dataset_module_factory raise e1 from None File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1489, in dataset_module_factory return HubDatasetModuleFactoryWithoutScript( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1039, in get_module dataset_infos = DatasetInfosDict.from_dataset_card_data(dataset_card_data) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 468, in from_dataset_card_data dataset_info = DatasetInfo._from_yaml_dict(dataset_card_data["dataset_info"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 399, in _from_yaml_dict yaml_data["features"] = Features._from_yaml_list(yaml_data["features"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1838, in _from_yaml_list return cls.from_dict(from_yaml_inner(yaml_data)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1690, in from_dict obj = generate_from_dict(dic) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in generate_from_dict return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in <dictcomp> return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1353, in generate_from_dict return class_type(**{k: v for k, v in obj.items() if k in field_names}) TypeError: __init__() missing 1 required positional argument: 'dtype' ``` This is the CSV file: https://huggingface.co/datasets/Nguyendo1999/mmath/blob/dbcdd7c2c6fc447f852ec136a7532292802bb46f/math_train.csv
37
ConfigNamesError on a simple CSV file See https://huggingface.co/datasets/Nguyendo1999/mmath/discussions/1 ``` Error code: ConfigNamesError Exception: TypeError Message: __init__() missing 1 required positional argument: 'dtype' Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1512, in dataset_module_factory raise e1 from None File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1489, in dataset_module_factory return HubDatasetModuleFactoryWithoutScript( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1039, in get_module dataset_infos = DatasetInfosDict.from_dataset_card_data(dataset_card_data) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 468, in from_dataset_card_data dataset_info = DatasetInfo._from_yaml_dict(dataset_card_data["dataset_info"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 399, in _from_yaml_dict yaml_data["features"] = Features._from_yaml_list(yaml_data["features"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1838, in _from_yaml_list return cls.from_dict(from_yaml_inner(yaml_data)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1690, in from_dict obj = generate_from_dict(dic) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in generate_from_dict return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in <dictcomp> return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1353, in generate_from_dict return class_type(**{k: v for k, v in obj.items() if k in field_names}) TypeError: __init__() missing 1 required positional argument: 'dtype' ``` This is the CSV file: https://huggingface.co/datasets/Nguyendo1999/mmath/blob/dbcdd7c2c6fc447f852ec136a7532292802bb46f/math_train.csv The viewer is working now. Based on the repo commit history, the bug was due to the incorrect format of the `features` field in the README YAML (`Value` requires `dtype`, e.g., `Value("string")`, but it was not specified)
[ -0.3728596866130829, -0.28373628854751587, -0.09386470913887024, 0.07334659993648529, 0.42209482192993164, 0.25863513350486755, 0.5016805529594421, 0.33707669377326965, -0.02036520466208458, 0.27530673146247864, 0.42774268984794617, -0.016561666503548622, 0.06351692229509354, 0.3721483647823334, -0.06032989174127579, 0.22220245003700256, -0.12616026401519775, 0.40480268001556396, -0.10833539068698883, 0.054346852004528046, -0.23525139689445496, 0.17973126471042633, -0.20320656895637512, -0.1290833204984665, -0.2305925041437149, 0.0571724995970726, -0.13108259439468384, 0.3435359001159668, -0.06035756319761276, -0.4837627410888672, 0.5365903973579407, -0.03103044256567955, 0.08979516476392746, 0.53114914894104, -0.00011046670260839164, 0.18518532812595367, 0.2478758692741394, -0.22179460525512695, -0.381041556596756, -0.32725608348846436, -0.23974362015724182, -0.4717479944229126, 0.0009672502055764198, -0.2007448822259903, -0.0612485334277153, 0.04186411201953888, 0.06281633675098419, -0.27518194913864136, 0.3454478979110718, 0.3863115906715393, 0.2192433625459671, 0.07979097217321396, -0.13995954394340515, -0.2994150221347809, -0.2224002480506897, 0.2735179364681244, -0.031447749584913254, 0.44287797808647156, -0.13677024841308594, -0.005503421649336815, 0.18523859977722168, 0.030454028397798538, -0.020268144086003304, 0.15623489022254944, 0.22653120756149292, 0.08714424073696136, 0.21427419781684875, -0.3153967559337616, 0.13826489448547363, 0.121622733771801, 0.43205487728118896, -0.2653053104877472, -0.22398683428764343, -0.20389267802238464, 0.07695409655570984, -0.415164977312088, 0.22650161385536194, 0.03546970337629318, -0.2971196472644806, 0.0970550924539566, 0.2318859100341797, -0.07309350371360779, -0.3013240098953247, -0.027456805109977722, -0.0924154594540596, 0.10526426881551743, -0.19446761906147003, -0.03790334612131119, 0.03243781626224518, 0.09073243290185928, 0.27386054396629333, -0.04134420305490494, 0.04563760757446289, -0.007817956618964672, -0.22603346407413483, -0.16873794794082642, 0.09844648092985153, -0.34174832701683044, -0.12001685798168182, -0.3317463994026184, 0.07369538396596909, -0.16953805088996887, 0.17271360754966736, 0.2513423264026642, -0.0031125377863645554, 0.17921757698059082, 0.14685329794883728, 0.06617958843708038, 0.28113222122192383, 0.1315704733133316, 0.28474661707878113, -0.09948965162038803, -0.09406612813472748, -0.6587393879890442, -0.07804816961288452, 0.4807194769382477, 0.3218541741371155, -0.010148301720619202, -0.3823644816875458, -0.034411974251270294, -0.04933552071452141, 0.09740281105041504, 0.010125990957021713, 0.3941577672958374, 0.009883733466267586, 0.11410579085350037, 0.2539881467819214, 0.09432300925254822, -0.0878690555691719, -0.023439373821020126, -0.16670116782188416, 0.2294968217611313, -0.05963875353336334, -0.1039477214217186, 0.16163283586502075, -0.20621636509895325, 0.25140559673309326, 0.1363825798034668, 0.25179576873779297, 0.16985855996608734, 0.07333248853683472, -0.2923619747161865, -0.010159425437450409, 0.2869144678115845, -0.03983351215720177, 0.07614597678184509, 0.3928813338279724, -0.1487785428762436, -0.12194578349590302, 0.009530607610940933, -0.3221503794193268, -0.3359159529209137, -0.19661609828472137, 0.26242876052856445, -0.0619552806019783, -0.0636078491806984, -0.3150025010108948, -0.019773907959461212, 0.2500460743904114, -0.19307930767536163, -0.1807030737400055, -0.3354232907295227, -0.02127820998430252, -0.3217843770980835, 0.127919539809227, 0.5255282521247864, -0.5379657745361328, 0.13567158579826355, -0.0397571362555027, 0.15175169706344604, 0.18415746092796326, -0.05006289854645729, -0.16749446094036102, 0.41112247109413147, -0.26755356788635254, 0.1640101820230484, 0.25572437047958374, -0.38311025500297546, -0.006923571228981018, 0.2414858043193817, -0.18380871415138245, -0.27030524611473083, 0.28197115659713745, -0.14639084041118622, 0.2587052285671234, 0.004238793160766363, -0.0669814944267273, 0.16674426198005676, 0.03909147530794144, -0.010415105149149895, -0.10414779186248779, -0.2264588475227356, 0.06757933646440506, 0.09144845604896545, -0.06268376111984253, -0.00740128755569458, 0.04634322226047516, -0.3689879775047302, 0.22025060653686523, -0.19629916548728943, 0.036854758858680725, 0.33298051357269287, 0.2658460736274719, 0.13981197774410248, -0.09963838011026382, 0.11592399328947067, -0.283402681350708, 0.13467633724212646, 0.18373028934001923, 0.28059279918670654, -0.25482165813446045, -0.09246226400136948, -0.18236854672431946, -0.026597559452056885, -0.22243203222751617, -0.1960582137107849, 0.20721331238746643, 0.2833438813686371, -0.2932690680027008, -0.18437090516090393, -0.12428686022758484, 0.22376662492752075, 0.036464884877204895, 0.07459238171577454, -0.21789942681789398, 0.1949891299009323, -0.3210981786251068, -0.06860563904047012, 0.23298430442810059, 0.035046935081481934, 0.21349895000457764, -0.26208698749542236, -0.11461371928453445, 0.26899465918540955, 0.2071724832057953, 0.18484310805797577, 0.04336889460682869, -0.30230528116226196, 0.19324064254760742, 0.17868363857269287, -0.20660986006259918, 0.11812488734722137, 0.22987988591194153, 0.047785282135009766, -0.10192213207483292, 0.3571906089782715, 0.0310989860445261, 0.12394584715366364, 0.04530985653400421, 0.11424282938241959, 0.3530837893486023, 0.08855026960372925, 0.17752346396446228, -0.20509059727191925, 0.16313955187797546, 0.354023814201355, -0.05761798098683357, -0.06786761432886124, -0.14287665486335754, 0.025546036660671234, 0.2213640660047531, 0.11832240223884583, -0.009475864470005035, 0.02780536189675331, -0.03435584902763367, 0.0053978897631168365, 0.19920773804187775, 0.1334855854511261, 0.639104425907135, 0.15509790182113647, -0.23745939135551453, 0.1345519721508026, 0.005187459290027618, -0.32183927297592163, 0.3759845495223999, -0.0901641696691513, 0.2025013566017151, 0.30281758308410645, -0.09930497407913208, 0.1365654468536377, -0.30513301491737366, -0.6205884218215942, 0.06396938860416412, 0.2568560242652893, -0.5462539196014404, 0.03272347152233124, -0.2703123092651367, 0.021107833832502365, -0.02233026921749115, -0.0993884727358818, 0.07055564224720001, -0.33924901485443115, -0.11231161653995514, 0.01770099624991417, -0.03284768760204315, 0.14079317450523376, 0.04485413804650307, 0.24102555215358734, 0.2025047242641449, -0.2367665320634842, -0.22814227640628815, -0.17447425425052643, -0.13863658905029297, 0.09013719856739044, -0.08394494652748108, 0.10680126398801804, 0.23286661505699158, -0.2744048237800598, -0.08775509893894196, 0.019771886989474297, -0.33163586258888245, -0.005473718047142029, -0.14114272594451904, 0.4031728208065033, 0.43042564392089844, 0.6299523115158081, 0.11055202782154083, -0.239803746342659, 0.20925727486610413, 0.3164924383163452, -0.12995165586471558, 0.06785114109516144, -0.10616589337587357, -0.3718920946121216, -0.2912106215953827, -0.3621721565723419, -0.3139338493347168, -0.3805758059024811, 0.05187300592660904, 0.23950843513011932, 0.02108384296298027, 0.4575105905532837, 0.30595141649246216, 0.06320567429065704, 0.03813369199633598, 0.213093101978302, -0.16363507509231567, -0.30727419257164, 0.3916323781013489, -0.25675374269485474, -0.2976926267147064, 0.010681834071874619, -0.01837281323969364, 0.344799280166626, 0.004189368803054094, -0.38071417808532715, -0.3553985059261322, -0.05329716205596924, 0.3346523642539978, -0.23543637990951538, 0.09035912156105042, 0.4161067306995392, 0.2821371853351593, -0.1010449007153511, -0.1597577929496765, -0.2671665549278259, 0.10703176259994507, 0.13947409391403198, 0.1717410534620285, -0.05232448875904083, 0.42455196380615234, -0.05431452393531799, 0.3807719349861145, 0.20289821922779083, -0.31908977031707764, 0.14553195238113403, -0.21887311339378357, 0.4886994957923889, 0.0015848949551582336, -0.46790680289268494, 0.22759884595870972, 0.014555364847183228, -0.02906009368598461, 0.0830664411187172, -0.35515865683555603, 0.24742475152015686, -0.25835150480270386, 0.06121435388922691, -0.29562142491340637, -0.1653965413570404, -0.036632195115089417, -0.07120716571807861, 0.2304774522781372, 0.009128931909799576, 0.041417673230171204, -0.3371972441673279, 0.20529764890670776, -0.06595969200134277, 0.5443927049636841, -0.0737704262137413, -0.08563336730003357, -0.05986044555902481, -0.333607941865921, -0.33185821771621704, 0.19554023444652557, -0.04471462592482567, 0.2891850471496582, 0.039879005402326584, 0.10226412862539291, -0.17618416249752045, 0.06401032954454422, 0.5923743844032288, -0.22567437589168549, -0.05640871822834015, 0.04021618515253067, 0.05274651199579239, -0.18567943572998047, -0.09793723374605179, -0.10348260402679443, 0.23959237337112427, 0.14607977867126465, 0.5356592535972595, -0.2749772369861603, -0.09603925049304962, 0.18104645609855652, 0.13247467577457428, -0.05249626189470291, -0.0810389444231987, -0.21606042981147766, -0.48123425245285034, -0.2115866243839264, -0.09619919210672379, -0.009912095032632351, 0.223271444439888, 0.07392721623182297, 0.026982706040143967, -0.03255612403154373, -0.2691289484500885, 0.21968097984790802, 0.28020116686820984, -0.01944243721663952, -0.07719282060861588, 0.0013084523379802704, 0.10872813314199448, 0.12715551257133484, 0.5250542163848877, 0.34580910205841064, 0.029367581009864807, -0.6089035272598267, 0.02118486911058426, -0.22334907948970795, 0.4158901870250702, 0.32469862699508667, -0.37614455819129944, 0.017489291727542877, -0.19706588983535767, 0.23723772168159485, -0.0652557834982872, 0.16522306203842163, 0.39799970388412476, 0.2337779998779297, -0.16231301426887512, -0.44524267315864563, 0.12363982200622559, -0.11823640763759613, 0.05507144331932068, 0.11464163661003113, -0.1883222609758377, -0.4509407579898834, 0.2515724301338196, 0.08861182630062103, 0.7092782258987427, 0.4514271020889282, 0.17557430267333984, 0.5894686579704285, 0.1339935064315796, 0.37149930000305176, 0.049460552632808685, 0.2343011051416397, -0.31577950716018677, -0.36848247051239014, -0.18576361238956451, -0.21443219482898712, 0.42691317200660706, 0.13479062914848328, -0.40693455934524536, 0.3375695049762726, -0.09297776222229004, 0.2657715678215027, 0.021124567836523056, -0.022655026987195015, -0.08316393941640854, -0.26727035641670227, -0.27357217669487, 0.14719930291175842, 0.06766209751367569, 0.16255122423171997, -0.18918520212173462, -0.21933488547801971, -0.18317270278930664, -0.29165905714035034, -0.1350187361240387, -0.05007142573595047, -0.7079551815986633, 0.34511125087738037, -0.11473166942596436, -0.10118797421455383, 0.23756295442581177, 0.1034533753991127, 0.3195652961730957, 0.27252060174942017, -0.10655604302883148, 0.06473978608846664, 0.06879935413599014, -0.11928059160709381, 0.00915629044175148, -0.055015500634908676, 0.18411271274089813, -0.12341134250164032, -0.18734201788902283, 0.14622774720191956, -0.1464070975780487, -0.09431368857622147, 0.20291003584861755, -0.00829305499792099, -0.30826276540756226, -0.2651931643486023, -0.26173266768455505, -0.011648125946521759, -0.055700380355119705, -0.18585166335105896, 0.14975696802139282, -0.03947822004556656, -0.0700940266251564, 0.1542070060968399, -0.10469616949558258, -0.2787111699581146, -0.13818711042404175, 0.14210999011993408, 0.053316086530685425, 0.12819503247737885, 0.4802126884460449, -0.07780792564153671, -0.3103107810020447, -0.2874232530593872, 0.2521604001522064, -0.22730574011802673, -0.21593636274337769, 0.1390109360218048, 0.17482127249240875, -0.14199185371398926, -0.03097674436867237, 0.19810427725315094, 0.3379620313644409, 0.0295267216861248, -0.0021260306239128113, -0.600157618522644, -0.12234655022621155, 0.06158246845006943, -0.27768000960350037, 0.0675477385520935, -0.028844542801380157, 0.6347405910491943, 0.07862488180398941, -0.26241952180862427, -0.35943326354026794, 0.1488966941833496, -0.01129928044974804, 0.08861541002988815, 0.1124909520149231, -0.09074381738901138, 0.33375662565231323, -0.057526152580976486, 0.226064071059227, -0.021811004728078842, -0.15643949806690216, -0.21585410833358765, -0.04168301075696945, 0.11623453348875046, -0.08895951509475708, -0.032568737864494324, 0.17283396422863007, -0.10643916577100754, -0.40479156374931335, -0.07372020184993744, -0.048955321311950684, 0.05478982627391815, -0.11965605616569519, 0.10351894795894623, -0.11209069192409515, 0.09843012690544128, -0.12047263234853745, 0.14593970775604248, -0.05841241776943207, 0.2380867898464203, -0.11610846221446991, 0.3402162790298462, -0.3828151524066925, -0.023726340383291245, -0.05943097546696663, 0.23633524775505066, -0.07914474606513977, -0.08792310208082199, 0.34885504841804504, -0.36593401432037354, 0.11718413233757019, 0.14669269323349, 0.19165591895580292, 0.5087407827377319, -0.22486741840839386, 0.2846231162548065, 0.04955592378973961, 0.21885143220424652, -0.4083143174648285, 0.2700338363647461, -0.041611358523368835, -0.06269954144954681, 0.23032629489898682, 0.16201388835906982, 0.048017505556344986, -0.17943263053894043, -0.035211704671382904, 0.058147870004177094, 0.34225180745124817, -0.263083815574646, 0.1535305231809616, 0.3312397003173828, -0.21463751792907715, 0.25552332401275635, 0.325821191072464, 0.4620882570743561, 0.20862583816051483, 0.4705713391304016, -0.0014935582876205444, 0.05827626585960388, 0.14534005522727966, -0.21689525246620178, -0.29600295424461365, -0.4535769820213318, 0.22759929299354553, 0.333850622177124, -0.22110506892204285, -0.15255579352378845, 0.09532869607210159, 0.4051649272441864, -0.6395165920257568, 0.14646971225738525, -0.2178407609462738, -0.14825959503650665, -0.21269935369491577, 0.10110414028167725, 0.047021836042404175, 0.023177415132522583, -0.23074445128440857, -0.3228684663772583, 0.15175564587116241, -0.03348168730735779, 0.08004119992256165, 0.017476607114076614, -0.13549821078777313, -0.1510835438966751, 0.11642419546842575, 0.18648740649223328, 0.04279769957065582, -0.24012012779712677, 0.053962696343660355, 0.20953184366226196, 0.05136844888329506, -0.2075813263654709, 0.4216223955154419, 0.822526752948761, 0.3372942805290222, -0.0746600478887558, -0.2622198760509491, -0.14743544161319733, -0.12959788739681244, 0.07998020201921463, -0.05253572762012482, -0.010716795921325684, 0.2257409393787384, 0.41540923714637756, 0.2924785017967224, -0.12396561354398727, 0.16017955541610718, 0.34172767400741577, -0.0639396607875824, -0.19186916947364807, 0.08386227488517761, -0.0679093524813652, -0.1399909108877182, 0.02512652799487114, -0.012278549373149872, -0.47672367095947266, -0.05688820779323578, 0.5320324897766113, 0.05882410332560539, 0.15889084339141846, -0.0028879388701170683, 0.11835131049156189, -0.0016967058181762695, 0.307964026927948, 0.27946117520332336, -0.142269104719162, -0.2824636399745941, 0.0908387303352356, -0.4905804693698883, -0.0003708004951477051, 0.09957316517829895, -0.06418056786060333, -0.18383702635765076, 0.16491790115833282, 0.19692623615264893, 0.06884819269180298, 0.02293037623167038, -0.05049065873026848, 0.16756542026996613, -0.11019957065582275, -0.2079629749059677, -0.24247346818447113, -0.02999698370695114, -0.046256035566329956, 0.03158888220787048, -0.4662364423274994, 0.05544260889291763, -0.10789971798658371, 0.1781817376613617, -0.22515061497688293, 0.14078710973262787, 0.2121548354625702, -0.26873981952667236, 0.27111056447029114, -0.08102858066558838, 0.503639817237854, -0.3073439300060272, -0.10771404951810837, 0.0413784421980381, -0.23136180639266968, -0.13785812258720398, 0.4965311288833618, 0.32634517550468445, 0.09502137452363968, -0.1984831839799881, -0.10297501087188721, -0.2321203351020813, 0.1383398026227951, 0.07906993478536606, -0.2524394392967224, -0.37035736441612244, 0.30356720089912415, -0.13157334923744202, 0.09486651420593262, -0.04078349471092224, 0.019509010016918182, -0.21910718083381653, 0.1390550434589386, -0.28071945905685425, -0.5006479620933533, 0.4621930420398712, 0.10205459594726562, -0.22853532433509827, -0.23347046971321106, 0.21688982844352722, -0.05271170288324356, 0.5275148153305054, -0.23876863718032837, 0.17119908332824707, 0.34569501876831055, -0.041205666959285736, -0.4768346846103668, 0.41124531626701355, -0.0901186466217041, 0.00243309885263443, -0.0755574107170105, 0.5727777481079102, -0.05552125722169876, -0.22110988199710846, -0.09852569550275803, -0.1636689007282257 ]
https://github.com/huggingface/datasets/issues/6403
Cannot import datasets on google colab (python 3.10.12)
You are most likely using an outdated version of `datasets` in the notebook, which can be verified with the `!datasets-cli env` command. You can run `!pip install -U datasets` to update the installation.
### Describe the bug I'm trying A full colab demo notebook of zero-shot-distillation from https://github.com/huggingface/transformers/tree/main/examples/research_projects/zero-shot-distillation but i got this type of error when importing datasets on my google colab (python version is 3.10.12) ![image](https://github.com/huggingface/datasets/assets/15389235/6f7758a2-681d-4436-87d0-5e557838e368) I found the same problem that have been solved in [#3326 ] but it seem still error on the google colab. I can't try on my local using jupyter notebook because of my laptop resource doesn't fulfill the requirements. Please can anyone help me solve this problem. Thank you 😅 ### Steps to reproduce the bug Error: ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) [<ipython-input-8-b6e092f83978>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import load_dataset 2 3 # Print all the available datasets 4 from huggingface_hub import list_datasets 5 print([dataset.id for dataset in list_datasets()]) 6 frames [/usr/lib/python3.10/functools.py](https://localhost:8080/#) in update_wrapper(wrapper, wrapped, assigned, updated) 59 # Issue #17482: set __wrapped__ last so we don't inadvertently copy it 60 # from the wrapped function when updating __dict__ ---> 61 wrapper.__wrapped__ = wrapped 62 # Return the wrapper so this can be used as a decorator via partial() 63 return wrapper AttributeError: readonly attribute ``` ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free
33
Cannot import datasets on google colab (python 3.10.12) ### Describe the bug I'm trying A full colab demo notebook of zero-shot-distillation from https://github.com/huggingface/transformers/tree/main/examples/research_projects/zero-shot-distillation but i got this type of error when importing datasets on my google colab (python version is 3.10.12) ![image](https://github.com/huggingface/datasets/assets/15389235/6f7758a2-681d-4436-87d0-5e557838e368) I found the same problem that have been solved in [#3326 ] but it seem still error on the google colab. I can't try on my local using jupyter notebook because of my laptop resource doesn't fulfill the requirements. Please can anyone help me solve this problem. Thank you 😅 ### Steps to reproduce the bug Error: ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) [<ipython-input-8-b6e092f83978>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import load_dataset 2 3 # Print all the available datasets 4 from huggingface_hub import list_datasets 5 print([dataset.id for dataset in list_datasets()]) 6 frames [/usr/lib/python3.10/functools.py](https://localhost:8080/#) in update_wrapper(wrapper, wrapped, assigned, updated) 59 # Issue #17482: set __wrapped__ last so we don't inadvertently copy it 60 # from the wrapped function when updating __dict__ ---> 61 wrapper.__wrapped__ = wrapped 62 # Return the wrapper so this can be used as a decorator via partial() 63 return wrapper AttributeError: readonly attribute ``` ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free You are most likely using an outdated version of `datasets` in the notebook, which can be verified with the `!datasets-cli env` command. You can run `!pip install -U datasets` to update the installation.
[ -0.22408881783485413, -0.2938653230667114, 0.08976826071739197, 0.4306344985961914, 0.211708202958107, -0.0820385217666626, 0.3200896084308624, 0.04798262193799019, 0.08357463777065277, 0.14291983842849731, -0.5043290853500366, 0.30278438329696655, -0.17893856763839722, 0.20810817182064056, -0.12015658617019653, -0.3213289976119995, 0.08890596032142639, 0.1492816060781479, -0.08214099705219269, 0.1717667579650879, -0.3380439579486847, 0.4033983051776886, -0.5665119886398315, -0.24591238796710968, -0.2709547281265259, -0.1801455169916153, -0.07484471797943115, 0.002963069826364517, -0.2021387219429016, -0.3881395161151886, 0.39867475628852844, -0.12860271334648132, 0.012791583314538002, 0.5347661972045898, -0.00012633486767299473, 0.09302058815956116, 0.5041476488113403, -0.04554485157132149, -0.4212433099746704, -0.4583507776260376, -0.36001813411712646, -0.09084045886993408, 0.17687971889972687, 0.11536715179681778, 0.01589057222008705, 0.2505553662776947, -0.03191164880990982, -0.11223383247852325, 0.437927782535553, 0.4223155379295349, 0.12322494387626648, 0.28344157338142395, 0.36510294675827026, -0.2787415683269501, 0.28503477573394775, -0.01522267609834671, -0.1505952626466751, 0.6048442721366882, 0.18018463253974915, 0.17197561264038086, 0.42866289615631104, 0.2533999979496002, -0.22349199652671814, 0.08147434890270233, 0.11549261957406998, -0.07011482864618301, -0.4394218325614929, -0.471875935792923, 0.20078131556510925, 0.144123837351799, 0.2649626135826111, -0.3139784336090088, -0.49923214316368103, -0.1809440553188324, 0.24516446888446808, -0.28598248958587646, 0.21514305472373962, 0.21236544847488403, 0.04669700190424919, 0.08425948023796082, -0.2761663794517517, -0.011070899665355682, -0.2731894850730896, 0.04716278612613678, -0.31578752398490906, 0.36417683959007263, -0.26708102226257324, 0.0790368914604187, 0.025731302797794342, -0.12875360250473022, 0.4117957353591919, -0.06862524151802063, -0.015537247061729431, 0.0897151380777359, -0.06890757381916046, 0.026214152574539185, -0.10330761224031448, 0.45208027958869934, -0.0006021447479724884, 0.13550516963005066, -0.17308436334133148, -0.12652131915092468, 0.10543525218963623, 0.3243551552295685, 0.04769693315029144, 0.21600039303302765, 0.10011403262615204, 0.26817989349365234, 0.45957326889038086, 0.47055521607398987, -0.051634375005960464, -0.011174041777849197, -0.010696514509618282, -0.11710178107023239, -0.16259802877902985, -0.009662371128797531, 0.45142102241516113, -0.09610147774219513, -0.42961180210113525, 0.04967509210109711, -0.3298725187778473, 0.28603941202163696, 0.18290771543979645, 0.25062382221221924, -0.09417691826820374, -0.00037020444869995117, 0.17658576369285583, 0.08429032564163208, -0.12919577956199646, -0.12502093613147736, -0.05248688533902168, 0.3771763741970062, -0.04830193892121315, 0.07127612084150314, 0.1015346348285675, -0.3857037425041199, 0.32587844133377075, 0.16166917979717255, 0.06800968199968338, 0.0005706697702407837, -0.09250016510486603, -0.4168262779712677, -0.14612427353858948, 0.5084549784660339, 0.18744494020938873, 0.00018290430307388306, 0.07468146085739136, -0.46896791458129883, -0.10239432752132416, 0.12697294354438782, -0.3518475592136383, -0.33266788721084595, -0.1488693207502365, 0.04069294407963753, -0.41559648513793945, 0.1615375578403473, -0.45823314785957336, 0.06177028268575668, 0.10937662422657013, 0.0014116205275058746, -0.09434961527585983, -0.26258420944213867, -0.5889475345611572, -0.1313982903957367, 0.22819238901138306, 0.6596839427947998, -0.36773139238357544, -0.22093082964420319, -0.25379377603530884, 0.08424338698387146, 0.08707904815673828, 0.1493290215730667, -0.09622280299663544, -0.033697813749313354, -0.16756586730480194, -0.05120992660522461, -0.14903542399406433, -0.18009932339191437, -0.5586352348327637, -0.02523498237133026, -0.04207892715930939, 0.24892906844615936, 0.0019054114818572998, -0.22660981118679047, 0.13725325465202332, -0.056717097759246826, 0.3834300935268402, 0.2409672737121582, -0.19044123589992523, 0.01830386556684971, -0.30327337980270386, -0.004861174151301384, -0.06333708763122559, 0.1010800451040268, 0.10547841340303421, 0.18893542885780334, -0.008408665657043457, -0.014030358754098415, -0.2239978015422821, -0.09166334569454193, 0.07262225449085236, 0.41170263290405273, 0.5215376615524292, -0.042946361005306244, 0.0007394733838737011, -0.16482672095298767, -0.5322033166885376, 0.2090865969657898, -0.07022349536418915, 0.2444746494293213, -0.4609643816947937, -0.1514863818883896, -0.46188369393348694, 0.2762691378593445, -0.052334804087877274, -0.17141953110694885, -0.020991303026676178, 0.022719640284776688, -0.04240737110376358, 0.3444933295249939, 0.05130481347441673, 0.6571921706199646, 0.2869203984737396, 0.16412031650543213, -0.3577836751937866, 0.29116255044937134, -0.2711774706840515, -0.2584744989871979, 0.06700634956359863, -0.0007953420281410217, 0.20712348818778992, -0.12879471480846405, -0.13980701565742493, 0.030126584693789482, 0.12279503047466278, 0.061005592346191406, -0.10666634887456894, -0.15940912067890167, 0.2684811055660248, -0.10815522074699402, -0.03462222218513489, -0.06373818218708038, 0.27167144417762756, 0.05765857547521591, 0.21094438433647156, 0.6630961298942566, -0.044599514454603195, 0.032623350620269775, -0.05696355551481247, 0.11182098835706711, 0.00971783883869648, 0.1171640008687973, -0.030061684548854828, -0.22104871273040771, 0.17296801507472992, 0.3595542311668396, 0.2685762643814087, -0.041992999613285065, -0.30356481671333313, 0.16591006517410278, 0.1913522630929947, 0.1382385641336441, -0.013407498598098755, 0.10603445768356323, -0.28595393896102905, -0.02094767801463604, 0.4183332920074463, 0.20547433197498322, 0.5454279780387878, 0.0742720514535904, -0.08339124917984009, 0.3584462106227875, 0.24580781161785126, -0.12132540345191956, 0.21193376183509827, 0.2712686061859131, 0.33645230531692505, 0.033247269690036774, 0.19521260261535645, 0.16877052187919617, -0.12040401995182037, -0.25387656688690186, 0.18607290089130402, 0.4728599190711975, -0.41360005736351013, 0.20036937296390533, -0.3362029194831848, -0.3362843692302704, -0.11658978462219238, -0.07036034762859344, -0.11225332319736481, -0.3109762966632843, -0.19603291153907776, 0.5883020162582397, 0.07065674662590027, 0.07008890807628632, 0.33025527000427246, 0.36904245615005493, 0.044808149337768555, -0.1237935945391655, -0.26849958300590515, 0.07896679639816284, -0.005706451833248138, -0.0737372636795044, 0.38832899928092957, -0.024529047310352325, 0.29349127411842346, -0.07667721807956696, -0.0823540985584259, 0.08897388726472855, -0.426617294549942, 0.160415381193161, -0.1701473593711853, 0.5040337443351746, 0.227629616856575, 0.16977553069591522, -0.5096024870872498, -0.11013969033956528, 0.09190227836370468, 0.00006161443889141083, -0.30869415402412415, -0.00510964822024107, -0.14363941550254822, -0.03341609984636307, -0.16584113240242004, 0.04623290151357651, -0.2518767714500427, -0.23915129899978638, 0.2971799969673157, -0.11579488217830658, 0.22178171575069427, 0.3553115129470825, 0.06233439967036247, 0.19955556094646454, 0.19119156897068024, -0.04239511489868164, -0.013622861355543137, -0.2205853909254074, 0.3824107348918915, -0.44043898582458496, -0.28254765272140503, 0.17388802766799927, -0.19200879335403442, 0.06113753467798233, -0.009082747623324394, -0.3783840537071228, -0.6019651889801025, -0.19663499295711517, 0.01645364612340927, -0.0555272102355957, 0.05765874683856964, 0.15031243860721588, -0.11668731272220612, 0.15064193308353424, -0.11711230129003525, -0.30450695753097534, -0.2560209333896637, -0.12235575169324875, -0.0913328304886818, 0.22759214043617249, 0.3631328344345093, -0.054300788789987564, 0.4749535322189331, 0.36211952567100525, 0.222066730260849, 0.23732274770736694, -0.017398277297616005, 0.28867632150650024, -0.2260737121105194, -0.45662713050842285, -0.04724651947617531, 0.05069925636053085, -0.08774200081825256, 0.08783121407032013, -0.15653252601623535, 0.21728156507015228, -0.23996055126190186, -0.23427920043468475, -0.06895851343870163, -0.23820823431015015, -0.01773698441684246, 0.07851189374923706, 0.04303937777876854, -0.0736520066857338, -0.16015002131462097, -0.14315290749073029, -0.042176809161901474, -0.18453346192836761, 0.25182992219924927, 0.026937730610370636, 0.15581727027893066, 0.41453903913497925, -0.12451373040676117, -0.5555307865142822, 0.4954647421836853, 0.23740366101264954, 0.1962929517030716, 0.03257877007126808, 0.18463215231895447, 0.024662531912326813, 0.06925995647907257, 0.276985764503479, -0.16534246504306793, -0.2081633359193802, 0.07902586460113525, -0.45326143503189087, -0.42028486728668213, -0.1524832397699356, -0.247393399477005, 0.0900803655385971, 0.3220955729484558, 0.14361295104026794, -0.20144334435462952, 0.1755521595478058, 0.3622603416442871, 0.023480376228690147, 0.058734502643346786, 0.12325585633516312, -0.1880365014076233, -0.5094091296195984, -0.28572335839271545, -0.096775121986866, 0.25925010442733765, 0.40029391646385193, 0.12962323427200317, 0.2707204818725586, -0.16931064426898956, -0.06169037148356438, 0.04647211730480194, 0.14578701555728912, 0.15639415383338928, 0.16876879334449768, 0.3284367024898529, -0.027049235999584198, -0.22074079513549805, 0.41953244805336, 0.816620945930481, -0.05832184478640556, -0.4979092478752136, -0.07375233620405197, 0.12536418437957764, -0.035981275141239166, 0.14759671688079834, -0.19590342044830322, 0.14748504757881165, -0.2864198088645935, 0.10959745198488235, 0.27058130502700806, 0.0381549634039402, -0.08815734833478928, 0.18061362206935883, -0.38666751980781555, -0.03918062523007393, 0.4038248360157013, 0.20751036703586578, 0.059288039803504944, 0.1204175278544426, 0.2838975787162781, -0.2105555683374405, 0.12213774025440216, 0.041021112352609634, 0.7523176670074463, 0.041739556938409805, -0.06571763753890991, 0.2753608524799347, -0.1078680232167244, 0.5590267777442932, 0.46174055337905884, 0.12176385521888733, -0.33086517453193665, -0.35177090764045715, -0.020354103296995163, -0.13963548839092255, 0.23292359709739685, -0.3771539330482483, -0.37335091829299927, 0.0035421501379460096, -0.10628681629896164, -0.06812627613544464, 0.1576547473669052, 0.013072863221168518, -0.09422840923070908, -0.08032694458961487, -0.1993347704410553, 0.022396378219127655, -0.12106497585773468, 0.4506016671657562, -0.13655179738998413, 0.017538661137223244, -0.2355274111032486, -0.11245366185903549, -0.5351710915565491, 0.0601479634642601, -0.4892386496067047, 0.028847724199295044, 0.345051109790802, -0.49003297090530396, 0.4244233965873718, 0.16099819540977478, 0.4118081331253052, 0.07891145348548889, -0.26902058720588684, 0.041024934500455856, -0.18962547183036804, -0.2799549698829651, -0.012987428344786167, -0.07261160016059875, 0.47242745757102966, -0.07321884483098984, 0.03997666388750076, -0.25017303228378296, -0.002846458926796913, -0.11269938200712204, 0.11758255958557129, 0.21061857044696808, -0.17197945713996887, -0.011430317535996437, -0.16563518345355988, -0.17186018824577332, 0.3453705608844757, -0.29822811484336853, -0.007909975945949554, -0.048335589468479156, -0.0962977483868599, 0.10580690205097198, -0.15345974266529083, -0.1161600723862648, -0.035666029900312424, 0.5569813251495361, 0.06487800925970078, 0.10098551213741302, 0.4554862380027771, 0.24624870717525482, -0.1711745411157608, -0.017356501892209053, 0.11782010644674301, -0.047506771981716156, -0.244648277759552, 0.5226964950561523, -0.16531306505203247, 0.06894919276237488, -0.010999193415045738, 0.44290846586227417, 0.21206620335578918, 0.1861412227153778, 0.21504612267017365, -0.5193061232566833, -0.3761092722415924, 0.05212967097759247, 0.031696490943431854, -0.09302841126918793, 0.09982217103242874, 0.31732070446014404, 0.15340982377529144, -0.07626151293516159, -0.16909442842006683, 0.1749005764722824, -0.25561368465423584, -0.1048172116279602, 0.258539617061615, -0.08219268172979355, 0.0899125412106514, -0.02797398716211319, -0.027325525879859924, 0.3879398703575134, 0.06210317462682724, -0.09676886349916458, -0.3535202741622925, 0.14951413869857788, 0.13569484651088715, -0.20962338149547577, 0.013219819404184818, 0.051229216158390045, -0.16627737879753113, -0.1299229860305786, 0.2512512803077698, 0.4250430166721344, 0.0007596388459205627, -0.05356661230325699, 0.08089323341846466, 0.17226338386535645, -0.14647096395492554, 0.20875149965286255, 0.058074675500392914, 0.24676387012004852, 0.07932333648204803, 0.29785284399986267, 0.14731404185295105, 0.11894167959690094, -0.08750268816947937, -0.05226915329694748, -0.3268471956253052, 0.01988496445119381, 0.19723758101463318, -0.400179386138916, 0.05438394472002983, -0.05865780636668205, 0.15956994891166687, 0.10329806804656982, -0.3632238209247589, 0.06705788522958755, 0.2499960958957672, -0.044391900300979614, -0.28874915838241577, -0.05178335681557655, 0.12455461919307709, 0.11662911623716354, -0.01789606362581253, 0.3292226791381836, 0.010774131864309311, 0.2730662226676941, 0.07709703594446182, 0.09136998653411865, 0.3449521064758301, 0.3370141386985779, 0.3338039517402649, -0.04911838844418526, -0.030499938875436783, 0.1799362599849701, 0.24305567145347595, 0.14199404418468475, 0.13666771352291107, -0.01925937831401825, -0.21948546171188354, 0.08317461609840393, -0.35119616985321045, -0.006990153342485428, 0.431905597448349, -0.5737305879592896, 0.15860150754451752, 0.2160060703754425, -0.04264301061630249, -0.00822688639163971, 0.09339935332536697, 0.3367854654788971, -0.3819894790649414, -0.24889646470546722, -0.03622754290699959, 0.5109570622444153, -0.19174864888191223, 0.04151790589094162, 0.11039604246616364, -0.051594097167253494, -0.2554922103881836, 0.19538314640522003, 0.028576543554663658, -0.28432708978652954, 0.24782317876815796, 0.124426931142807, -0.34711408615112305, -0.064704030752182, -0.06553301215171814, 0.3029244542121887, 0.2053682506084442, -0.16943864524364471, 0.2749864459037781, -0.019212789833545685, -0.10627928376197815, -0.1873902827501297, 0.4902991056442261, 0.5535153150558472, 0.20494751632213593, 0.13270144164562225, -0.03467975929379463, 0.13322745263576508, -0.05051777884364128, 0.08940935134887695, -0.012194283306598663, 0.1002063974738121, 0.2982730269432068, 0.2610972821712494, -0.0019878679886460304, -0.05949942022562027, 0.24365340173244476, 0.12570804357528687, 0.032813601195812225, -0.17094220221042633, 0.11234975606203079, -0.18229161202907562, -0.03238895535469055, -0.1651519536972046, -0.018777363002300262, -0.16205136477947235, 0.12174982577562332, -0.012409349903464317, -0.07424899935722351, 0.03738851100206375, 0.09370987117290497, -0.01831422559916973, 0.04560202732682228, 0.43018805980682373, 0.4466475546360016, 0.22009512782096863, -0.24045810103416443, -0.32894760370254517, -0.4238293170928955, 0.23159149289131165, -0.06855212152004242, -0.032110121101140976, 0.08000487834215164, -0.16966772079467773, -0.24353355169296265, 0.05692856386303902, -0.2007225602865219, 0.08634386956691742, -0.09213126450777054, -0.0356055423617363, -0.38640832901000977, -0.3203233778476715, 0.20710636675357819, -0.504932165145874, 0.05598342418670654, -0.2207610309123993, 0.08362366259098053, -0.2684440314769745, -0.05967707559466362, -0.16337309777736664, 0.07350222766399384, -0.203727588057518, -0.273823082447052, 0.3533514738082886, 0.24032822251319885, 0.4313969314098358, 0.005841799080371857, 0.010897619649767876, -0.05499209836125374, -0.26225265860557556, -0.42907094955444336, 0.31717437505722046, 0.15705612301826477, 0.4017355144023895, 0.1345764547586441, -0.22432468831539154, -0.21997900307178497, 0.38640299439430237, -0.008767351508140564, 0.2575712502002716, -0.2351817935705185, 0.1697346717119217, -0.2076844871044159, 0.2996113896369934, 0.001550924964249134, 0.1316712200641632, -0.1252760887145996, 0.22638022899627686, -0.5028040409088135, -0.419660359621048, 0.5630554556846619, -0.5292174220085144, -0.22759851813316345, 0.12313235551118851, 0.18161098659038544, -0.054873086512088776, -0.48253127932548523, -0.6626619100570679, 0.04129604250192642, 0.21086059510707855, -0.21811074018478394, -0.4523668587207794, 0.3578994572162628, 0.024907410144805908, 0.04843120649456978, -0.06543023884296417, 0.4352567493915558, 0.10593685507774353, -0.2638019323348999, 0.06382007896900177, -0.04446040838956833 ]
https://github.com/huggingface/datasets/issues/6401
dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") not working
Seems like it's a problem with the dataset, since in the [README](https://huggingface.co/datasets/Hyperspace-Technologies/scp-wiki-text/blob/main/README.md) the validation is not specified. Try cloning the dataset, removing the README (or validation split), and loading it locally/
### Describe the bug ``` (datasets) mruserbox@guru-X99:/media/10TB_HHD/_LLM_DATASETS$ python dataset.py Downloading readme: 100%|███████████████████████████████████| 360/360 [00:00<00:00, 2.16MB/s] Downloading data: 100%|█████████████████████████████████| 65.1M/65.1M [00:19<00:00, 3.38MB/s] Downloading data: 100%|█████████████████████████████████| 6.35k/6.35k [00:00<00:00, 20.7kB/s] Downloading data: 100%|█████████████████████████████████| 7.29M/7.29M [00:01<00:00, 3.99MB/s] Downloading data files: 100%|██████████████████████████████████| 3/3 [00:21<00:00, 7.14s/it] Extracting data files: 100%|█████████████████████████████████| 3/3 [00:00<00:00, 1624.23it/s] Generating train split: 100%|█████████████| 314294/314294 [00:00<00:00, 668186.58 examples/s] Generating validation split: 120 examples [00:00, 100422.28 examples/s] Generating test split: 100%|████████████████| 34922/34922 [00:00<00:00, 754683.41 examples/s] Traceback (most recent call last): File "/media/10TB_HHD/_LLM_DATASETS/dataset.py", line 3, in <module> dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/load.py", line 2153, in load_dataset builder_instance.download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 1067, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/utils/info_utils.py", line 93, in verify_splits raise UnexpectedSplits(str(set(recorded_splits) - set(expected_splits))) datasets.utils.info_utils.UnexpectedSplits: {'validation'} ``` ### Steps to reproduce the bug Name: `dataset.py` Code: ``` from datasets import load_dataset dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") ``` ### Expected behavior Run without errors ### Environment info ``` name: datasets channels: - defaults dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - bzip2=1.0.8=h7b6447c_0 - ca-certificates=2023.08.22=h06a4308_0 - ld_impl_linux-64=2.38=h1181459_1 - libffi=3.4.4=h6a678d5_0 - libgcc-ng=11.2.0=h1234567_1 - libgomp=11.2.0=h1234567_1 - libstdcxx-ng=11.2.0=h1234567_1 - libuuid=1.41.5=h5eee18b_0 - ncurses=6.4=h6a678d5_0 - openssl=3.0.12=h7f8727e_0 - python=3.10.13=h955ad1f_0 - readline=8.2=h5eee18b_0 - setuptools=68.0.0=py310h06a4308_0 - sqlite=3.41.2=h5eee18b_0 - tk=8.6.12=h1ccaba5_0 - wheel=0.41.2=py310h06a4308_0 - xz=5.4.2=h5eee18b_0 - zlib=1.2.13=h5eee18b_0 - pip: - aiohttp==3.8.6 - aiosignal==1.3.1 - async-timeout==4.0.3 - attrs==23.1.0 - certifi==2023.7.22 - charset-normalizer==3.3.2 - click==8.1.7 - datasets==2.14.6 - dill==0.3.7 - filelock==3.13.1 - frozenlist==1.4.0 - fsspec==2023.10.0 - huggingface-hub==0.19.0 - idna==3.4 - multidict==6.0.4 - multiprocess==0.70.15 - numpy==1.26.1 - openai==0.27.8 - packaging==23.2 - pandas==2.1.3 - pip==23.3.1 - platformdirs==4.0.0 - pyarrow==14.0.1 - python-dateutil==2.8.2 - pytz==2023.3.post1 - pyyaml==6.0.1 - requests==2.31.0 - six==1.16.0 - tomli==2.0.1 - tqdm==4.66.1 - typer==0.9.0 - typing-extensions==4.8.0 - tzdata==2023.3 - urllib3==2.0.7 - xxhash==3.4.1 - yarl==1.9.2 prefix: /home/mruserbox/miniconda3/envs/datasets ```
31
dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") not working ### Describe the bug ``` (datasets) mruserbox@guru-X99:/media/10TB_HHD/_LLM_DATASETS$ python dataset.py Downloading readme: 100%|███████████████████████████████████| 360/360 [00:00<00:00, 2.16MB/s] Downloading data: 100%|█████████████████████████████████| 65.1M/65.1M [00:19<00:00, 3.38MB/s] Downloading data: 100%|█████████████████████████████████| 6.35k/6.35k [00:00<00:00, 20.7kB/s] Downloading data: 100%|█████████████████████████████████| 7.29M/7.29M [00:01<00:00, 3.99MB/s] Downloading data files: 100%|██████████████████████████████████| 3/3 [00:21<00:00, 7.14s/it] Extracting data files: 100%|█████████████████████████████████| 3/3 [00:00<00:00, 1624.23it/s] Generating train split: 100%|█████████████| 314294/314294 [00:00<00:00, 668186.58 examples/s] Generating validation split: 120 examples [00:00, 100422.28 examples/s] Generating test split: 100%|████████████████| 34922/34922 [00:00<00:00, 754683.41 examples/s] Traceback (most recent call last): File "/media/10TB_HHD/_LLM_DATASETS/dataset.py", line 3, in <module> dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/load.py", line 2153, in load_dataset builder_instance.download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 1067, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/utils/info_utils.py", line 93, in verify_splits raise UnexpectedSplits(str(set(recorded_splits) - set(expected_splits))) datasets.utils.info_utils.UnexpectedSplits: {'validation'} ``` ### Steps to reproduce the bug Name: `dataset.py` Code: ``` from datasets import load_dataset dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") ``` ### Expected behavior Run without errors ### Environment info ``` name: datasets channels: - defaults dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - bzip2=1.0.8=h7b6447c_0 - ca-certificates=2023.08.22=h06a4308_0 - ld_impl_linux-64=2.38=h1181459_1 - libffi=3.4.4=h6a678d5_0 - libgcc-ng=11.2.0=h1234567_1 - libgomp=11.2.0=h1234567_1 - libstdcxx-ng=11.2.0=h1234567_1 - libuuid=1.41.5=h5eee18b_0 - ncurses=6.4=h6a678d5_0 - openssl=3.0.12=h7f8727e_0 - python=3.10.13=h955ad1f_0 - readline=8.2=h5eee18b_0 - setuptools=68.0.0=py310h06a4308_0 - sqlite=3.41.2=h5eee18b_0 - tk=8.6.12=h1ccaba5_0 - wheel=0.41.2=py310h06a4308_0 - xz=5.4.2=h5eee18b_0 - zlib=1.2.13=h5eee18b_0 - pip: - aiohttp==3.8.6 - aiosignal==1.3.1 - async-timeout==4.0.3 - attrs==23.1.0 - certifi==2023.7.22 - charset-normalizer==3.3.2 - click==8.1.7 - datasets==2.14.6 - dill==0.3.7 - filelock==3.13.1 - frozenlist==1.4.0 - fsspec==2023.10.0 - huggingface-hub==0.19.0 - idna==3.4 - multidict==6.0.4 - multiprocess==0.70.15 - numpy==1.26.1 - openai==0.27.8 - packaging==23.2 - pandas==2.1.3 - pip==23.3.1 - platformdirs==4.0.0 - pyarrow==14.0.1 - python-dateutil==2.8.2 - pytz==2023.3.post1 - pyyaml==6.0.1 - requests==2.31.0 - six==1.16.0 - tomli==2.0.1 - tqdm==4.66.1 - typer==0.9.0 - typing-extensions==4.8.0 - tzdata==2023.3 - urllib3==2.0.7 - xxhash==3.4.1 - yarl==1.9.2 prefix: /home/mruserbox/miniconda3/envs/datasets ``` Seems like it's a problem with the dataset, since in the [README](https://huggingface.co/datasets/Hyperspace-Technologies/scp-wiki-text/blob/main/README.md) the validation is not specified. Try cloning the dataset, removing the README (or validation split), and loading it locally/
[ -0.43042606115341187, -0.008431702852249146, -0.09224669635295868, 0.250620037317276, 0.2844744324684143, 0.03460143506526947, 0.37043705582618713, 0.331123024225235, -0.011478844098746777, 0.15837816894054413, 0.0520012229681015, 0.12657010555267334, -0.14188876748085022, 0.34579816460609436, 0.07558071613311768, -0.1303650587797165, 0.01405605673789978, 0.17566196620464325, 0.06794780492782593, -0.017901498824357986, -0.19313770532608032, -0.06070897728204727, -0.3589588403701782, -0.12903320789337158, -0.39957892894744873, 0.009388595819473267, 0.090804323554039, 0.18095648288726807, -0.17682762444019318, -0.4657302796840668, 0.4197489619255066, 0.09621340781450272, 0.22703184187412262, 0.4969407916069031, -0.00011065353464800864, 0.18732644617557526, 0.42547279596328735, 0.05509106069803238, -0.372789204120636, -0.1715572327375412, -0.29049256443977356, -0.33467864990234375, -0.03461942821741104, -0.284835547208786, -0.10100143402814865, -0.02641439437866211, -0.09188355505466461, -0.014803111553192139, 0.3305971026420593, 0.5596956014633179, 0.2420116513967514, 0.23466750979423523, 0.07197901606559753, -0.11114874482154846, 0.3672181963920593, -0.07488319277763367, -0.06610888987779617, 0.3018825948238373, -0.09919311106204987, 0.07369634509086609, -0.03024231642484665, 0.2843508720397949, -0.0182209275662899, 0.1083454042673111, 0.401775062084198, 0.11840785294771194, -0.33236294984817505, -0.1301729530096054, 0.029541343450546265, 0.3739522695541382, 0.6675484776496887, -0.17987030744552612, -0.015996741130948067, 0.005610145628452301, -0.10928664356470108, -0.14651159942150116, 0.37976619601249695, 0.29103150963783264, -0.11298182606697083, 0.10920673608779907, -0.3617898225784302, 0.06104438379406929, -0.27435868978500366, 0.2718935012817383, -0.19756411015987396, 0.5019978284835815, -0.05928371846675873, -0.015689022839069366, 0.19770267605781555, 0.06316901743412018, 0.3460747301578522, -0.23939523100852966, 0.025408286601305008, 0.05307982861995697, -0.3131839334964752, -0.0653548389673233, -0.09992443770170212, 0.02359461784362793, 0.22864899039268494, 0.12882915139198303, 0.06496386975049973, 0.07579496502876282, 0.2062591314315796, 0.06399102509021759, 0.01750263012945652, 0.22159363329410553, -0.15110281109809875, 0.23590634763240814, 0.3547987937927246, 0.41987690329551697, -0.17768502235412598, -0.0816946029663086, -0.0492330864071846, -0.14695976674556732, 0.08005209267139435, -0.22379475831985474, 0.23701973259449005, -0.046703092753887177, -0.2802262008190155, 0.3014678359031677, -0.3658096194267273, -0.08495767414569855, -0.029076170176267624, 0.556648850440979, -0.04947527125477791, 0.22300556302070618, 0.22452615201473236, 0.23724231123924255, -0.1501494199037552, -0.15587197244167328, -0.2586236000061035, 0.13615353405475616, -0.32563531398773193, -0.030439971014857292, 0.3806803822517395, 0.28015458583831787, 0.2857862114906311, 0.006130487658083439, 0.053121842443943024, -0.32191503047943115, 0.06141606718301773, -0.14322184026241302, -0.01671881228685379, 0.1996956318616867, 0.042529601603746414, 0.06364899128675461, -0.03204558417201042, 0.09386648237705231, 0.054385192692279816, 0.16107168793678284, -0.22722706198692322, -0.1563200205564499, -0.04712502658367157, 0.3463669419288635, 0.041565604507923126, -0.2142396867275238, -0.2569637894630432, 0.08811717480421066, 0.3096737265586853, -0.11606352031230927, -0.03276043385267258, -0.18349526822566986, -0.24357733130455017, -0.1765575408935547, 0.3825886845588684, 0.3844467103481293, -0.277827650308609, -0.06704430282115936, 0.0964963361620903, -0.11053629219532013, 0.34121304750442505, -0.071565181016922, -0.2678426504135132, 0.45753201842308044, -0.22586849331855774, 0.21618573367595673, 0.19150066375732422, -0.3607233762741089, -0.5163547396659851, 0.11233333498239517, -0.009367451071739197, -0.058432817459106445, 0.1714220941066742, -0.016583211719989777, 0.09725436568260193, 0.22284749150276184, -0.04988864064216614, 0.3086671233177185, 0.016916539520025253, 0.20969465374946594, -0.4382671117782593, -0.20554637908935547, 0.2406986653804779, 0.22068405151367188, 0.3376164138317108, -0.0013667643070220947, 0.2476615607738495, 0.4369827210903168, 0.42608773708343506, -0.07040755450725555, 0.11833726614713669, 0.21976950764656067, 0.08563647419214249, -0.1188923567533493, -0.1741180270910263, -0.30241480469703674, -0.38454484939575195, 0.17318332195281982, -0.004854768514633179, 0.0580570250749588, 0.03035774827003479, -0.037460729479789734, -0.47203248739242554, -0.08484223484992981, -0.43505585193634033, -0.22703242301940918, 0.17750516533851624, 0.038918085396289825, 0.2932179868221283, -0.04936312139034271, -0.023731186985969543, 0.18491806089878082, -0.17072777450084686, 0.1650630533695221, -0.07453259825706482, 0.5730958580970764, -0.2516409158706665, -0.15997841954231262, -0.03961341083049774, 0.25131964683532715, 0.181321382522583, -0.14317888021469116, -0.22105753421783447, 0.4068355858325958, -0.03762203827500343, -0.16761179268360138, -0.16814583539962769, -0.14490769803524017, 0.2542450428009033, -0.476418673992157, 0.1343381553888321, 0.15261733531951904, 0.1992867887020111, -0.002499222755432129, -0.3215770125389099, 0.15450796484947205, 0.15058299899101257, 0.16415727138519287, 0.09096910059452057, -0.03140809386968613, 0.1454874724149704, -0.36015573143959045, 0.18459351360797882, -0.09885534644126892, 0.26876723766326904, -0.07091653347015381, 0.32943034172058105, -0.046451278030872345, -0.03945992514491081, -0.11663498729467392, 0.3955599069595337, 0.07017691433429718, 0.06027064844965935, 0.09208656847476959, -0.23491060733795166, -0.2483978569507599, 0.0051465146243572235, 0.31317567825317383, 0.2963564693927765, 0.21730056405067444, 0.027018997818231583, 0.15732380747795105, 0.0029818755574524403, -0.21647413074970245, 0.16581003367900848, 0.04432874917984009, 0.23701739311218262, 0.3515376150608063, 0.19220657646656036, -0.040778614580631256, -0.43309250473976135, -0.04374619200825691, 0.13261647522449493, 0.21115605533123016, -0.2966901659965515, -0.003965076059103012, -0.2971692681312561, 0.037788912653923035, -0.11315399408340454, 0.21289511024951935, 0.022423217073082924, -0.3525303602218628, -0.0553673580288887, 0.07856321334838867, 0.007029231637716293, 0.24684180319309235, -0.4388485550880432, -0.009702011942863464, 0.0743907168507576, -0.1186911091208458, -0.26643404364585876, -0.02916465327143669, -0.3239477276802063, 0.12790246307849884, 0.1281142681837082, 0.1694859266281128, 0.28651538491249084, -0.010623820126056671, -0.1882646381855011, -0.10122904181480408, -0.1583450436592102, 0.19977158308029175, 0.10861852020025253, 0.010250025428831577, 0.034253720194101334, 0.2289695292711258, 0.14076043665409088, -0.19619698822498322, 0.398245632648468, -0.2839893400669098, -0.16500571370124817, 0.1764984279870987, 0.1087934747338295, -0.13578040897846222, -0.14589205384254456, -0.43355777859687805, -0.42098110914230347, -0.47282978892326355, -0.25366121530532837, -0.010943237692117691, 0.03544978052377701, 0.3531796336174011, 0.19469663500785828, 0.0853266566991806, -0.055710263550281525, -0.056991033256053925, -0.26557686924934387, -0.18850941956043243, 0.30597615242004395, -0.18807955086231232, -0.40852341055870056, -0.005216214805841446, -0.11215046048164368, -0.09232836961746216, 0.21698427200317383, -0.4986536502838135, -0.07779917865991592, -0.4047694504261017, 0.3416639566421509, -0.12057255208492279, 0.2427552342414856, 0.2383081018924713, -0.05542532354593277, -0.11310715973377228, -0.21267497539520264, 0.1280859112739563, 0.14627888798713684, -0.09693899005651474, 0.14049972593784332, 0.05371423810720444, 0.2573609948158264, 0.09244862198829651, 0.6970297694206238, 0.21572981774806976, -0.13261882960796356, 0.5545891523361206, -0.17392535507678986, 0.16497229039669037, -0.07067864388227463, -0.23696602880954742, 0.3256145417690277, -0.13179290294647217, 0.021061066538095474, 0.2744563817977905, -0.16017037630081177, 0.026821669191122055, -0.10253484547138214, 0.09475888311862946, -0.2954777181148529, -0.10617382824420929, 0.014751004986464977, -0.04669773578643799, 0.25295892357826233, 0.13902254402637482, 0.12370065599679947, 0.060846198350191116, -0.19584360718727112, 0.06675770878791809, 0.06470171362161636, -0.16996413469314575, -0.036746613681316376, -0.3683865964412689, 0.13557107746601105, -0.47084224224090576, 0.1993793249130249, 0.20029719173908234, 0.19360405206680298, -0.09157353639602661, 0.062340833246707916, 0.10409428924322128, -0.19971710443496704, 0.6721086502075195, -0.20622187852859497, 0.4028857946395874, 0.039404064416885376, 0.3514350950717926, -0.04273328557610512, -0.24910235404968262, -0.2524747848510742, -0.20674583315849304, 0.06008157134056091, 0.13747961819171906, -0.35249873995780945, -0.21536676585674286, 0.5600379705429077, 0.08521725982427597, -0.08814258873462677, -0.04018772765994072, -0.13543476164340973, -0.2766627073287964, -0.25067535042762756, 0.05547577515244484, -0.04650871455669403, 0.5092901587486267, -0.22952784597873688, -0.19951967895030975, 0.029450273141264915, -0.1389806568622589, -0.045589447021484375, 0.11028185486793518, 0.36459848284721375, -0.006554998457431793, 0.10588502883911133, -0.05688853561878204, 0.031034814193844795, 0.47342658042907715, 0.6395003795623779, -0.14596135914325714, -0.29352691769599915, -0.049936793744564056, -0.10958513617515564, 0.2540223300457001, 0.22029274702072144, -0.16207630932331085, -0.11621680110692978, 0.14482605457305908, 0.2778766453266144, -0.20211583375930786, 0.1415720283985138, 0.257628858089447, -0.08034618198871613, -0.18906503915786743, -0.4292067587375641, 0.6346047520637512, -0.02245279960334301, 0.13755206763744354, -0.2516222894191742, 0.20213009417057037, -0.43684545159339905, 0.1271488070487976, -0.0820339098572731, 0.8030058741569519, 0.1346164345741272, 0.2213902473449707, 0.36997511982917786, 0.15973863005638123, 0.1569778323173523, -0.5928217768669128, 0.11121559143066406, -0.2420578896999359, -0.10602543503046036, -0.09730860590934753, -0.22226795554161072, 0.06821749359369278, 0.2795500159263611, -0.33304446935653687, 0.05829572305083275, -0.2014779895544052, 0.27808600664138794, 0.11015400290489197, 0.3422137498855591, -0.14201100170612335, -0.004875103011727333, -0.06489110738039017, 0.23659631609916687, -0.07479359209537506, 0.14851810038089752, -0.1867923140525818, -0.04768816754221916, -0.17245052754878998, -0.270622193813324, -0.3144449293613434, 0.41049081087112427, -0.47883933782577515, 0.22201013565063477, 0.013482658192515373, -0.32536423206329346, 0.03191690519452095, 0.13510793447494507, 0.0514756515622139, 0.20974278450012207, -0.11298611760139465, 0.3389541506767273, -0.14877566695213318, 0.04984406381845474, -0.09140404313802719, 0.09692510962486267, 0.1782173216342926, -0.11603545397520065, -0.19586826860904694, 0.03584786504507065, -0.12475033104419708, -0.3132910132408142, 0.13452103734016418, 0.09098286926746368, -0.03962050378322601, -0.4856768548488617, -0.07538902759552002, -0.05429947376251221, 0.009145233780145645, -0.4123051166534424, 0.167663112282753, -0.022827737033367157, -0.2506535053253174, 0.09150952845811844, 0.1583857238292694, -0.22185948491096497, -0.11135269701480865, 0.33266890048980713, 0.04962866008281708, 0.24378681182861328, 0.5614922046661377, 0.1145794540643692, -0.16873612999916077, -0.2856435179710388, 0.2320270538330078, 0.218397319316864, -0.3025098741054535, 0.23700624704360962, 0.03651242330670357, -0.008538290858268738, -0.07402632385492325, 0.4753800630569458, -0.014695998281240463, -0.03759480267763138, 0.037904415279626846, -0.48841649293899536, 0.026880623772740364, 0.04038117825984955, 0.03908313438296318, 0.11507004499435425, -0.04818318411707878, 0.3321884870529175, 0.020851073786616325, 0.06147602200508118, -0.37415429949760437, 0.08681332319974899, -0.24088111519813538, 0.016586560755968094, 0.11877945810556412, -0.2069111466407776, 0.16333802044391632, -0.20746488869190216, 0.1568457931280136, -0.0005889870226383209, -0.09866007417440414, -0.32184702157974243, -0.33883577585220337, 0.10951849818229675, 0.21093440055847168, -0.048385076224803925, 0.0147020248696208, -0.10146288573741913, -0.13916605710983276, -0.08437810838222504, 0.16127213835716248, -0.017415162175893784, -0.06660009920597076, 0.32227832078933716, 0.06574457883834839, 0.1595868617296219, -0.2360483855009079, -0.002960655838251114, -0.20383352041244507, 0.41149431467056274, -0.0431993342936039, 0.030833574011921883, 0.2795223891735077, 0.10214516520500183, -0.3583771884441376, 0.11243562400341034, 0.2028009295463562, -0.11863786727190018, 0.2685973048210144, -0.5279079675674438, -0.048463158309459686, 0.23851458728313446, 0.32236742973327637, 0.498151957988739, -0.22012042999267578, -0.050872087478637695, 0.08529871702194214, 0.30547666549682617, -0.4090593457221985, -0.09591951221227646, 0.08037936687469482, -0.18205517530441284, 0.16879506409168243, 0.04439357668161392, 0.20506495237350464, -0.06429729610681534, -0.18453796207904816, 0.12744426727294922, 0.32041704654693604, -0.1141420304775238, 0.18220305442810059, 0.33203041553497314, -0.021952945739030838, 0.17682260274887085, 0.21278607845306396, 0.012005938217043877, 0.08041407912969589, 0.5559014081954956, 0.11634042114019394, 0.5096238851547241, -0.0008179359138011932, 0.21820546686649323, -0.20087304711341858, -0.3552173972129822, 0.06424610316753387, 0.0016946196556091309, -0.30867019295692444, 0.09232379496097565, -0.2025303840637207, 0.06010310351848602, -0.31954658031463623, -0.09218988567590714, -0.3766682744026184, 0.02659646049141884, -0.05704832077026367, -0.023087799549102783, -0.13583305478096008, -0.22167852520942688, -0.3292272388935089, 0.16398018598556519, 0.1340884119272232, 0.0012102723121643066, 0.18411758542060852, 0.08229149132966995, -0.2606726884841919, -0.367195188999176, 0.13744154572486877, 0.15145960450172424, 0.05455572530627251, -0.4126283526420593, 0.21819737553596497, 0.0722658783197403, -0.1983221173286438, -0.018187880516052246, 0.310713529586792, 0.34944748878479004, 0.3097696900367737, -0.17879822850227356, -0.2279844433069229, -0.05201837047934532, -0.11984270066022873, -0.18853318691253662, 0.27930134534835815, 0.40610891580581665, 0.14334876835346222, 0.19159232079982758, 0.18774467706680298, -0.3174844980239868, 0.013770250603556633, 0.15767830610275269, 0.01688951440155506, -0.29055991768836975, 0.20629476010799408, -0.07068391144275665, -0.21025270223617554, -0.1565832942724228, -0.09215784817934036, -0.2617783546447754, 0.2186889499425888, 0.18550364673137665, 0.0749477669596672, 0.2572931945323944, -0.17717280983924866, 0.09062302857637405, -0.026036716997623444, 0.5619212985038757, 0.30393609404563904, -0.05153089016675949, -0.4313873052597046, -0.046980470418930054, -0.5314911007881165, 0.019759878516197205, -0.2961725890636444, -0.25308313965797424, -0.05559070408344269, 0.14391955733299255, -0.03608321398496628, 0.13191203773021698, 0.11837916821241379, -0.03416097164154053, 0.2695852220058441, 0.11208921670913696, -0.24737875163555145, 0.015421146526932716, 0.09341005235910416, 0.07430636137723923, -0.10550114512443542, -0.6078809499740601, 0.19187311828136444, -0.25154298543930054, 0.02818315476179123, -0.05268396437168121, -0.04525202512741089, 0.2628057599067688, -0.4704650938510895, 0.5863542556762695, -0.016429590061306953, 0.5952324271202087, -0.19701740145683289, 0.04998869448900223, -0.30786678194999695, -0.12366561591625214, -0.3359176516532898, -0.054053306579589844, 0.0022580474615097046, 0.42114293575286865, 0.04680144041776657, 0.002020847052335739, -0.2502622604370117, 0.18073971569538116, 0.12414982914924622, 0.0583854541182518, -0.06155730038881302, -0.0783674418926239, -0.08474504947662354, 0.05164249613881111, 0.44483304023742676, 0.10267257690429688, -0.23805752396583557, 0.04866763949394226, -0.31674396991729736, -0.5541096925735474, 0.16719962656497955, -0.20786643028259277, -0.4059980809688568, -0.19747497141361237, 0.18185967206954956, -0.29476651549339294, -0.02155882678925991, -0.4484851658344269, -0.0061880797147750854, 0.30881190299987793, -0.10587040334939957, -0.31793642044067383, 0.2793039083480835, 0.1935575306415558, -0.10651232302188873, 0.08658808469772339, 0.3190279006958008, 0.02615254372358322, -0.26211026310920715, -0.17234504222869873, -0.19802115857601166 ]
https://github.com/huggingface/datasets/issues/6401
dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") not working
@VarunNSrivastava thanks brother, working beautiful now ``` C:\_Work\_datasets>py dataset.py Downloading data files: 100%|████████████████████████████████████████████████████████████████████| 3/3 [00:00<?, ?it/s] Extracting data files: 100%|████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 599.90it/s] Generating train split: 314294 examples [00:00, 1293222.03 examples/s] Generating validation split: 120 examples [00:00, 59053.91 examples/s] Generating test split: 34922 examples [00:00, 1343275.84 examples/s] ```
### Describe the bug ``` (datasets) mruserbox@guru-X99:/media/10TB_HHD/_LLM_DATASETS$ python dataset.py Downloading readme: 100%|███████████████████████████████████| 360/360 [00:00<00:00, 2.16MB/s] Downloading data: 100%|█████████████████████████████████| 65.1M/65.1M [00:19<00:00, 3.38MB/s] Downloading data: 100%|█████████████████████████████████| 6.35k/6.35k [00:00<00:00, 20.7kB/s] Downloading data: 100%|█████████████████████████████████| 7.29M/7.29M [00:01<00:00, 3.99MB/s] Downloading data files: 100%|██████████████████████████████████| 3/3 [00:21<00:00, 7.14s/it] Extracting data files: 100%|█████████████████████████████████| 3/3 [00:00<00:00, 1624.23it/s] Generating train split: 100%|█████████████| 314294/314294 [00:00<00:00, 668186.58 examples/s] Generating validation split: 120 examples [00:00, 100422.28 examples/s] Generating test split: 100%|████████████████| 34922/34922 [00:00<00:00, 754683.41 examples/s] Traceback (most recent call last): File "/media/10TB_HHD/_LLM_DATASETS/dataset.py", line 3, in <module> dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/load.py", line 2153, in load_dataset builder_instance.download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 1067, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/utils/info_utils.py", line 93, in verify_splits raise UnexpectedSplits(str(set(recorded_splits) - set(expected_splits))) datasets.utils.info_utils.UnexpectedSplits: {'validation'} ``` ### Steps to reproduce the bug Name: `dataset.py` Code: ``` from datasets import load_dataset dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") ``` ### Expected behavior Run without errors ### Environment info ``` name: datasets channels: - defaults dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - bzip2=1.0.8=h7b6447c_0 - ca-certificates=2023.08.22=h06a4308_0 - ld_impl_linux-64=2.38=h1181459_1 - libffi=3.4.4=h6a678d5_0 - libgcc-ng=11.2.0=h1234567_1 - libgomp=11.2.0=h1234567_1 - libstdcxx-ng=11.2.0=h1234567_1 - libuuid=1.41.5=h5eee18b_0 - ncurses=6.4=h6a678d5_0 - openssl=3.0.12=h7f8727e_0 - python=3.10.13=h955ad1f_0 - readline=8.2=h5eee18b_0 - setuptools=68.0.0=py310h06a4308_0 - sqlite=3.41.2=h5eee18b_0 - tk=8.6.12=h1ccaba5_0 - wheel=0.41.2=py310h06a4308_0 - xz=5.4.2=h5eee18b_0 - zlib=1.2.13=h5eee18b_0 - pip: - aiohttp==3.8.6 - aiosignal==1.3.1 - async-timeout==4.0.3 - attrs==23.1.0 - certifi==2023.7.22 - charset-normalizer==3.3.2 - click==8.1.7 - datasets==2.14.6 - dill==0.3.7 - filelock==3.13.1 - frozenlist==1.4.0 - fsspec==2023.10.0 - huggingface-hub==0.19.0 - idna==3.4 - multidict==6.0.4 - multiprocess==0.70.15 - numpy==1.26.1 - openai==0.27.8 - packaging==23.2 - pandas==2.1.3 - pip==23.3.1 - platformdirs==4.0.0 - pyarrow==14.0.1 - python-dateutil==2.8.2 - pytz==2023.3.post1 - pyyaml==6.0.1 - requests==2.31.0 - six==1.16.0 - tomli==2.0.1 - tqdm==4.66.1 - typer==0.9.0 - typing-extensions==4.8.0 - tzdata==2023.3 - urllib3==2.0.7 - xxhash==3.4.1 - yarl==1.9.2 prefix: /home/mruserbox/miniconda3/envs/datasets ```
48
dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") not working ### Describe the bug ``` (datasets) mruserbox@guru-X99:/media/10TB_HHD/_LLM_DATASETS$ python dataset.py Downloading readme: 100%|███████████████████████████████████| 360/360 [00:00<00:00, 2.16MB/s] Downloading data: 100%|█████████████████████████████████| 65.1M/65.1M [00:19<00:00, 3.38MB/s] Downloading data: 100%|█████████████████████████████████| 6.35k/6.35k [00:00<00:00, 20.7kB/s] Downloading data: 100%|█████████████████████████████████| 7.29M/7.29M [00:01<00:00, 3.99MB/s] Downloading data files: 100%|██████████████████████████████████| 3/3 [00:21<00:00, 7.14s/it] Extracting data files: 100%|█████████████████████████████████| 3/3 [00:00<00:00, 1624.23it/s] Generating train split: 100%|█████████████| 314294/314294 [00:00<00:00, 668186.58 examples/s] Generating validation split: 120 examples [00:00, 100422.28 examples/s] Generating test split: 100%|████████████████| 34922/34922 [00:00<00:00, 754683.41 examples/s] Traceback (most recent call last): File "/media/10TB_HHD/_LLM_DATASETS/dataset.py", line 3, in <module> dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/load.py", line 2153, in load_dataset builder_instance.download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 1067, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/utils/info_utils.py", line 93, in verify_splits raise UnexpectedSplits(str(set(recorded_splits) - set(expected_splits))) datasets.utils.info_utils.UnexpectedSplits: {'validation'} ``` ### Steps to reproduce the bug Name: `dataset.py` Code: ``` from datasets import load_dataset dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") ``` ### Expected behavior Run without errors ### Environment info ``` name: datasets channels: - defaults dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - bzip2=1.0.8=h7b6447c_0 - ca-certificates=2023.08.22=h06a4308_0 - ld_impl_linux-64=2.38=h1181459_1 - libffi=3.4.4=h6a678d5_0 - libgcc-ng=11.2.0=h1234567_1 - libgomp=11.2.0=h1234567_1 - libstdcxx-ng=11.2.0=h1234567_1 - libuuid=1.41.5=h5eee18b_0 - ncurses=6.4=h6a678d5_0 - openssl=3.0.12=h7f8727e_0 - python=3.10.13=h955ad1f_0 - readline=8.2=h5eee18b_0 - setuptools=68.0.0=py310h06a4308_0 - sqlite=3.41.2=h5eee18b_0 - tk=8.6.12=h1ccaba5_0 - wheel=0.41.2=py310h06a4308_0 - xz=5.4.2=h5eee18b_0 - zlib=1.2.13=h5eee18b_0 - pip: - aiohttp==3.8.6 - aiosignal==1.3.1 - async-timeout==4.0.3 - attrs==23.1.0 - certifi==2023.7.22 - charset-normalizer==3.3.2 - click==8.1.7 - datasets==2.14.6 - dill==0.3.7 - filelock==3.13.1 - frozenlist==1.4.0 - fsspec==2023.10.0 - huggingface-hub==0.19.0 - idna==3.4 - multidict==6.0.4 - multiprocess==0.70.15 - numpy==1.26.1 - openai==0.27.8 - packaging==23.2 - pandas==2.1.3 - pip==23.3.1 - platformdirs==4.0.0 - pyarrow==14.0.1 - python-dateutil==2.8.2 - pytz==2023.3.post1 - pyyaml==6.0.1 - requests==2.31.0 - six==1.16.0 - tomli==2.0.1 - tqdm==4.66.1 - typer==0.9.0 - typing-extensions==4.8.0 - tzdata==2023.3 - urllib3==2.0.7 - xxhash==3.4.1 - yarl==1.9.2 prefix: /home/mruserbox/miniconda3/envs/datasets ``` @VarunNSrivastava thanks brother, working beautiful now ``` C:\_Work\_datasets>py dataset.py Downloading data files: 100%|████████████████████████████████████████████████████████████████████| 3/3 [00:00<?, ?it/s] Extracting data files: 100%|████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 599.90it/s] Generating train split: 314294 examples [00:00, 1293222.03 examples/s] Generating validation split: 120 examples [00:00, 59053.91 examples/s] Generating test split: 34922 examples [00:00, 1343275.84 examples/s] ```
[ -0.43042606115341187, -0.008431702852249146, -0.09224669635295868, 0.250620037317276, 0.2844744324684143, 0.03460143506526947, 0.37043705582618713, 0.331123024225235, -0.011478844098746777, 0.15837816894054413, 0.0520012229681015, 0.12657010555267334, -0.14188876748085022, 0.34579816460609436, 0.07558071613311768, -0.1303650587797165, 0.01405605673789978, 0.17566196620464325, 0.06794780492782593, -0.017901498824357986, -0.19313770532608032, -0.06070897728204727, -0.3589588403701782, -0.12903320789337158, -0.39957892894744873, 0.009388595819473267, 0.090804323554039, 0.18095648288726807, -0.17682762444019318, -0.4657302796840668, 0.4197489619255066, 0.09621340781450272, 0.22703184187412262, 0.4969407916069031, -0.00011065353464800864, 0.18732644617557526, 0.42547279596328735, 0.05509106069803238, -0.372789204120636, -0.1715572327375412, -0.29049256443977356, -0.33467864990234375, -0.03461942821741104, -0.284835547208786, -0.10100143402814865, -0.02641439437866211, -0.09188355505466461, -0.014803111553192139, 0.3305971026420593, 0.5596956014633179, 0.2420116513967514, 0.23466750979423523, 0.07197901606559753, -0.11114874482154846, 0.3672181963920593, -0.07488319277763367, -0.06610888987779617, 0.3018825948238373, -0.09919311106204987, 0.07369634509086609, -0.03024231642484665, 0.2843508720397949, -0.0182209275662899, 0.1083454042673111, 0.401775062084198, 0.11840785294771194, -0.33236294984817505, -0.1301729530096054, 0.029541343450546265, 0.3739522695541382, 0.6675484776496887, -0.17987030744552612, -0.015996741130948067, 0.005610145628452301, -0.10928664356470108, -0.14651159942150116, 0.37976619601249695, 0.29103150963783264, -0.11298182606697083, 0.10920673608779907, -0.3617898225784302, 0.06104438379406929, -0.27435868978500366, 0.2718935012817383, -0.19756411015987396, 0.5019978284835815, -0.05928371846675873, -0.015689022839069366, 0.19770267605781555, 0.06316901743412018, 0.3460747301578522, -0.23939523100852966, 0.025408286601305008, 0.05307982861995697, -0.3131839334964752, -0.0653548389673233, -0.09992443770170212, 0.02359461784362793, 0.22864899039268494, 0.12882915139198303, 0.06496386975049973, 0.07579496502876282, 0.2062591314315796, 0.06399102509021759, 0.01750263012945652, 0.22159363329410553, -0.15110281109809875, 0.23590634763240814, 0.3547987937927246, 0.41987690329551697, -0.17768502235412598, -0.0816946029663086, -0.0492330864071846, -0.14695976674556732, 0.08005209267139435, -0.22379475831985474, 0.23701973259449005, -0.046703092753887177, -0.2802262008190155, 0.3014678359031677, -0.3658096194267273, -0.08495767414569855, -0.029076170176267624, 0.556648850440979, -0.04947527125477791, 0.22300556302070618, 0.22452615201473236, 0.23724231123924255, -0.1501494199037552, -0.15587197244167328, -0.2586236000061035, 0.13615353405475616, -0.32563531398773193, -0.030439971014857292, 0.3806803822517395, 0.28015458583831787, 0.2857862114906311, 0.006130487658083439, 0.053121842443943024, -0.32191503047943115, 0.06141606718301773, -0.14322184026241302, -0.01671881228685379, 0.1996956318616867, 0.042529601603746414, 0.06364899128675461, -0.03204558417201042, 0.09386648237705231, 0.054385192692279816, 0.16107168793678284, -0.22722706198692322, -0.1563200205564499, -0.04712502658367157, 0.3463669419288635, 0.041565604507923126, -0.2142396867275238, -0.2569637894630432, 0.08811717480421066, 0.3096737265586853, -0.11606352031230927, -0.03276043385267258, -0.18349526822566986, -0.24357733130455017, -0.1765575408935547, 0.3825886845588684, 0.3844467103481293, -0.277827650308609, -0.06704430282115936, 0.0964963361620903, -0.11053629219532013, 0.34121304750442505, -0.071565181016922, -0.2678426504135132, 0.45753201842308044, -0.22586849331855774, 0.21618573367595673, 0.19150066375732422, -0.3607233762741089, -0.5163547396659851, 0.11233333498239517, -0.009367451071739197, -0.058432817459106445, 0.1714220941066742, -0.016583211719989777, 0.09725436568260193, 0.22284749150276184, -0.04988864064216614, 0.3086671233177185, 0.016916539520025253, 0.20969465374946594, -0.4382671117782593, -0.20554637908935547, 0.2406986653804779, 0.22068405151367188, 0.3376164138317108, -0.0013667643070220947, 0.2476615607738495, 0.4369827210903168, 0.42608773708343506, -0.07040755450725555, 0.11833726614713669, 0.21976950764656067, 0.08563647419214249, -0.1188923567533493, -0.1741180270910263, -0.30241480469703674, -0.38454484939575195, 0.17318332195281982, -0.004854768514633179, 0.0580570250749588, 0.03035774827003479, -0.037460729479789734, -0.47203248739242554, -0.08484223484992981, -0.43505585193634033, -0.22703242301940918, 0.17750516533851624, 0.038918085396289825, 0.2932179868221283, -0.04936312139034271, -0.023731186985969543, 0.18491806089878082, -0.17072777450084686, 0.1650630533695221, -0.07453259825706482, 0.5730958580970764, -0.2516409158706665, -0.15997841954231262, -0.03961341083049774, 0.25131964683532715, 0.181321382522583, -0.14317888021469116, -0.22105753421783447, 0.4068355858325958, -0.03762203827500343, -0.16761179268360138, -0.16814583539962769, -0.14490769803524017, 0.2542450428009033, -0.476418673992157, 0.1343381553888321, 0.15261733531951904, 0.1992867887020111, -0.002499222755432129, -0.3215770125389099, 0.15450796484947205, 0.15058299899101257, 0.16415727138519287, 0.09096910059452057, -0.03140809386968613, 0.1454874724149704, -0.36015573143959045, 0.18459351360797882, -0.09885534644126892, 0.26876723766326904, -0.07091653347015381, 0.32943034172058105, -0.046451278030872345, -0.03945992514491081, -0.11663498729467392, 0.3955599069595337, 0.07017691433429718, 0.06027064844965935, 0.09208656847476959, -0.23491060733795166, -0.2483978569507599, 0.0051465146243572235, 0.31317567825317383, 0.2963564693927765, 0.21730056405067444, 0.027018997818231583, 0.15732380747795105, 0.0029818755574524403, -0.21647413074970245, 0.16581003367900848, 0.04432874917984009, 0.23701739311218262, 0.3515376150608063, 0.19220657646656036, -0.040778614580631256, -0.43309250473976135, -0.04374619200825691, 0.13261647522449493, 0.21115605533123016, -0.2966901659965515, -0.003965076059103012, -0.2971692681312561, 0.037788912653923035, -0.11315399408340454, 0.21289511024951935, 0.022423217073082924, -0.3525303602218628, -0.0553673580288887, 0.07856321334838867, 0.007029231637716293, 0.24684180319309235, -0.4388485550880432, -0.009702011942863464, 0.0743907168507576, -0.1186911091208458, -0.26643404364585876, -0.02916465327143669, -0.3239477276802063, 0.12790246307849884, 0.1281142681837082, 0.1694859266281128, 0.28651538491249084, -0.010623820126056671, -0.1882646381855011, -0.10122904181480408, -0.1583450436592102, 0.19977158308029175, 0.10861852020025253, 0.010250025428831577, 0.034253720194101334, 0.2289695292711258, 0.14076043665409088, -0.19619698822498322, 0.398245632648468, -0.2839893400669098, -0.16500571370124817, 0.1764984279870987, 0.1087934747338295, -0.13578040897846222, -0.14589205384254456, -0.43355777859687805, -0.42098110914230347, -0.47282978892326355, -0.25366121530532837, -0.010943237692117691, 0.03544978052377701, 0.3531796336174011, 0.19469663500785828, 0.0853266566991806, -0.055710263550281525, -0.056991033256053925, -0.26557686924934387, -0.18850941956043243, 0.30597615242004395, -0.18807955086231232, -0.40852341055870056, -0.005216214805841446, -0.11215046048164368, -0.09232836961746216, 0.21698427200317383, -0.4986536502838135, -0.07779917865991592, -0.4047694504261017, 0.3416639566421509, -0.12057255208492279, 0.2427552342414856, 0.2383081018924713, -0.05542532354593277, -0.11310715973377228, -0.21267497539520264, 0.1280859112739563, 0.14627888798713684, -0.09693899005651474, 0.14049972593784332, 0.05371423810720444, 0.2573609948158264, 0.09244862198829651, 0.6970297694206238, 0.21572981774806976, -0.13261882960796356, 0.5545891523361206, -0.17392535507678986, 0.16497229039669037, -0.07067864388227463, -0.23696602880954742, 0.3256145417690277, -0.13179290294647217, 0.021061066538095474, 0.2744563817977905, -0.16017037630081177, 0.026821669191122055, -0.10253484547138214, 0.09475888311862946, -0.2954777181148529, -0.10617382824420929, 0.014751004986464977, -0.04669773578643799, 0.25295892357826233, 0.13902254402637482, 0.12370065599679947, 0.060846198350191116, -0.19584360718727112, 0.06675770878791809, 0.06470171362161636, -0.16996413469314575, -0.036746613681316376, -0.3683865964412689, 0.13557107746601105, -0.47084224224090576, 0.1993793249130249, 0.20029719173908234, 0.19360405206680298, -0.09157353639602661, 0.062340833246707916, 0.10409428924322128, -0.19971710443496704, 0.6721086502075195, -0.20622187852859497, 0.4028857946395874, 0.039404064416885376, 0.3514350950717926, -0.04273328557610512, -0.24910235404968262, -0.2524747848510742, -0.20674583315849304, 0.06008157134056091, 0.13747961819171906, -0.35249873995780945, -0.21536676585674286, 0.5600379705429077, 0.08521725982427597, -0.08814258873462677, -0.04018772765994072, -0.13543476164340973, -0.2766627073287964, -0.25067535042762756, 0.05547577515244484, -0.04650871455669403, 0.5092901587486267, -0.22952784597873688, -0.19951967895030975, 0.029450273141264915, -0.1389806568622589, -0.045589447021484375, 0.11028185486793518, 0.36459848284721375, -0.006554998457431793, 0.10588502883911133, -0.05688853561878204, 0.031034814193844795, 0.47342658042907715, 0.6395003795623779, -0.14596135914325714, -0.29352691769599915, -0.049936793744564056, -0.10958513617515564, 0.2540223300457001, 0.22029274702072144, -0.16207630932331085, -0.11621680110692978, 0.14482605457305908, 0.2778766453266144, -0.20211583375930786, 0.1415720283985138, 0.257628858089447, -0.08034618198871613, -0.18906503915786743, -0.4292067587375641, 0.6346047520637512, -0.02245279960334301, 0.13755206763744354, -0.2516222894191742, 0.20213009417057037, -0.43684545159339905, 0.1271488070487976, -0.0820339098572731, 0.8030058741569519, 0.1346164345741272, 0.2213902473449707, 0.36997511982917786, 0.15973863005638123, 0.1569778323173523, -0.5928217768669128, 0.11121559143066406, -0.2420578896999359, -0.10602543503046036, -0.09730860590934753, -0.22226795554161072, 0.06821749359369278, 0.2795500159263611, -0.33304446935653687, 0.05829572305083275, -0.2014779895544052, 0.27808600664138794, 0.11015400290489197, 0.3422137498855591, -0.14201100170612335, -0.004875103011727333, -0.06489110738039017, 0.23659631609916687, -0.07479359209537506, 0.14851810038089752, -0.1867923140525818, -0.04768816754221916, -0.17245052754878998, -0.270622193813324, -0.3144449293613434, 0.41049081087112427, -0.47883933782577515, 0.22201013565063477, 0.013482658192515373, -0.32536423206329346, 0.03191690519452095, 0.13510793447494507, 0.0514756515622139, 0.20974278450012207, -0.11298611760139465, 0.3389541506767273, -0.14877566695213318, 0.04984406381845474, -0.09140404313802719, 0.09692510962486267, 0.1782173216342926, -0.11603545397520065, -0.19586826860904694, 0.03584786504507065, -0.12475033104419708, -0.3132910132408142, 0.13452103734016418, 0.09098286926746368, -0.03962050378322601, -0.4856768548488617, -0.07538902759552002, -0.05429947376251221, 0.009145233780145645, -0.4123051166534424, 0.167663112282753, -0.022827737033367157, -0.2506535053253174, 0.09150952845811844, 0.1583857238292694, -0.22185948491096497, -0.11135269701480865, 0.33266890048980713, 0.04962866008281708, 0.24378681182861328, 0.5614922046661377, 0.1145794540643692, -0.16873612999916077, -0.2856435179710388, 0.2320270538330078, 0.218397319316864, -0.3025098741054535, 0.23700624704360962, 0.03651242330670357, -0.008538290858268738, -0.07402632385492325, 0.4753800630569458, -0.014695998281240463, -0.03759480267763138, 0.037904415279626846, -0.48841649293899536, 0.026880623772740364, 0.04038117825984955, 0.03908313438296318, 0.11507004499435425, -0.04818318411707878, 0.3321884870529175, 0.020851073786616325, 0.06147602200508118, -0.37415429949760437, 0.08681332319974899, -0.24088111519813538, 0.016586560755968094, 0.11877945810556412, -0.2069111466407776, 0.16333802044391632, -0.20746488869190216, 0.1568457931280136, -0.0005889870226383209, -0.09866007417440414, -0.32184702157974243, -0.33883577585220337, 0.10951849818229675, 0.21093440055847168, -0.048385076224803925, 0.0147020248696208, -0.10146288573741913, -0.13916605710983276, -0.08437810838222504, 0.16127213835716248, -0.017415162175893784, -0.06660009920597076, 0.32227832078933716, 0.06574457883834839, 0.1595868617296219, -0.2360483855009079, -0.002960655838251114, -0.20383352041244507, 0.41149431467056274, -0.0431993342936039, 0.030833574011921883, 0.2795223891735077, 0.10214516520500183, -0.3583771884441376, 0.11243562400341034, 0.2028009295463562, -0.11863786727190018, 0.2685973048210144, -0.5279079675674438, -0.048463158309459686, 0.23851458728313446, 0.32236742973327637, 0.498151957988739, -0.22012042999267578, -0.050872087478637695, 0.08529871702194214, 0.30547666549682617, -0.4090593457221985, -0.09591951221227646, 0.08037936687469482, -0.18205517530441284, 0.16879506409168243, 0.04439357668161392, 0.20506495237350464, -0.06429729610681534, -0.18453796207904816, 0.12744426727294922, 0.32041704654693604, -0.1141420304775238, 0.18220305442810059, 0.33203041553497314, -0.021952945739030838, 0.17682260274887085, 0.21278607845306396, 0.012005938217043877, 0.08041407912969589, 0.5559014081954956, 0.11634042114019394, 0.5096238851547241, -0.0008179359138011932, 0.21820546686649323, -0.20087304711341858, -0.3552173972129822, 0.06424610316753387, 0.0016946196556091309, -0.30867019295692444, 0.09232379496097565, -0.2025303840637207, 0.06010310351848602, -0.31954658031463623, -0.09218988567590714, -0.3766682744026184, 0.02659646049141884, -0.05704832077026367, -0.023087799549102783, -0.13583305478096008, -0.22167852520942688, -0.3292272388935089, 0.16398018598556519, 0.1340884119272232, 0.0012102723121643066, 0.18411758542060852, 0.08229149132966995, -0.2606726884841919, -0.367195188999176, 0.13744154572486877, 0.15145960450172424, 0.05455572530627251, -0.4126283526420593, 0.21819737553596497, 0.0722658783197403, -0.1983221173286438, -0.018187880516052246, 0.310713529586792, 0.34944748878479004, 0.3097696900367737, -0.17879822850227356, -0.2279844433069229, -0.05201837047934532, -0.11984270066022873, -0.18853318691253662, 0.27930134534835815, 0.40610891580581665, 0.14334876835346222, 0.19159232079982758, 0.18774467706680298, -0.3174844980239868, 0.013770250603556633, 0.15767830610275269, 0.01688951440155506, -0.29055991768836975, 0.20629476010799408, -0.07068391144275665, -0.21025270223617554, -0.1565832942724228, -0.09215784817934036, -0.2617783546447754, 0.2186889499425888, 0.18550364673137665, 0.0749477669596672, 0.2572931945323944, -0.17717280983924866, 0.09062302857637405, -0.026036716997623444, 0.5619212985038757, 0.30393609404563904, -0.05153089016675949, -0.4313873052597046, -0.046980470418930054, -0.5314911007881165, 0.019759878516197205, -0.2961725890636444, -0.25308313965797424, -0.05559070408344269, 0.14391955733299255, -0.03608321398496628, 0.13191203773021698, 0.11837916821241379, -0.03416097164154053, 0.2695852220058441, 0.11208921670913696, -0.24737875163555145, 0.015421146526932716, 0.09341005235910416, 0.07430636137723923, -0.10550114512443542, -0.6078809499740601, 0.19187311828136444, -0.25154298543930054, 0.02818315476179123, -0.05268396437168121, -0.04525202512741089, 0.2628057599067688, -0.4704650938510895, 0.5863542556762695, -0.016429590061306953, 0.5952324271202087, -0.19701740145683289, 0.04998869448900223, -0.30786678194999695, -0.12366561591625214, -0.3359176516532898, -0.054053306579589844, 0.0022580474615097046, 0.42114293575286865, 0.04680144041776657, 0.002020847052335739, -0.2502622604370117, 0.18073971569538116, 0.12414982914924622, 0.0583854541182518, -0.06155730038881302, -0.0783674418926239, -0.08474504947662354, 0.05164249613881111, 0.44483304023742676, 0.10267257690429688, -0.23805752396583557, 0.04866763949394226, -0.31674396991729736, -0.5541096925735474, 0.16719962656497955, -0.20786643028259277, -0.4059980809688568, -0.19747497141361237, 0.18185967206954956, -0.29476651549339294, -0.02155882678925991, -0.4484851658344269, -0.0061880797147750854, 0.30881190299987793, -0.10587040334939957, -0.31793642044067383, 0.2793039083480835, 0.1935575306415558, -0.10651232302188873, 0.08658808469772339, 0.3190279006958008, 0.02615254372358322, -0.26211026310920715, -0.17234504222869873, -0.19802115857601166 ]
https://github.com/huggingface/datasets/issues/6400
Safely load datasets by disabling execution of dataset loading script
great idea IMO this could be a `trust_remote_code=True` flag like in transformers. We could also default to loading the Parquet conversion rather than executing code (for dataset repos that have both)
### Feature request Is there a way to disable execution of dataset loading script using `load_dataset`? This is a security vulnerability that could lead to arbitrary code execution. Any suggested workarounds are welcome as well. ### Motivation This is a security vulnerability that could lead to arbitrary code execution. ### Your contribution n/a
31
Safely load datasets by disabling execution of dataset loading script ### Feature request Is there a way to disable execution of dataset loading script using `load_dataset`? This is a security vulnerability that could lead to arbitrary code execution. Any suggested workarounds are welcome as well. ### Motivation This is a security vulnerability that could lead to arbitrary code execution. ### Your contribution n/a great idea IMO this could be a `trust_remote_code=True` flag like in transformers. We could also default to loading the Parquet conversion rather than executing code (for dataset repos that have both)
[ -0.49187183380126953, 0.24664971232414246, -0.06180714815855026, 0.07278330624103546, 0.1823982447385788, -0.06257614493370056, 0.4756045639514923, -0.0017523877322673798, 0.35007375478744507, 0.19620463252067566, -0.030168166384100914, 0.4800986051559448, -0.0962616503238678, 0.508241593837738, 0.17908766865730286, 0.23728209733963013, 0.1527884602546692, -0.07979241013526917, -0.10539671778678894, 0.047809407114982605, -0.23183707892894745, -0.18346452713012695, -0.06190936267375946, 0.05092427134513855, 0.18290665745735168, -0.06088654696941376, 0.29939207434654236, 0.1543237268924713, -0.125132754445076, -0.4016495943069458, 0.29249563813209534, 0.34588682651519775, 0.22166073322296143, 0.3622076213359833, -0.00011389751307433471, 0.10466080904006958, 0.27051541209220886, -0.040426112711429596, -0.3146436810493469, -0.11531396210193634, -0.21605521440505981, -0.2883230447769165, 0.4110683500766754, -0.2796294093132019, -0.06189565360546112, 0.04663314297795296, -0.14438115060329437, -0.7425691485404968, 0.5168525576591492, 0.03990917652845383, 0.12219925224781036, 0.367332398891449, -0.3476302921772003, 0.38110387325286865, 0.054255202412605286, 0.22162887454032898, -0.15238940715789795, 0.12940087914466858, 0.4541603624820709, -0.0722857192158699, -0.24847695231437683, 0.009177128784358501, -0.2247057855129242, -0.47651243209838867, 0.2778942584991455, -0.1511782705783844, 0.10880710929632187, -0.5731934309005737, 0.07432781159877777, 0.05590713024139404, 0.647513210773468, -0.3346981406211853, -0.24169012904167175, -0.1260024458169937, -0.0468095988035202, -0.14272387325763702, 0.2212405800819397, 0.37510886788368225, -0.10258933901786804, 0.23221608996391296, -0.5511054992675781, -0.2946808934211731, -0.14262241125106812, -0.17750702798366547, 0.04286208003759384, 0.012095719575881958, 0.026188924908638, 0.1777113676071167, -0.06323003768920898, -0.18098659813404083, 0.2260998636484146, -0.06716970354318619, -0.11947882175445557, 0.10215191543102264, -0.2049606591463089, -0.22782446444034576, -0.24712404608726501, 0.14004600048065186, 0.4417484402656555, 0.5563256740570068, -0.060252539813518524, 0.18066120147705078, 0.05797329917550087, -0.011744216084480286, 0.46675238013267517, -0.12546536326408386, 0.039256058633327484, 0.16695056855678558, 0.2400808185338974, 0.3249741494655609, 0.14676059782505035, 0.26892387866973877, 0.044125910848379135, -0.11081554740667343, 0.2162231057882309, 0.16289541125297546, 0.3480573892593384, -0.3728824257850647, -0.16615331172943115, 0.10313758254051208, 0.13084065914154053, -0.07120038568973541, -0.1556372195482254, 0.3840373456478119, 0.4913680851459503, -0.03202603757381439, 0.10695430636405945, 0.17100302875041962, -0.18334202468395233, -0.613328218460083, -0.06783726811408997, -0.06954817473888397, -0.1253562718629837, 0.042424172163009644, 0.1728503704071045, 0.09881006181240082, -0.22229509055614471, 0.26926562190055847, -0.017580844461917877, -0.12985076010227203, 0.07990051060914993, -0.06213218718767166, -0.056865788996219635, 0.24840416014194489, -0.12924784421920776, -0.3817720413208008, 0.03581572324037552, -0.01417674869298935, -0.15545237064361572, 0.5639353394508362, -0.1710595190525055, -0.0978090688586235, 0.11248266696929932, 0.09975747019052505, -0.3810238242149353, -0.019219860434532166, -0.8360631465911865, 0.24277332425117493, -0.03589817136526108, 0.02259748801589012, 0.23102250695228577, -0.01655622199177742, -0.20810389518737793, -0.2845335006713867, 0.14037440717220306, 0.9467054009437561, -0.29406580328941345, -0.012743674218654633, 0.29474011063575745, -0.5522664785385132, 0.13021576404571533, 0.0723312646150589, -0.46765586733818054, 0.09944286942481995, -0.17070268094539642, -0.2533717155456543, 0.3526337146759033, -0.09895798563957214, -0.15769347548484802, 0.5773279666900635, -0.36440587043762207, 0.32113856077194214, -0.008543714880943298, 0.029236674308776855, 0.26229673624038696, -0.3681333363056183, -0.14055520296096802, 0.45128196477890015, 0.1815365105867386, 0.27923083305358887, -0.05572081729769707, -0.5350635647773743, 0.37339335680007935, 0.0758407711982727, -0.05909065529704094, 0.24309077858924866, 0.3308703303337097, -0.09881051629781723, 0.23713013529777527, -0.14319822192192078, -0.09417138993740082, 0.12694376707077026, -0.057123634964227676, 0.06698369234800339, -0.06047360599040985, 0.011627674102783203, -0.8628792762756348, 0.22662562131881714, 0.04524213820695877, -0.0784594863653183, -0.2697533369064331, -0.18744666874408722, 0.17861801385879517, 0.287594735622406, -0.2145548015832901, 0.0685059204697609, 0.0310501828789711, -0.15760725736618042, -0.23931443691253662, -0.03499533608555794, -0.36972543597221375, 0.4308404326438904, -0.12576822936534882, 0.2814355194568634, -0.2012907862663269, 0.3437817096710205, 0.25200456380844116, 0.13125625252723694, 0.06681917607784271, -0.08641848713159561, 0.2032242715358734, -0.25089117884635925, -0.0910898894071579, 0.5307343006134033, 0.3390151560306549, 0.3999624252319336, 0.060224536806344986, 0.21950678527355194, 0.06608664989471436, -0.1733626425266266, 0.22045375406742096, -0.028805870562791824, 0.06337262690067291, 0.23382249474525452, -0.1492358148097992, 0.38165730237960815, -0.3954048156738281, 0.13635170459747314, -0.04834303259849548, -0.21461331844329834, 0.17510594427585602, -0.15103505551815033, -0.25096455216407776, -0.11408022791147232, 0.09229046106338501, 0.2590849995613098, 0.013085424900054932, 0.21085064113140106, -0.22815673053264618, -0.22924742102622986, -0.0875769555568695, -0.299090176820755, -0.017158515751361847, -0.015983209013938904, 0.28592419624328613, -0.03453093767166138, -0.04164528101682663, 0.2875976264476776, 0.2653578519821167, 0.21464887261390686, -0.07352468371391296, 0.15131600201129913, 0.059167515486478806, -0.04840341955423355, 0.20601530373096466, 0.14549532532691956, 0.21780209243297577, -0.002213556319475174, 0.1504567712545395, 0.02410418540239334, -0.2542167007923126, -0.055672191083431244, 0.19123946130275726, -0.17636974155902863, -0.4964211881160736, 0.3399401903152466, -0.2844443917274475, -0.03384828194975853, -0.14927467703819275, 0.42902785539627075, -0.2323092222213745, 0.04420798271894455, -0.0939117968082428, -0.02237556502223015, -0.1932690143585205, 0.05288723111152649, -0.49334654211997986, 0.4095815420150757, -0.21494539082050323, -0.4290805757045746, -0.10769966244697571, -0.0251335296779871, -0.04663743078708649, -0.03974737599492073, 0.30407217144966125, -0.029000677168369293, 0.4690626263618469, 0.05255056172609329, -0.17050820589065552, -0.40356290340423584, -0.11689069122076035, 0.14882205426692963, 0.0013169534504413605, 0.029654843732714653, -0.11857976019382477, 0.06326287239789963, 0.1133413165807724, -0.06347037106752396, -0.21117118000984192, -0.021876823157072067, 0.019990617409348488, -0.044142283499240875, 0.20116734504699707, 0.039734285324811935, -0.27345502376556396, -0.20406672358512878, -0.23333026468753815, -0.17828834056854248, 0.12240287661552429, 0.03511788323521614, 0.013158034533262253, -0.18860964477062225, -0.15733884274959564, -0.19887101650238037, 0.042005106806755066, 0.051819585263729095, -0.15534882247447968, -0.41008660197257996, 0.19585959613323212, -0.11516140401363373, -0.23246140778064728, 0.15627899765968323, 0.19761869311332703, -0.11937688291072845, 0.5176486968994141, -0.5221997499465942, 0.11222708970308304, 0.021936986595392227, -0.09193962067365646, -0.28786030411720276, -0.15550854802131653, 0.1559375375509262, 0.05998506769537926, 0.10705067217350006, 0.03705114871263504, -0.12498447299003601, 0.13099804520606995, -0.36113274097442627, -0.016708754003047943, 0.3289969563484192, 0.6692330837249756, -0.10241523385047913, 0.3826376795768738, -0.23945094645023346, -0.14944575726985931, 0.23112472891807556, -0.12011546641588211, 0.3783199191093445, 0.03710934519767761, 0.006317952647805214, -0.14149799942970276, -0.022699564695358276, -0.2905880808830261, 0.03069847822189331, -0.3874523639678955, -0.15324284136295319, -0.25989168882369995, -0.29914191365242004, 0.09534312039613724, -0.3370154798030853, 0.05531042814254761, -0.28806278109550476, 0.22880417108535767, 0.09903192520141602, 0.2878502905368805, 0.01601286605000496, -0.041194695979356766, 0.17106693983078003, 0.22118845582008362, 0.48230358958244324, 0.03699503466486931, -0.16526298224925995, 0.2880563735961914, -0.2424009144306183, 0.2454458773136139, -0.24067099392414093, 0.2416282445192337, -0.03822154179215431, -0.09379811584949493, 0.19368109107017517, -0.08317193388938904, 0.611894965171814, -0.11508385092020035, 0.49438929557800293, -0.0169613566249609, -0.28229060769081116, -0.13315905630588531, -0.21463406085968018, -0.13713055849075317, 0.037603870034217834, -0.12796150147914886, 0.4034379720687866, -0.2966151833534241, -0.1266099214553833, 0.04270760342478752, 0.1662975698709488, -0.1878320425748825, -0.22962124645709991, -0.29966670274734497, 0.17369672656059265, -0.5374734401702881, 0.16960959136486053, 0.09639322012662888, -0.18487390875816345, -0.5567571520805359, 0.0015271753072738647, -0.2068498283624649, 0.24051719903945923, 0.030842624604701996, 0.07798905670642853, 0.16363781690597534, -0.010474666953086853, 0.015696760267019272, 0.08368884027004242, 0.21147368848323822, 0.2723763585090637, 0.6023914217948914, 0.09826718270778656, -0.664989709854126, -0.04732276499271393, 0.03258277475833893, 0.305927574634552, 0.3916112780570984, 0.012232634238898754, -0.2577013671398163, 0.048611756414175034, -0.007386460900306702, -0.2959226667881012, -0.1318509429693222, -0.0028109420090913773, -0.29429566860198975, -0.4157404601573944, -0.3382968008518219, 0.4189557135105133, -0.04953921586275101, -0.1768178790807724, -0.15966536104679108, 0.29035189747810364, -0.42576906085014343, 0.4393083453178406, 0.4571044445037842, 0.8355443477630615, -0.3198533058166504, -0.012625467032194138, 0.0915553942322731, -0.12594656646251678, 0.47043466567993164, -0.6522903442382812, -0.1712816208600998, -0.27533501386642456, -0.1815492957830429, -0.1746726632118225, -0.3202904462814331, 0.11160474270582199, 0.23457801342010498, 0.006507325917482376, 0.32095909118652344, -0.2709619402885437, 0.12384332716464996, 0.023688770830631256, 0.3295435905456543, 0.23667749762535095, -0.30402782559394836, -0.10071766376495361, 0.06701232492923737, -0.20570926368236542, -0.06701792776584625, -0.11056581139564514, -0.12012997269630432, 0.3179931342601776, -0.1072329580783844, -0.12151314318180084, 0.44756582379341125, -0.16043485701084137, 0.18272647261619568, -0.22938022017478943, -0.07287102937698364, 0.5885844826698303, 0.22260260581970215, 0.23164786398410797, 0.26498234272003174, -0.10579615831375122, 0.07649347186088562, 0.152761310338974, 0.11534659564495087, -0.256753534078598, 0.12511983513832092, -0.012166539207100868, 0.04754452407360077, -0.13447625935077667, -0.03304055333137512, 0.006136554293334484, -0.23434367775917053, 0.1737532615661621, 0.004225239157676697, 0.35875946283340454, -0.45836949348449707, 0.0144168920814991, -0.03457453101873398, 0.4522949457168579, 0.13314002752304077, 0.04003297910094261, 0.06042323261499405, 0.04986501485109329, -0.11312559992074966, 0.03729315102100372, -0.44967716932296753, -0.07212692499160767, 0.29843100905418396, 0.10976734757423401, -0.26826804876327515, 0.39941486716270447, 0.13134676218032837, -0.16853190958499908, -0.32943519949913025, 0.013916015625, 0.39998501539230347, -0.35578757524490356, 0.03871222957968712, 0.01682290807366371, 0.11634962260723114, -0.08532904088497162, 0.01161063089966774, -0.20683644711971283, -0.13655707240104675, 0.03637327626347542, -0.23065946996212006, -0.17461298406124115, 0.2252349853515625, -0.22019140422344208, 0.05860920250415802, 0.34600019454956055, -0.08362959325313568, -0.14872021973133087, -0.179396852850914, -0.2550899386405945, 0.009264649823307991, -0.063955157995224, -0.06770853698253632, 0.44930967688560486, 0.38126638531684875, -0.1649637371301651, 0.06786108016967773, 0.009896958246827126, 0.009587472304701805, -0.04163198918104172, -0.13589631021022797, 0.02799111232161522, 0.14591720700263977, -0.19472235441207886, 0.011719107627868652, -0.31316322088241577, -0.4027010202407837, -0.014532513916492462, -0.08353029191493988, 0.360784113407135, 0.15849101543426514, 0.0686899945139885, -0.1351332813501358, 0.2664903998374939, 0.19625955820083618, -0.33061856031417847, 0.01381651684641838, -0.020838402211666107, 0.11395859718322754, -0.10821130871772766, 0.23126818239688873, -0.0705922469496727, -0.11301382631063461, -0.223832368850708, 0.28188908100128174, 0.5976329445838928, 0.5097262263298035, 0.067352294921875, -0.09716115891933441, -0.05690205842256546, 0.08301563560962677, -0.1308385133743286, 0.43618321418762207, -0.5245369672775269, -0.3879989981651306, 0.09619191288948059, 0.09204211086034775, -0.05082445219159126, -0.1496979147195816, 0.25425395369529724, -0.07061515748500824, -0.19418346881866455, 0.38818272948265076, 0.20978286862373352, 0.1434369832277298, -0.09105223417282104, 0.12010782212018967, 0.5951063632965088, -0.05375947803258896, 0.27422770857810974, 0.3691398799419403, -0.04163859784603119, -0.04773580655455589, -0.030317848548293114, 0.3832108676433563, 0.1882861852645874, 0.2031913697719574, -0.042791612446308136, 0.32194921374320984, 0.3459327816963196, 0.2862629294395447, 0.08137478679418564, -0.4299355447292328, 0.0650365874171257, 0.26062700152397156, -0.08206482231616974, -0.03535987436771393, 0.36247843503952026, -0.2431076169013977, 0.44434815645217896, -0.11080967634916306, -0.38685330748558044, 0.30504217743873596, -0.10596198588609695, 0.021917149424552917, -0.00609174557030201, -0.07051065564155579, -0.06744877994060516, 0.13530120253562927, -0.15751303732395172, -0.167211651802063, -0.0741233080625534, 0.1721535623073578, 0.18723484873771667, 0.06882496178150177, 0.17616137862205505, 0.12117074429988861, 0.011587098240852356, -0.13323846459388733, -0.0058799441903829575, 0.1408461630344391, 0.01529313251376152, 0.43607285618782043, -0.09216751158237457, 0.1901375949382782, 0.13803082704544067, 0.14665693044662476, 0.03622511029243469, 0.08317850530147552, 0.0709281712770462, -0.08607379347085953, 0.2445000261068344, -0.25229987502098083, 0.2934136688709259, 0.35816705226898193, 0.049344636499881744, 0.06582687795162201, -0.31247591972351074, 0.4236842095851898, 0.1540050059556961, -0.17252713441848755, 0.2215941846370697, 0.30431944131851196, 0.060189180076122284, -0.18763145804405212, 0.012531593441963196, -0.10001687705516815, -0.3014737069606781, 0.20974914729595184, 0.22295014560222626, 0.011407306417822838, 0.11501912772655487, 0.050165921449661255, 0.01212313398718834, 0.4016040861606598, 0.1527593731880188, -0.11236005276441574, -0.2787320613861084, -0.020149528980255127, -0.6762390732765198, 0.11853614449501038, 0.15814247727394104, -0.35275864601135254, 0.22835110127925873, -0.024245265871286392, 0.2700650691986084, 0.39729171991348267, -0.17544130980968475, 0.008333072066307068, 0.05863639712333679, 0.1488109827041626, -0.04864133149385452, -0.0930483341217041, -0.044260427355766296, 0.23365581035614014, -0.2817736268043518, -0.14900922775268555, 0.278386652469635, -0.05992444232106209, -0.07684198021888733, 0.20693019032478333, -0.05310986936092377, -0.10328298807144165, -0.1802370399236679, 0.45070892572402954, 0.040849409997463226, 0.3889307975769043, -0.008009880781173706, 0.05385444313287735, -0.2174971103668213, -0.04672309756278992, -0.19318856298923492, 0.34168073534965515, -0.04048139229416847, -0.24670536816120148, -0.19368904829025269, 0.22646866738796234, -0.19000723958015442, -0.29172250628471375, -0.19443483650684357, 0.2510813772678375, -0.31029242277145386, -0.10997426509857178, 0.19053474068641663, 0.13244538009166718, -0.08813976496458054, -0.044909313321113586, 0.11631043255329132, 0.3562942445278168, -0.0006619617342948914, 0.05848181992769241, 0.5049853324890137, -0.37874776124954224, -0.26252037286758423, -0.24975651502609253, 0.3674684762954712, 0.0022644251585006714, -0.24366971850395203, -0.30698466300964355, 0.389996737241745, 0.05935254320502281, -0.3724747896194458, -0.2099585235118866, 0.38717103004455566, -0.29990875720977783, 0.14162969589233398, -0.17936111986637115, -0.00011255592107772827, -0.03908737748861313, 0.10701759159564972, -0.260586678981781, -0.14282387495040894 ]
https://github.com/huggingface/datasets/issues/6400
Safely load datasets by disabling execution of dataset loading script
We added the `trust_remote_code` argument to `load_dataset()` in `datasets` 2.16: - in the future users will have to pass trust_remote_code=True to use datasets with a script - for now we just show a warning when a dataset script is used - we fallback on the Hugging Face Parquet exports when possible (to keep compatibility with old datasets with scripts) So feel free to use `trust_remote_code=False` in the meantime to disable loading from dataset loading scripts :)
### Feature request Is there a way to disable execution of dataset loading script using `load_dataset`? This is a security vulnerability that could lead to arbitrary code execution. Any suggested workarounds are welcome as well. ### Motivation This is a security vulnerability that could lead to arbitrary code execution. ### Your contribution n/a
76
Safely load datasets by disabling execution of dataset loading script ### Feature request Is there a way to disable execution of dataset loading script using `load_dataset`? This is a security vulnerability that could lead to arbitrary code execution. Any suggested workarounds are welcome as well. ### Motivation This is a security vulnerability that could lead to arbitrary code execution. ### Your contribution n/a We added the `trust_remote_code` argument to `load_dataset()` in `datasets` 2.16: - in the future users will have to pass trust_remote_code=True to use datasets with a script - for now we just show a warning when a dataset script is used - we fallback on the Hugging Face Parquet exports when possible (to keep compatibility with old datasets with scripts) So feel free to use `trust_remote_code=False` in the meantime to disable loading from dataset loading scripts :)
[ -0.5202222466468811, 0.20792517066001892, -0.08936731517314911, 0.1527644693851471, 0.19417232275009155, -0.030967287719249725, 0.40098845958709717, 0.023934267461299896, 0.5325301289558411, 0.20426133275032043, -0.026901964098215103, 0.5292143821716309, -0.20548409223556519, 0.35524991154670715, 0.2786894142627716, 0.31736648082733154, 0.10019422322511673, -0.18791437149047852, -0.20041966438293457, 0.10976523160934448, -0.2691690921783447, -0.16540713608264923, -0.135076105594635, 0.12534348666667938, 0.19672228395938873, -0.07895664125680923, 0.2981858253479004, 0.22095328569412231, -0.05720479041337967, -0.5459352731704712, 0.27650439739227295, 0.3193226754665375, 0.20067089796066284, 0.2159019112586975, -0.00010746713087428361, -0.005503557622432709, 0.2930706739425659, -0.007505601271986961, -0.22840754687786102, -0.1205296665430069, -0.2629680335521698, -0.3169955313205719, 0.3407692015171051, -0.25245293974876404, -0.03697464242577553, -0.04582035541534424, -0.08324901759624481, -0.9344260692596436, 0.35621634125709534, 0.06134935840964317, 0.18499061465263367, 0.34587588906288147, -0.19133298099040985, 0.29514849185943604, 0.07389257103204727, 0.13323380053043365, -0.07973213493824005, 0.057033274322748184, 0.20225439965724945, -0.17478905618190765, -0.2576902508735657, 0.06779567897319794, -0.24059253931045532, -0.40961068868637085, 0.34133008122444153, -0.11839640885591507, -0.09536943584680557, -0.5952450037002563, 0.07350112497806549, 0.14722338318824768, 0.6803094744682312, -0.38177794218063354, -0.28426507115364075, -0.15513291954994202, -0.022350013256072998, -0.0480375699698925, 0.2388644516468048, 0.2771439850330353, 0.06705962121486664, 0.17919772863388062, -0.3396397829055786, -0.2809821665287018, -0.13432839512825012, -0.1987007111310959, 0.1515103131532669, -0.16380229592323303, -0.012503805570304394, 0.2294718623161316, 0.028749383985996246, -0.2698046565055847, 0.1892101764678955, -0.09351601451635361, -0.17412234842777252, 0.21573561429977417, -0.27167564630508423, -0.09622697532176971, -0.06990314275026321, 0.22274181246757507, 0.5029821991920471, 0.42990177869796753, -0.05216848850250244, 0.1265994906425476, -0.01197834126651287, 0.0018570050597190857, 0.4215658903121948, -0.1210898905992508, 0.17152157425880432, 0.04890848696231842, 0.24507836997509003, 0.34114646911621094, 0.23265278339385986, 0.19239768385887146, 0.07139357924461365, -0.2610167860984802, 0.17237751185894012, 0.135663241147995, 0.3526463508605957, -0.3051398694515228, -0.2768695056438446, 0.12478354573249817, 0.2696928381919861, -0.11239586770534515, -0.10466815531253815, 0.4054127037525177, 0.33777084946632385, -0.16659387946128845, 0.09626364707946777, 0.05006850138306618, -0.18255344033241272, -0.5757491588592529, -0.12164939194917679, 0.024147680029273033, -0.07800308614969254, 0.10726803541183472, 0.14293056726455688, -0.06399616599082947, -0.16353219747543335, 0.3106355369091034, -0.16036789119243622, -0.04872319474816322, -0.0000672321766614914, -0.12906323373317719, 0.05824029818177223, 0.19192475080490112, -0.08167192339897156, -0.3371482491493225, 0.009836647659540176, 0.014769628643989563, -0.13130953907966614, 0.4931454062461853, -0.2028903067111969, -0.11526038497686386, 0.05214030295610428, 0.17712804675102234, -0.4027021527290344, 0.01505676656961441, -0.7132954001426697, 0.17935627698898315, -0.07918176800012589, 0.03216796740889549, 0.2490241527557373, -0.026027336716651917, -0.27491405606269836, -0.31743624806404114, 0.27983567118644714, 0.9034203290939331, -0.3668206036090851, 0.12080681324005127, 0.12185648828744888, -0.5791352987289429, -0.02546411007642746, 0.07082745432853699, -0.4002273976802826, 0.17133665084838867, -0.1938621550798416, -0.2322278767824173, 0.1766476184129715, -0.1269606351852417, -0.04570964723825455, 0.415635883808136, -0.30096742510795593, 0.36620548367500305, -0.11650808900594711, 0.008576358668506145, 0.23559816181659698, -0.2935497760772705, -0.1166100949048996, 0.3756878972053528, 0.20182198286056519, 0.1854853481054306, -0.013987414538860321, -0.46753135323524475, 0.4734290838241577, 0.07777361571788788, -0.1378335952758789, 0.10648787766695023, 0.4119144678115845, -0.19178737699985504, 0.26590585708618164, -0.16254492104053497, -0.07740949094295502, 0.10681138187646866, 0.08928978443145752, 0.10049355775117874, -0.09265030175447464, 0.0007553659379482269, -0.9057368636131287, 0.2438478171825409, 0.1444985568523407, -0.16598480939865112, -0.1921759396791458, -0.2204866111278534, 0.33836182951927185, 0.28921565413475037, -0.18398867547512054, 0.06412176042795181, 0.06414481997489929, -0.1657983362674713, -0.20090331137180328, 0.0469239167869091, -0.428323894739151, 0.4593929052352905, -0.23477527499198914, 0.20484691858291626, -0.3353222906589508, 0.10280741751194, 0.23698754608631134, 0.12596401572227478, 0.13246171176433563, -0.060518719255924225, 0.14849282801151276, -0.21428875625133514, -0.007152736186981201, 0.5940862894058228, 0.3558821976184845, 0.3794202208518982, -0.0001247003674507141, 0.10224486142396927, -0.002830125391483307, -0.27335110306739807, 0.14524488151073456, -0.046285439282655716, 0.08273249864578247, 0.1800563633441925, -0.07368507236242294, 0.46023017168045044, -0.38438206911087036, 0.14896278083324432, -0.06508418917655945, -0.269022673368454, 0.06435057520866394, -0.12320904433727264, -0.238407164812088, -0.0980447381734848, 0.07119162380695343, 0.10380133986473083, 0.1280641108751297, 0.11509392410516739, -0.2805546522140503, -0.13191309571266174, -0.03246558830142021, -0.11900162696838379, 0.039532702416181564, 0.021000390872359276, 0.402377724647522, -0.06098144128918648, 0.04232282191514969, 0.1862938404083252, 0.2861769199371338, 0.2309570014476776, -0.07132036983966827, 0.14493417739868164, 0.04882071912288666, -0.03666437044739723, 0.3528946042060852, 0.05522771179676056, 0.107688307762146, 0.040294770151376724, 0.033591486513614655, 0.03775453194975853, -0.25317859649658203, -0.01720885932445526, 0.04132789373397827, -0.1444975584745407, -0.6177030801773071, 0.22886039316654205, -0.33354100584983826, -0.026634298264980316, -0.03388061746954918, 0.42194148898124695, -0.23714271187782288, 0.10830912739038467, -0.18756990134716034, -0.02379981055855751, -0.2613683044910431, 0.06061086058616638, -0.5463241338729858, 0.4001765251159668, -0.2495419681072235, -0.19835253059864044, -0.12237513065338135, -0.022099332883954048, -0.003660488873720169, 0.01990126073360443, 0.3032916784286499, -0.07697564363479614, 0.4542951285839081, 0.11959422379732132, -0.10977961122989655, -0.4740057587623596, -0.11037484556436539, 0.002209685742855072, -0.040712423622608185, 0.11674592643976212, 0.04417482763528824, 0.02633897215127945, 0.13088548183441162, -0.1556597352027893, -0.21934166550636292, -0.11975441128015518, 0.058992840349674225, -0.18514366447925568, 0.04334457591176033, 0.025344684720039368, -0.3216181993484497, -0.32354235649108887, -0.2161398082971573, -0.20408980548381805, 0.1581953763961792, -0.11546587944030762, 0.03428986668586731, -0.04248938336968422, -0.14403997361660004, -0.06143534183502197, -0.06212322786450386, 0.019032049924135208, -0.17527323961257935, -0.5415335297584534, 0.19423425197601318, -0.21320897340774536, -0.3309890031814575, 0.1950792372226715, 0.20545120537281036, -0.06234365329146385, 0.3318273425102234, -0.4776376485824585, 0.23708568513393402, 0.014857571572065353, -0.016778957098722458, -0.3290410041809082, -0.08310075104236603, -0.015758678317070007, 0.09166605025529861, 0.06990265846252441, -0.016929395496845245, -0.16669400036334991, 0.14386099576950073, -0.4410412311553955, 0.04497522860765457, 0.26964473724365234, 0.6169939637184143, -0.04704156517982483, 0.17543241381645203, -0.11644046008586884, -0.1309753656387329, 0.30239951610565186, -0.11529228836297989, 0.5058563351631165, 0.0009874403476715088, -0.09773816913366318, -0.06118675321340561, 0.09866741299629211, -0.1977810263633728, 0.05861453339457512, -0.41401344537734985, -0.037994347512722015, -0.18702732026576996, -0.19178472459316254, 0.10575137287378311, -0.2310195416212082, 0.05631505697965622, -0.1912248134613037, 0.21396872401237488, 0.09486031532287598, 0.17369991540908813, -0.0036451537162065506, -0.16341403126716614, 0.0934937447309494, 0.16812920570373535, 0.6583608984947205, 0.01830696314573288, -0.26550382375717163, 0.24671116471290588, -0.2463720142841339, 0.25971662998199463, -0.22638943791389465, 0.24904540181159973, -0.0857786238193512, -0.06580384075641632, 0.0955076813697815, -0.021429572254419327, 0.5324967503547668, -0.16372233629226685, 0.4470676779747009, -0.004745377227663994, -0.16214123368263245, -0.31243667006492615, -0.15386345982551575, -0.025408035144209862, 0.07232019305229187, -0.1728520542383194, 0.27556324005126953, -0.20539088547229767, -0.16133660078048706, 0.06502068042755127, 0.1679990589618683, -0.14762842655181885, -0.31124117970466614, -0.24526329338550568, 0.06053388863801956, -0.37891095876693726, 0.16533023118972778, 0.0093145202845335, -0.03344965726137161, -0.5616256594657898, -0.03967174515128136, -0.12221367657184601, 0.23538625240325928, 0.039440806955099106, 0.06353923678398132, 0.2468850016593933, 0.035255108028650284, 0.1761389672756195, 0.2146104872226715, 0.11571487784385681, 0.3629927337169647, 0.5311005115509033, -0.030707132071256638, -0.5163485407829285, -0.1495017409324646, 0.03302663564682007, 0.3226596713066101, 0.2746361494064331, -0.07940283417701721, -0.10299498587846756, 0.0019514299929141998, -0.03825870156288147, -0.29851779341697693, -0.20694442093372345, 0.037188820540905, -0.26355794072151184, -0.34535136818885803, -0.35414424538612366, 0.3399411141872406, -0.06734997034072876, -0.18550288677215576, 0.09453988075256348, 0.2209150493144989, -0.509409487247467, 0.26755380630493164, 0.4743746221065521, 0.7028602957725525, -0.16543495655059814, -0.12304240465164185, 0.09419064968824387, 0.01942925900220871, 0.4049801528453827, -0.40071427822113037, -0.27304959297180176, -0.37992218136787415, -0.21498306095600128, -0.07543157041072845, -0.25643885135650635, 0.23856273293495178, 0.22748836874961853, 0.05324419215321541, 0.33063268661499023, -0.2804862856864929, 0.13430751860141754, -0.08263199776411057, 0.4940924048423767, 0.19121496379375458, -0.27815237641334534, -0.02343757078051567, 0.11565344035625458, -0.18581244349479675, -0.15196900069713593, -0.13438653945922852, -0.08489193767309189, 0.49295589327812195, -0.1480903923511505, -0.12326753884553909, 0.417923241853714, -0.2636890113353729, 0.18513885140419006, -0.2214503288269043, -0.006498992443084717, 0.5920449495315552, 0.37707653641700745, 0.20200425386428833, 0.20612795650959015, -0.046198949217796326, 0.04584378004074097, 0.06437364220619202, 0.1611507385969162, -0.29458266496658325, 0.1715492457151413, -0.02521047554910183, 0.038965314626693726, -0.22519168257713318, -0.047720953822135925, -0.005956495180726051, -0.2174828052520752, 0.17727166414260864, 0.0877520889043808, 0.22363649308681488, -0.3046986162662506, -0.10936658084392548, -0.038443975150585175, 0.465925931930542, 0.1367998570203781, 0.09079019725322723, 0.16315078735351562, 0.11222215741872787, 0.047483623027801514, 0.0382370799779892, -0.4427852928638458, -0.06741462647914886, 0.32774975895881653, -0.10793428868055344, -0.06572341918945312, 0.2783181667327881, 0.19224761426448822, -0.2235007882118225, -0.3560599982738495, 0.11818774789571762, 0.42000603675842285, -0.172768697142601, -0.056992385536432266, 0.11676882207393646, 0.3113105297088623, -0.11544870585203171, -0.044677648693323135, -0.20692078769207, -0.1588672399520874, 0.0900527685880661, -0.22530266642570496, -0.13024625182151794, 0.28125837445259094, -0.17984461784362793, 0.02983815036714077, 0.31410619616508484, -0.2330748289823532, -0.09646372497081757, -0.10604631900787354, -0.3068971037864685, 0.09132207185029984, 0.1352570503950119, -0.09156715869903564, 0.44115301966667175, 0.4191034436225891, -0.02468930371105671, -0.038602493703365326, 0.050525322556495667, -0.04642658680677414, -0.0639519989490509, -0.1874171495437622, -0.05800223350524902, 0.10331869125366211, -0.20904770493507385, 0.0024586969520896673, -0.270908921957016, -0.5653676390647888, -0.03083169460296631, -0.08058465272188187, 0.3957143723964691, 0.22053751349449158, 0.052162740379571915, 0.005693300627171993, 0.08833684027194977, 0.18781892955303192, -0.256424218416214, 0.10482819378376007, -0.05024866759777069, 0.07062719762325287, -0.043895866721868515, 0.20675769448280334, -0.1631096750497818, -0.20800501108169556, -0.1212984025478363, 0.24161359667778015, 0.43662887811660767, 0.44428515434265137, -0.053811751306056976, -0.009077288210391998, -0.1485191285610199, 0.055679917335510254, -0.04293178766965866, 0.41613128781318665, -0.49864792823791504, -0.32304465770721436, 0.03825756162405014, 0.12362074106931686, -0.06748126447200775, -0.16776388883590698, 0.06660174578428268, 0.0826355516910553, -0.1827922910451889, 0.23396380245685577, 0.19441241025924683, 0.019500643014907837, -0.0870731770992279, 0.09630901366472244, 0.6289377808570862, -0.12676730751991272, 0.2636280655860901, 0.2408934235572815, -0.18868331611156464, -0.047023262828588486, 0.005155798047780991, 0.3143606185913086, 0.18694835901260376, 0.3031134605407715, -0.09326184540987015, 0.37947985529899597, 0.39926770329475403, 0.312027245759964, 0.08776416629552841, -0.592293918132782, 0.13505607843399048, 0.290477454662323, -0.15807366371154785, -0.12477784603834152, 0.30153608322143555, -0.0776410773396492, 0.35756435990333557, -0.10949219018220901, -0.20459720492362976, 0.22935062646865845, -0.09338470548391342, -0.010856325738132, -0.01666542887687683, -0.09915488958358765, 0.09815323352813721, 0.12757563591003418, -0.12699589133262634, -0.21093274652957916, 0.08096013963222504, 0.12908560037612915, 0.13353122770786285, -0.007351979613304138, 0.15113380551338196, 0.1771184802055359, 0.01957249641418457, -0.08522500097751617, 0.035109568387269974, 0.1818717122077942, 0.021898683160543442, 0.4124433994293213, 0.05707833915948868, 0.20615066587924957, 0.1117430329322815, 0.20815131068229675, 0.11939673125743866, -0.019925348460674286, 0.08634678274393082, -0.07602182775735855, 0.26786214113235474, -0.31943854689598083, 0.11864566802978516, 0.34950950741767883, 0.11602625250816345, 0.05251016467809677, -0.24857671558856964, 0.4594295918941498, 0.22538280487060547, -0.11773723363876343, 0.15847815573215485, 0.2857113480567932, 0.11547843366861343, -0.12543843686580658, 0.06806179881095886, 0.0381375327706337, -0.24451591074466705, 0.4494777023792267, 0.2574889659881592, 0.011844199150800705, -0.03198913112282753, 0.0913149043917656, 0.04848818480968475, 0.43186476826667786, 0.12921181321144104, -0.10093248635530472, -0.202826589345932, -0.0404679961502552, -0.7960138320922852, 0.1287807822227478, 0.10614106059074402, -0.12742412090301514, 0.20170840620994568, -0.006535030901432037, 0.09961257129907608, 0.2655634880065918, -0.03535431623458862, 0.018034106120467186, 0.06727287918329239, 0.030295131728053093, -0.10479797422885895, -0.030494030565023422, -0.10320672392845154, 0.24219095706939697, -0.26808422803878784, -0.13093894720077515, 0.3669808804988861, -0.1698213368654251, -0.06344336271286011, 0.05212053284049034, 0.1535588949918747, -0.0769726037979126, -0.12823845446109772, 0.6123617887496948, -0.007924962788820267, 0.41431131958961487, -0.08830392360687256, 0.09118165820837021, -0.3156229257583618, -0.031290002167224884, -0.13704827427864075, 0.4863169193267822, 0.07648523151874542, -0.20474915206432343, -0.1667090505361557, -0.08535543084144592, -0.16918198764324188, -0.051515594124794006, -0.222117617726326, 0.3041689395904541, -0.3718404173851013, -0.030546002089977264, 0.2585056722164154, 0.07883990556001663, -0.20234143733978271, -0.05407363921403885, 0.039140474051237106, 0.31925973296165466, -0.01569618284702301, -0.02094504050910473, 0.5182081460952759, -0.37554699182510376, -0.1339348405599594, -0.16633208096027374, 0.43460211157798767, 0.05875816196203232, -0.39960676431655884, -0.3879411816596985, 0.34522053599357605, 0.1764996349811554, -0.34876322746276855, -0.18805287778377533, 0.3390512466430664, -0.37398895621299744, 0.26133599877357483, -0.12894374132156372, 0.03776444122195244, -0.025694377720355988, 0.012540960684418678, -0.09722799062728882, -0.21473540365695953 ]
https://github.com/huggingface/datasets/issues/6396
Issue with pyarrow 14.0.1
https://github.com/huggingface/datasets-server/pull/2089#pullrequestreview-1724449532 > Yes, I understand now: they have disabled their `PyExtensionType` and we use it in `datasets` for arrays...
See https://github.com/huggingface/datasets-server/pull/2089 for reference ``` from datasets import (Array2D, Dataset, Features) feature_type = Array2D(shape=(2, 2), dtype="float32") content = [[0.0, 0.0], [0.0, 0.0]] features = Features({"col": feature_type}) dataset = Dataset.from_dict({"col": [content]}, features=features) ``` generates ``` /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:648: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. pa.PyExtensionType.__init__(self, self.storage_dtype) /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: RuntimeWarning: pickle-based deserialization of pyarrow.PyExtensionType subclasses is disabled by default; if you only ingest trusted data files, you may re-enable this using `pyarrow.PyExtensionType.set_auto_load(True)`. In the future, Python-defined extension subclasses should derive from pyarrow.ExtensionType (not pyarrow.PyExtensionType) and implement their own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 924, in from_dict return cls(pa_table, info=info, split=split) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 693, in __init__ inferred_features = Features.from_arrow_schema(arrow_table.schema) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in from_arrow_schema obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in <dictcomp> obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1381, in generate_from_arrow_type return Value(dtype=_arrow_to_datasets_dtype(pa_type)) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 111, in _arrow_to_datasets_dtype raise ValueError(f"Arrow type {arrow_type} does not have a datasets dtype equivalent.") ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent. ```
19
Issue with pyarrow 14.0.1 See https://github.com/huggingface/datasets-server/pull/2089 for reference ``` from datasets import (Array2D, Dataset, Features) feature_type = Array2D(shape=(2, 2), dtype="float32") content = [[0.0, 0.0], [0.0, 0.0]] features = Features({"col": feature_type}) dataset = Dataset.from_dict({"col": [content]}, features=features) ``` generates ``` /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:648: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. pa.PyExtensionType.__init__(self, self.storage_dtype) /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: RuntimeWarning: pickle-based deserialization of pyarrow.PyExtensionType subclasses is disabled by default; if you only ingest trusted data files, you may re-enable this using `pyarrow.PyExtensionType.set_auto_load(True)`. In the future, Python-defined extension subclasses should derive from pyarrow.ExtensionType (not pyarrow.PyExtensionType) and implement their own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 924, in from_dict return cls(pa_table, info=info, split=split) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 693, in __init__ inferred_features = Features.from_arrow_schema(arrow_table.schema) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in from_arrow_schema obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in <dictcomp> obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1381, in generate_from_arrow_type return Value(dtype=_arrow_to_datasets_dtype(pa_type)) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 111, in _arrow_to_datasets_dtype raise ValueError(f"Arrow type {arrow_type} does not have a datasets dtype equivalent.") ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent. ``` https://github.com/huggingface/datasets-server/pull/2089#pullrequestreview-1724449532 > Yes, I understand now: they have disabled their `PyExtensionType` and we use it in `datasets` for arrays...
[ -0.10018600523471832, 0.1327694058418274, -0.006541011855006218, 0.12114923447370529, 0.33292293548583984, -0.0022716745734214783, 0.5476637482643127, 0.4272781014442444, -0.4059031009674072, -0.016827180981636047, -0.043572403490543365, 0.5135800838470459, -0.03857019543647766, 0.18583163619041443, -0.014979657717049122, -0.10123254358768463, 0.14204026758670807, 0.249879390001297, -0.13324777781963348, 0.0025334544479846954, -0.2547636926174164, 0.17157022655010223, -0.19844087958335876, 0.2603147327899933, -0.2027648240327835, 0.22164103388786316, -0.031765248626470566, 0.019775357097387314, -0.3637032210826874, -0.6872814893722534, 0.3884541988372803, -0.046785805374383926, 0.24187445640563965, -0.006554454565048218, -0.00010224691504845396, -0.0007210597395896912, 0.30931174755096436, 0.12332437932491302, -0.193723663687706, -0.07293662428855896, 0.3329657018184662, -0.2589890956878662, 0.2628491222858429, -0.21228569746017456, -0.04073037952184677, -0.6440300345420837, -0.05031242221593857, 0.2446926236152649, 0.08172858506441116, 0.15321703255176544, 0.3183605372905731, 0.22418053448200226, 0.35633671283721924, -0.017901305109262466, 0.5114350318908691, 0.207744762301445, -0.2083577960729599, 0.25057294964790344, 0.14413955807685852, -0.09282798320055008, -0.23996317386627197, -0.05456732586026192, -0.041861046105623245, 0.051619432866573334, 0.17346221208572388, 0.17020009458065033, 0.14462238550186157, -0.1840609312057495, 0.11555854231119156, 0.10660319030284882, 0.27708545327186584, -0.4675664007663727, -0.282554566860199, -0.07063063234090805, 0.0213644839823246, -0.3469955623149872, 0.0581938698887825, 0.2746261656284332, -0.04459251090884209, 0.2843548059463501, 0.08433732390403748, 0.07435878366231918, -0.36709222197532654, 0.06486637145280838, -0.14269797503948212, 0.1571832001209259, -0.09399468451738358, 0.11185918748378754, -0.1262051910161972, -0.21635092794895172, 0.16817796230316162, -0.07513225823640823, -0.04647221788764, 0.021682698279619217, -0.1497625708580017, -0.00575261190533638, 0.08542801439762115, -0.14521059393882751, 0.3669514060020447, 0.15239310264587402, -0.19613757729530334, 0.13692277669906616, 0.16818632185459137, 0.1681787669658661, 0.06301333010196686, -0.013271279633045197, 0.14790461957454681, -0.03838944435119629, 0.29228097200393677, 0.1368112415075302, 0.16853557527065277, 0.047207534313201904, -0.13887262344360352, 0.009687562473118305, 0.27903157472610474, -0.0835757851600647, 0.41210848093032837, -0.0097518190741539, -0.2817474603652954, -0.03766151890158653, -0.44565603137016296, 0.05253065004944801, -0.153237983584404, 0.26812657713890076, 0.07333021610975266, 0.2590947449207306, 0.00911736860871315, 0.17001773416996002, -0.12399360537528992, -0.3881931006908417, -0.21756039559841156, -0.11374250054359436, -0.1285872459411621, -0.059744738042354584, 0.17315156757831573, 0.15938693284988403, 0.07588300853967667, 0.15590831637382507, -0.2213035672903061, 0.2601040005683899, -0.06207229197025299, -0.00036034267395734787, 0.03367811068892479, 0.17858420312404633, -0.16356632113456726, 0.10458125919103622, 0.09144202619791031, -0.059439994394779205, -0.11221659183502197, 0.10968832671642303, -0.10714826732873917, -0.15857255458831787, -0.3798069357872009, 0.3040447533130646, 0.03276768699288368, -0.03486022353172302, -0.2881541848182678, 0.01922822743654251, 0.11120852082967758, -0.1469254344701767, -0.1332864761352539, -0.2146296352148056, -0.04141806811094284, -0.5015437602996826, 0.24592384696006775, 0.14827819168567657, -0.46882376074790955, 0.13015080988407135, -0.04153817892074585, -0.20615193247795105, 0.18909427523612976, 0.14659813046455383, -0.3383138179779053, -0.01089690625667572, -0.25596335530281067, 0.5682308077812195, -0.016959555447101593, -0.058845993131399155, -0.16745440661907196, 0.055871520191431046, -0.09758828580379486, 0.06954135745763779, 0.04932809993624687, -0.17762698233127594, 0.2018776535987854, -0.01630869135260582, 0.028704632073640823, 0.1607045978307724, 0.08058547228574753, 0.05726008117198944, -0.18823479115962982, -0.2799159288406372, 0.2877090573310852, -0.0021740179508924484, -0.08789733052253723, -0.028525322675704956, 0.13762402534484863, -0.3489091396331787, 0.3593839704990387, -0.2809411287307739, 0.2410125583410263, -0.025955963879823685, 0.6250413060188293, -0.07790149748325348, 0.04632052779197693, -0.13860031962394714, -0.6376519799232483, 0.1738014817237854, -0.30257439613342285, 0.10745380073785782, -0.4707788825035095, -0.256358802318573, -0.05380169302225113, 0.1983867734670639, -0.12281036376953125, -0.06530001759529114, 0.2720189690589905, -0.02420680969953537, -0.013396764174103737, 0.04209453985095024, -0.05829707160592079, -0.15153898298740387, -0.10140404850244522, 0.16166822612285614, -0.202904611825943, 0.4121185541152954, -0.14967399835586548, -0.4449811279773712, -0.10984328389167786, 0.11729060113430023, 0.19282609224319458, -0.1143677607178688, 0.0856083557009697, 0.3777850568294525, 0.08244441449642181, 0.15956467390060425, -0.1974867582321167, 0.0639982521533966, 0.08647574484348297, -0.4559621214866638, -0.10595010966062546, 0.10118286311626434, 0.0011407393030822277, -0.0677047073841095, 0.11807780712842941, 0.4040829539299011, 0.24931342899799347, 0.04481583833694458, 0.18361428380012512, 0.003987180069088936, 0.143964022397995, 0.059067051857709885, 0.03332770615816116, -0.14383359253406525, -0.2801356017589569, 0.21055948734283447, 0.11753576993942261, 0.23054444789886475, -0.20564360916614532, 0.33784639835357666, 0.4622548520565033, -0.0685214251279831, 0.1672968566417694, 0.09913776814937592, -0.3705892860889435, -0.10838107019662857, 0.22959989309310913, -0.19049072265625, 0.24067182838916779, 0.2983466684818268, -0.020736034959554672, 0.08255401998758316, -0.04382999986410141, -0.22298763692378998, 0.33553969860076904, 0.003241017460823059, 0.19844886660575867, 0.2131117880344391, 0.4736578166484833, -0.08961707353591919, -0.4393598139286041, 0.09725482761859894, -0.024189602583646774, 0.1410835236310959, -0.23576708137989044, -0.035004403442144394, -0.4325895309448242, 0.1258394420146942, -0.15692532062530518, -0.31099772453308105, -0.0883600115776062, -0.16601745784282684, 0.012408707290887833, 0.34924769401550293, -0.11334912478923798, 0.19664371013641357, -0.1365751028060913, -0.13444305956363678, 0.10979367792606354, -0.17620165646076202, -0.286311537027359, -0.14707912504673004, -0.36708706617355347, 0.15209130942821503, 0.02958909049630165, -0.08224739134311676, 0.08620113134384155, 0.06287671625614166, 0.008376162499189377, -0.44583210349082947, -0.4860210418701172, 0.10645097494125366, -0.2978714108467102, 0.09031452238559723, 0.2783869504928589, 0.16968481242656708, -0.1372711956501007, -0.11953148245811462, 0.510048508644104, -0.2875474989414215, -0.41032081842422485, 0.4233173429965973, -0.17335154116153717, 0.055808816105127335, -0.1378192901611328, -0.38745900988578796, -0.2012423425912857, -0.24809226393699646, 0.31456440687179565, 0.016229942440986633, 0.09122321009635925, 0.2991073429584503, 0.058056797832250595, 0.04734659194946289, -0.07700558006763458, -0.03140828758478165, -0.08385400474071503, 0.06310445070266724, 0.3219716250896454, -0.22866247594356537, -0.3900351822376251, 0.004152070730924606, -0.17158164083957672, -0.11342258751392365, 0.08933619409799576, -0.11093151569366455, -0.1734217256307602, -0.1884457767009735, 0.6951499581336975, 0.07163138687610626, -0.1138700544834137, 0.3373633921146393, 0.3119027316570282, -0.19130663573741913, -0.1589069366455078, 0.025557056069374084, 0.17881111800670624, 0.004605099558830261, -0.09777667373418808, 0.034215740859508514, -0.008018266409635544, 0.07332879304885864, 0.47616100311279297, -0.08745801448822021, -0.2998293340206146, 0.4972362518310547, -0.26159852743148804, 0.12749060988426208, -0.10811104625463486, -0.2141779065132141, 0.013435239903628826, -0.1973123848438263, 0.16920889914035797, 0.23928074538707733, -0.1268874704837799, -0.16794180870056152, 0.11045703291893005, 0.008990902453660965, -0.17772284150123596, -0.2537303864955902, -0.09098057448863983, 0.24696464836597443, 0.18286322057247162, -0.04327022656798363, 0.05386858433485031, -0.019296007230877876, -0.09915875643491745, 0.21373338997364044, -0.28251510858535767, -0.03176978975534439, 0.020949775353074074, -0.13406401872634888, -0.21085214614868164, -0.29859063029289246, 0.17923161387443542, 0.21142469346523285, 0.0743459165096283, 0.13921242952346802, -0.2581048905849457, 0.11975710093975067, -0.05812351033091545, 0.5388950705528259, 0.10187404602766037, 0.06173606589436531, 0.17307835817337036, 0.16407890617847443, -0.36452120542526245, -0.2548258304595947, -0.11831508576869965, -0.23219729959964752, -0.05255047604441643, 0.338083952665329, -0.6598981022834778, -0.21454162895679474, 0.2546458840370178, 0.2362983524799347, -0.02802867442369461, 0.01967015489935875, -0.23443208634853363, -0.34867605566978455, -0.03841456025838852, -0.2105499804019928, -0.015291685238480568, 0.5068023204803467, -0.23252920806407928, -0.2845616638660431, -0.13726988434791565, -0.13592278957366943, -0.15461333096027374, 0.27353382110595703, 0.27191340923309326, -0.37233591079711914, 0.11864396929740906, 0.006298430263996124, 0.23260875046253204, 0.7634121775627136, 0.34905412793159485, 0.23924431204795837, -0.4080250859260559, -0.1056361272931099, 0.08192023634910583, 0.21933826804161072, 0.06291517615318298, -0.26146888732910156, 0.11254069209098816, -0.1891268491744995, -0.0767631083726883, -0.21402762830257416, -0.11838515102863312, 0.5170642137527466, -0.31283533573150635, 0.032444532960653305, 0.0958411917090416, 0.42409786581993103, -0.03037748485803604, 0.10261818766593933, 0.0014747194945812225, 0.39856743812561035, -0.31257522106170654, 0.2646922469139099, 0.2118310183286667, 0.7822631001472473, -0.01778680831193924, 0.1933961808681488, 0.6809622645378113, -0.12985087931156158, 0.11390075087547302, -0.005901779979467392, 0.14670848846435547, -0.6576913595199585, -0.06070078909397125, -0.02603483945131302, 0.009951818734407425, 0.22631004452705383, 0.1949218064546585, -0.08298591524362564, -0.03637506812810898, -0.20605449378490448, 0.32612961530685425, 0.0608854740858078, 0.16328763961791992, 0.001327410340309143, -0.15697728097438812, -0.18775051832199097, 0.19055138528347015, -0.12904100120067596, -0.17182020843029022, -0.05302413925528526, -0.2575610876083374, -0.02102503925561905, -0.25614213943481445, -0.12320739030838013, 0.25322067737579346, -0.29017654061317444, 0.18425288796424866, 0.29155614972114563, -0.20285546779632568, -0.1614803820848465, 0.05954623967409134, -0.1069454699754715, -0.2685791254043579, -0.16634519398212433, 0.06610361486673355, 0.149566650390625, -0.03609403222799301, 0.008619619533419609, -0.044885922223329544, 0.21550653874874115, -0.028581196442246437, -0.15987703204154968, 0.05929633229970932, -0.055880870670080185, 0.10529805719852448, -0.08902888000011444, -0.09406310319900513, 0.08458128571510315, -0.43025723099708557, 0.11365972459316254, -0.2461051046848297, 0.06773035228252411, -0.2601814568042755, 0.21459925174713135, -0.00080108642578125, -0.08094297349452972, 0.12403997778892517, 0.03198782354593277, -0.06078939884901047, -0.12960150837898254, 0.2744998633861542, 0.012269522994756699, 0.33253559470176697, 0.43111681938171387, 0.19912688434123993, -0.2003164291381836, -0.2476521134376526, 0.15130501985549927, 0.37093600630760193, -0.42089536786079407, 0.06832262873649597, 0.2048833817243576, 0.1357753425836563, -0.042844269424676895, 0.44493335485458374, -0.07382858544588089, 0.019424710422754288, -0.0885382741689682, -0.13872002065181732, -0.13754579424858093, 0.36616140604019165, 0.035326797515153885, 0.07564598321914673, 0.2429962158203125, 0.33081918954849243, -0.05400075763463974, -0.15742097795009613, -0.41953450441360474, 0.04367424547672272, 0.03848980367183685, 0.05583939701318741, -0.26003769040107727, -0.2006760537624359, 0.1991463303565979, 0.03742357715964317, 0.30997565388679504, 0.10608677566051483, -0.03514432907104492, -0.26875418424606323, -0.11961670219898224, 0.05648045241832733, 0.055573031306266785, -0.0847608894109726, 0.009095265530049801, 0.039590805768966675, -0.29755374789237976, -0.13058222830295563, 0.23192915320396423, 0.06041783094406128, -0.05661743879318237, 0.21724382042884827, 0.18791043758392334, 0.15506303310394287, -0.28721749782562256, -0.0630669966340065, -0.11356867849826813, 0.19417719542980194, 0.04844510182738304, 0.09500813484191895, -0.21973001956939697, -0.052947163581848145, -0.022243645042181015, 0.17423513531684875, 0.057393889874219894, -0.08058186620473862, 0.4631369709968567, -0.4298359751701355, -0.29132530093193054, -0.2899978756904602, 0.5319154262542725, 0.2573297619819641, -0.039620984345674515, -0.1587473452091217, 0.19330039620399475, 0.3192138969898224, -0.40645289421081543, 0.00032733919215388596, 0.2303375005722046, -0.15160386264324188, 0.049428705126047134, 0.10948536545038223, 0.08580498397350311, 0.08335325121879578, -0.14146208763122559, 0.05703912675380707, 0.24883942306041718, 0.17432335019111633, -0.11757135391235352, 0.5136816501617432, -0.06140808016061783, 0.10167913138866425, 0.44227150082588196, 0.19664983451366425, 0.3323625326156616, 0.2319992184638977, -0.18364247679710388, 0.266180157661438, -0.07938389480113983, -0.09510569274425507, 0.16310280561447144, -0.30986353754997253, -0.056022439152002335, 0.20069396495819092, 0.22186796367168427, -0.27262067794799805, 0.05070779472589493, 0.6607791185379028, 0.09736037254333496, -0.23384475708007812, -0.138451486825943, 0.31676924228668213, -0.18701791763305664, -0.04447941854596138, -0.12011754512786865, -0.04751250147819519, -0.14432871341705322, -0.14940620958805084, -0.13677868247032166, -0.1606372594833374, 0.441753625869751, 0.04628317058086395, -0.08844898641109467, -0.5731294751167297, 0.23150634765625, 0.04414074122905731, 0.327832967042923, -0.06139866262674332, 0.25209468603134155, 0.2752611041069031, -0.2782360017299652, -0.21205106377601624, 0.13675890862941742, 0.3138449788093567, 0.33066844940185547, -0.1624564230442047, -0.21182189881801605, -0.29630327224731445, -0.17962409555912018, -0.015728557482361794, 0.05988963320851326, 0.07663776725530624, 0.22336730360984802, 0.15398061275482178, 0.2236110419034958, -0.1787717193365097, -0.15017780661582947, 0.33459392189979553, 0.08371809124946594, 0.06161326542496681, 0.2590199112892151, -0.1062970906496048, -0.3388211727142334, -0.0023848898708820343, -0.17791256308555603, -0.10937954485416412, 0.1066737100481987, 0.38438016176223755, 0.2676604092121124, 0.05455528944730759, -0.20691026747226715, 0.15335609018802643, 0.08136610686779022, 0.2534704804420471, 0.14145666360855103, 0.10496166348457336, -0.13643230497837067, 0.013490751385688782, -0.37040096521377563, 0.350683331489563, -0.1276385337114334, -0.025513101369142532, 0.18478909134864807, 0.2998410165309906, 0.10184828191995621, 0.09140671789646149, -0.009909868240356445, -0.08373075723648071, 0.04879472404718399, 0.33478814363479614, -0.20532570779323578, 0.08069175481796265, 0.11864999681711197, -0.1653522253036499, -0.17291921377182007, -0.3211524188518524, 0.34677547216415405, -0.26141107082366943, 0.15921267867088318, -0.16020387411117554, 0.03480944037437439, 0.13833875954151154, -0.2469145655632019, 0.484357625246048, 0.09284254163503647, 0.1677621304988861, -0.039260465651750565, 0.007471958175301552, -0.10545113682746887, -0.18473784625530243, -0.18041396141052246, 0.2825024127960205, -0.06699487566947937, 0.2611110508441925, 0.1733752191066742, -0.07898421585559845, -0.25930294394493103, 0.24456770718097687, 0.02384503185749054, -0.14853939414024353, -0.16251429915428162, 0.4314497709274292, -0.1155475527048111, -0.12369246035814285, -0.27429941296577454, -0.06916370987892151, -0.010786771774291992, 0.04795846343040466, -0.3689272999763489, -0.7111481428146362, 0.4126575291156769, -0.545082688331604, -0.2709537744522095, 0.08806158602237701, 0.21299125254154205, 0.14189985394477844, -0.21895624697208405, -0.3959415555000305, 0.1343163549900055, 0.3609628975391388, 0.03474368900060654, -0.25268176198005676, 0.03425569087266922, 0.04211748391389847, -0.012863647192716599, -0.1277565360069275, 0.32817742228507996, -0.01948970928788185, 0.03808082640171051, -0.035956624895334244, -0.13260036706924438 ]
https://github.com/huggingface/datasets/issues/6395
Add ability to set lock type
We've replaced our filelock implementation with the `filelock` package, so their repo is the right place to request this feature. In the meantime, the following should work: ```python import filelock filelock.FileLock = filelock.SoftFileLock import datasets ... ```
### Feature request Allow setting file lock type, maybe from an environment variable Currently, it only depends on whether fnctl is available: https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/utils/filelock.py#L463-L470C16 ### Motivation In my environment, flock isn't supported on a network attached drive ### Your contribution I'll be happy to submit a pr.
37
Add ability to set lock type ### Feature request Allow setting file lock type, maybe from an environment variable Currently, it only depends on whether fnctl is available: https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/utils/filelock.py#L463-L470C16 ### Motivation In my environment, flock isn't supported on a network attached drive ### Your contribution I'll be happy to submit a pr. We've replaced our filelock implementation with the `filelock` package, so their repo is the right place to request this feature. In the meantime, the following should work: ```python import filelock filelock.FileLock = filelock.SoftFileLock import datasets ... ```
[ -0.3815121054649353, -0.05841841548681259, -0.07984372973442078, -0.3621046543121338, -0.15861408412456512, -0.08662979304790497, 0.6261723041534424, 0.16512615978717804, 0.16967500746250153, 0.08532851934432983, -0.3456929326057434, 0.2148352563381195, -0.060488782823085785, 0.06277410686016083, -0.25993815064430237, 0.3010196089744568, 0.10321962833404541, 0.1451057344675064, -0.30184996128082275, 0.015724606812000275, -0.13232585787773132, 0.34251758456230164, 0.17432083189487457, -0.08144910633563995, -0.08672930300235748, 0.016290482133626938, 0.08199572563171387, 0.117855966091156, -0.2114894688129425, -0.03334483131766319, 0.08027125895023346, 0.7382546067237854, 0.31936249136924744, 0.4733959138393402, -0.00010792927059810609, -0.13630631566047668, -0.029584243893623352, -0.03576131537556648, -0.1416778862476349, 0.058339983224868774, -0.03443843126296997, -0.3538021147251129, 0.19134898483753204, -0.3127478361129761, 0.13007879257202148, -0.18772739171981812, 0.115360789000988, -0.24946442246437073, 0.3825644254684448, 0.16198283433914185, 0.18803715705871582, 0.15292507410049438, 0.14154034852981567, -0.010432522743940353, 0.035011209547519684, -0.16292385756969452, -0.47496283054351807, 0.4875876009464264, 0.45998507738113403, -0.005331512540578842, -0.03940898925065994, 0.0954393744468689, 0.054626062512397766, -0.004824001342058182, 0.5035682320594788, 0.1499529480934143, -0.050350069999694824, -0.30183205008506775, -0.3856753408908844, 0.24834564328193665, 0.05003351718187332, -0.13545453548431396, -0.4742218554019928, -0.2892475128173828, 0.3722073435783386, -0.0036893170326948166, 0.2754543721675873, 0.10524331033229828, -0.26105839014053345, 0.3327062129974365, 0.13305598497390747, -0.04472973570227623, -0.232671320438385, 0.0587768517434597, 0.0327141210436821, 0.1795707643032074, 0.07469180971384048, -0.035572655498981476, 0.42301949858665466, -0.18497848510742188, 0.09744898974895477, 0.05697713792324066, -0.18843095004558563, 0.1486770063638687, 0.028589501976966858, -0.3519500494003296, 0.060670606791973114, 0.13792020082473755, 0.31343671679496765, 0.10356353968381882, -0.24498532712459564, -0.051362693309783936, -0.0947137102484703, 0.2692866921424866, 0.07050973176956177, -0.18952296674251556, 0.058902814984321594, -0.1897806078195572, 0.5232930183410645, 0.20573978126049042, -0.13147835433483124, 0.08916068077087402, 0.2173554003238678, -0.3414764106273651, 0.2990352511405945, 0.2241077423095703, 0.3925248384475708, -0.027852408587932587, 0.3891449272632599, 0.049907371401786804, 0.01345263421535492, -0.23140797019004822, -0.11299566179513931, 0.2763158977031708, 0.2787887454032898, -0.22506356239318848, 0.16506925225257874, 0.10974851250648499, -0.05078212171792984, 0.13249744474887848, 0.05990162119269371, -0.19510817527770996, 0.1590953916311264, 0.03695765510201454, 0.32132384181022644, -0.18496665358543396, -0.25618648529052734, 0.3537932336330414, 0.15480375289916992, 0.110817551612854, 0.11249101161956787, -0.10410147905349731, -0.05187656730413437, 0.049798332154750824, -0.07862044870853424, -0.21119166910648346, 0.020094411447644234, -0.27454012632369995, -0.28576311469078064, 0.11669530719518661, -0.24957799911499023, 0.14776185154914856, -0.2558334171772003, 0.1492222547531128, -0.07637423276901245, -0.15504024922847748, 0.1251297891139984, 0.07422347366809845, -0.48170581459999084, -0.09811893105506897, 0.1676449477672577, 0.006393350660800934, 0.10605365037918091, 0.0367288663983345, -0.21143929660320282, 0.2170286625623703, -0.1207367479801178, 0.035342246294021606, 0.23316524922847748, -0.6072009205818176, -0.07293187826871872, 0.07412420213222504, 0.10060351341962814, -0.06256475299596786, -0.33293965458869934, 0.1091456413269043, 0.33072349429130554, -0.3302616477012634, -0.41825956106185913, 0.2040187269449234, -0.31460779905319214, -0.13685138523578644, 0.18413060903549194, 0.4660066068172455, 0.12890905141830444, -0.2693631052970886, 0.220989391207695, 0.46720021963119507, 0.17128852009773254, -0.019514646381139755, -0.03770022466778755, -0.26049914956092834, -0.22388450801372528, 0.1482587307691574, -0.15340159833431244, 0.1904599815607071, 0.3268919289112091, -0.10419566929340363, 0.21608418226242065, -0.21284833550453186, -0.12475953251123428, 0.1423681080341339, 0.6931871771812439, 0.12518472969532013, -0.0765933021903038, -0.239729106426239, -0.5678797960281372, 0.028021343052387238, -0.2569688558578491, 0.056987106800079346, -0.1552819460630417, -0.2758116126060486, 0.09761213511228561, -0.061632394790649414, 0.013487912714481354, 0.2499278336763382, 0.20861400663852692, -0.09140537679195404, -0.2534642219543457, 0.08527307212352753, 0.002737428992986679, 0.18902716040611267, -0.14373467862606049, 0.09832316637039185, 0.4582538902759552, 0.04242480546236038, -0.1230916753411293, -0.3216084837913513, 0.018292121589183807, -0.03831245005130768, 0.11752834916114807, -0.16518008708953857, -0.15818950533866882, 0.32913413643836975, 0.26566848158836365, 0.31049561500549316, -0.027446240186691284, 0.324679434299469, -0.02447042055428028, 0.5906761288642883, -0.23054075241088867, 0.11932174861431122, -0.05351434275507927, 0.14187368750572205, -0.4323303997516632, 0.6140628457069397, -0.1805572211742401, -0.16255143284797668, -0.05889979749917984, -0.09393278509378433, 0.23768961429595947, -0.052224867045879364, 0.020303739234805107, -0.0937589481472969, 0.03429999202489853, 0.1683199554681778, -0.13721813261508942, 0.1105654388666153, 0.0013682171702384949, -0.06668297201395035, 0.2727428674697876, -0.00822569988667965, 0.27252739667892456, 0.05438436567783356, 0.0993582010269165, 0.29209965467453003, 0.08071508258581161, 0.881239116191864, 0.5674375295639038, 0.3294811546802521, 0.02170683443546295, 0.0722585916519165, 0.11333399266004562, -0.30344992876052856, 0.2753334045410156, -0.15064121782779694, -0.0246758870780468, 0.22140082716941833, 0.24895335733890533, -0.1565335988998413, -0.3417597711086273, -0.5464813113212585, -0.059701159596443176, -0.1004958376288414, -0.03766399621963501, -0.12113945186138153, -0.08140604197978973, 0.12392394989728928, -0.03574790060520172, 0.4145152270793915, -0.18940195441246033, -0.33825910091400146, 0.39416611194610596, 0.5913834571838379, -0.09068935364484787, -0.063303641974926, -0.34680265188217163, 0.24327696859836578, 0.08298404514789581, -0.1443633735179901, -0.1515466719865799, 0.026062900200486183, -0.013760115951299667, 0.14478740096092224, 0.152919203042984, -0.2559814155101776, 0.32977890968322754, 0.2462724894285202, -0.1307985782623291, -0.5591795444488525, -0.1441788524389267, -0.09166273474693298, -0.2872105836868286, 0.49646034836769104, 0.011801056563854218, 0.28390970826148987, -0.22336584329605103, 0.01868128404021263, 0.1909329742193222, -0.14950385689735413, -0.20115144550800323, -0.30590158700942993, -0.13035590946674347, 0.17668451368808746, -0.4819551408290863, -0.0602932944893837, -0.35587164759635925, -0.43487951159477234, 0.5580154657363892, 0.16932527720928192, 0.03004324994981289, 0.18447361886501312, -0.06309767812490463, 0.10156743228435516, -0.06179274246096611, 0.11451040953397751, -0.0008592347148805857, -0.1405028998851776, 0.4533960819244385, -0.16188080608844757, -0.40714335441589355, -0.0510697178542614, 0.15124425292015076, -0.4795180559158325, -0.12561394274234772, -0.07629495114088058, -0.652479887008667, -0.2213093340396881, 0.3828820288181305, -0.3060201108455658, 0.17244911193847656, 0.0981646329164505, -0.06848810613155365, -0.1395622193813324, -0.144632488489151, 0.33518531918525696, 0.21239054203033447, 0.08274924755096436, -0.324767529964447, 0.11770883947610855, 0.09747935831546783, -0.0065118782222270966, 0.48298805952072144, -0.022334089502692223, 0.08856061100959778, 0.4767955541610718, -0.28987154364585876, 0.24961212277412415, -0.20560118556022644, -0.07964281737804413, 0.18692082166671753, 0.3817228078842163, 0.07563797384500504, 0.0905606597661972, -0.08974975347518921, -0.04716632515192032, -0.031233198940753937, -0.3243298828601837, -0.052555691450834274, -0.46059954166412354, 0.10256573557853699, 0.5573986768722534, -0.05671278387308121, -0.2051767259836197, -0.08733472228050232, 0.23822271823883057, -0.11408671736717224, 0.07229562103748322, 0.5550169944763184, 0.08653050661087036, -0.050308000296354294, -0.2240009307861328, 0.06819571554660797, -0.3335448205471039, 0.19343975186347961, 0.015690093860030174, 0.12706059217453003, -0.09526394307613373, 0.024306364357471466, 0.08142952620983124, -0.12768755853176117, 0.38670235872268677, 0.1893959641456604, 0.13142243027687073, -0.07324941456317902, 0.19919410347938538, -0.12556588649749756, -0.1234719455242157, -0.4260830879211426, -0.2706434428691864, 0.2862580418586731, 0.06814096868038177, 0.0024005472660064697, -0.06979749351739883, -0.44413992762565613, -0.2428872436285019, 0.027319882065057755, -0.5110815167427063, 0.11525025963783264, 0.19486793875694275, -0.6834506988525391, 0.18107542395591736, 0.24735461175441742, -0.0020720292814075947, -0.014354504644870758, -0.20018060505390167, -0.12049521505832672, -0.09180387854576111, 0.24717828631401062, 0.18251553177833557, 0.08767101168632507, 0.1085987538099289, -0.06981822103261948, -0.24764451384544373, 0.025450032204389572, 0.11465577781200409, -0.009817864745855331, 0.06508754938840866, -0.003219522535800934, -0.05334708094596863, -0.10352222621440887, 0.08538815379142761, 0.15981729328632355, -0.16188615560531616, 0.06712853908538818, 0.0853128731250763, 0.21270333230495453, -0.08848100155591965, -0.16539330780506134, 0.060970939695835114, 0.08918311446905136, 0.08742029964923859, -0.04840861260890961, 0.22261035442352295, 0.2028760462999344, -0.20741277933120728, 0.37542077898979187, 0.4448288679122925, -0.1883717030286789, 0.2309725135564804, 0.09394117444753647, 0.6847876906394958, -0.027182258665561676, 0.3515482544898987, 0.1316947042942047, -0.2020692378282547, 0.36720603704452515, -0.27411949634552, -0.1250053495168686, -0.10598726570606232, -0.39935851097106934, -0.10983492434024811, -0.06493816524744034, 0.1732577234506607, -0.23434798419475555, -0.40472960472106934, -0.14011555910110474, -0.06979905068874359, -0.33091577887535095, -0.37250369787216187, 0.22659021615982056, -0.9082637429237366, -0.37372544407844543, -0.16793081164360046, 0.16550658643245697, 0.0988067239522934, 0.17387130856513977, -0.07003872096538544, -0.23958802223205566, -0.17939788103103638, 0.028097987174987793, -0.26003313064575195, -0.1451498568058014, -0.17621128261089325, 0.1550149917602539, -0.18050548434257507, 0.22763420641422272, -0.08614251017570496, 0.17900946736335754, 0.13446307182312012, 0.2997026741504669, -0.13703659176826477, 0.16920815408229828, -0.09106089919805527, 0.17102792859077454, -0.008431746624410152, -0.18288542330265045, 0.28005650639533997, -0.11825398355722427, -0.09397503733634949, -0.4010346829891205, 0.32029491662979126, -0.12180493772029877, 0.1826588213443756, 0.04002521187067032, -0.1063833236694336, -0.18031363189220428, -0.4310665726661682, -0.21255013346672058, -0.2987408936023712, -0.045646969228982925, 0.16159063577651978, 0.02858889102935791, -0.060897547751665115, -0.03755901753902435, -0.14425356686115265, -0.06299030035734177, -0.06425939500331879, 0.5349792838096619, -0.16635435819625854, -0.3177962005138397, 0.533543050289154, 0.18221352994441986, -0.0902935266494751, -0.29437386989593506, 0.3296184241771698, -0.044396378099918365, -0.1404569149017334, 0.1634376496076584, 0.1748989373445511, -0.2501619756221771, 0.058655235916376114, 0.46647992730140686, 0.12188129872083664, 0.08455177396535873, 0.038240160793066025, -0.39179009199142456, -0.40955156087875366, -0.10275645554065704, -0.29785996675491333, 0.16651512682437897, 0.3293296694755554, -0.004729444161057472, 0.16091717779636383, -0.24366983771324158, -0.3571854829788208, 0.017683323472738266, 0.0824284628033638, -0.31121474504470825, 0.2795126736164093, 0.18739116191864014, 0.1993187963962555, 0.027436692267656326, 0.12461955845355988, 0.25326624512672424, -0.11996996402740479, -0.282975971698761, -0.3798866868019104, 0.07338334619998932, -0.06275229156017303, 0.15738409757614136, 0.06203977391123772, -0.46920228004455566, -0.16691537201404572, 0.07733142375946045, -0.013411481864750385, 0.07734864205121994, -0.004745587706565857, 0.08980593830347061, 0.29291078448295593, -0.01520054042339325, -0.13199937343597412, -0.23124292492866516, -0.0269920751452446, -0.23673899471759796, -0.17147314548492432, 0.05115251988172531, -0.4382322132587433, 0.15192699432373047, -0.41405776143074036, 0.14819550514221191, 0.448857843875885, 0.4604549705982208, 0.08665283024311066, 0.3564911484718323, -0.21901479363441467, 0.33383557200431824, 0.45517605543136597, -0.1589518040418625, -0.1503763198852539, -0.08294286578893661, 0.15931901335716248, 0.24099087715148926, -0.16592063009738922, -0.06507530808448792, 0.29272061586380005, -0.09257736057043076, 0.29410016536712646, 0.15665525197982788, -0.19202746450901031, -0.09953578561544418, -0.3734825849533081, 0.04252343624830246, -0.04507967457175255, -0.26340794563293457, 0.2586386799812317, 0.21714358031749725, 0.1526472419500351, 0.05950579419732094, 0.4513941705226898, -0.07058678567409515, 0.2041410356760025, 0.3736381530761719, -0.2972702980041504, -0.10277445614337921, 0.1600133180618286, 0.14128467440605164, 0.46030279994010925, -0.0782957449555397, 0.10535340011119843, -0.00015638768672943115, 0.19224470853805542, 0.14026355743408203, 0.22269880771636963, 0.14812450110912323, -0.21641582250595093, -0.06627833098173141, -0.007344711571931839, 0.3292391002178192, -0.11928487569093704, -0.16283832490444183, 0.20703817903995514, 0.09330929070711136, 0.0323619619011879, -0.051864512264728546, 0.06978591531515121, -0.031713008880615234, -0.10293042659759521, 0.4849843978881836, 0.5815595984458923, -0.09721041470766068, -0.15472117066383362, 0.18125715851783752, 0.466957688331604, -0.11126171052455902, -0.19167017936706543, 0.09389659762382507, -0.0433972105383873, 0.19738484919071198, 0.21867819130420685, 0.12504151463508606, 0.1637471616268158, 0.4558652341365814, 0.3390112519264221, -0.26174935698509216, 0.024998599663376808, -0.2283542901277542, 0.09846305847167969, 0.21792389452457428, 0.08674168586730957, 0.24531711637973785, 0.22326573729515076, -0.247089684009552, -0.05307416990399361, -0.0903526246547699, -0.2963067293167114, -0.17456108331680298, 0.4446611702442169, 0.293935626745224, -0.0024184174835681915, -0.1293714940547943, 0.05671769008040428, -0.09552735090255737, -0.09829716384410858, -0.09745161235332489, 0.05907687172293663, 0.1938713788986206, -0.16367708146572113, 0.10452128946781158, 0.18985264003276825, -0.1659877598285675, 0.11625781655311584, 0.06109081953763962, 0.030374448746442795, 0.11067153513431549, -0.40094345808029175, -0.00036545097827911377, 0.021570859476923943, -0.21138738095760345, -0.1057266891002655, -0.03426408767700195, -0.017554931342601776, 0.04717547819018364, 0.39306920766830444, 0.06460076570510864, 0.17552350461483002, 0.27467072010040283, -0.45504575967788696, 0.04839535430073738, -0.00923147052526474, -0.10380434989929199, -0.08209399878978729, -0.08626566082239151, 0.06923501193523407, -0.3379412293434143, 0.08426643162965775, 0.15612941980361938, -0.1612074375152588, -0.08294619619846344, -0.1087547093629837, 0.35886842012405396, 0.05890137702226639, 0.22151394188404083, -0.25216442346572876, -0.09924302250146866, -0.08833388984203339, -0.06279142946004868, -0.17990447580814362, -0.36326342821121216, -0.0609319843351841, 0.21782593429088593, -0.3449278771877289, -0.14527785778045654, -0.15940861403942108, 0.3374424874782562, -0.4774959087371826, -0.1322142779827118, -0.2581453025341034, 0.30111658573150635, -0.07767100632190704, 0.040585484355688095, -0.0018560271710157394, 0.3031139373779297, 0.045920923352241516, 0.20432791113853455, -0.27858632802963257, -0.3448065221309662, 0.3852790594100952, -0.2804412841796875, -0.16981808841228485, 0.023368753492832184, 0.2531082332134247, 0.027080215513706207, 0.18868142366409302, -0.24998250603675842, 0.11561443656682968, -0.017091918736696243, -0.016638491302728653, -0.05045117437839508, 0.16075530648231506, 0.20562006533145905, -0.08114216476678848, -0.17949236929416656, 0.029244277626276016, 0.26905542612075806, 0.0896378830075264, -0.15183724462985992, -0.14793923497200012 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
Just ran into this working on data lib that's attempting to achieve common interfaces across hf datasets, webdataset, native torch style datasets. The defacto standards for image tensors are numpy == HWC, torch.Tensor == CHW. I had to drop use of 'torch' formatting because as is (H, W, C) makes it incompatible with pretty much all standard torch vision processing (torchvision, etc) including model inputs themselves... not sure what the breakage scope would be, but might be worth considering a breaking change since I'm not aware of many use cases where a torch.Tensor image is expected to be in HWC form. And if I set the format to 'torch', I'd expect to be able to apply torchvision transforms, etc directly to the output... EDIT: For 'torch' output to be compatible with torch conventions (namely torchvision for images), should follow this https://pytorch.org/vision/0.17/transforms.html#supported-input-types-and-conventions attn @lhoestq
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
143
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 Just ran into this working on data lib that's attempting to achieve common interfaces across hf datasets, webdataset, native torch style datasets. The defacto standards for image tensors are numpy == HWC, torch.Tensor == CHW. I had to drop use of 'torch' formatting because as is (H, W, C) makes it incompatible with pretty much all standard torch vision processing (torchvision, etc) including model inputs themselves... not sure what the breakage scope would be, but might be worth considering a breaking change since I'm not aware of many use cases where a torch.Tensor image is expected to be in HWC form. And if I set the format to 'torch', I'd expect to be able to apply torchvision transforms, etc directly to the output... EDIT: For 'torch' output to be compatible with torch conventions (namely torchvision for images), should follow this https://pytorch.org/vision/0.17/transforms.html#supported-input-types-and-conventions attn @lhoestq
[ -0.02582848072052002, -0.7482280731201172, 0.10426580905914307, 0.21440689265727997, 0.06788306683301926, -0.026591144502162933, 0.8142369985580444, 0.32576999068260193, -0.057888224720954895, 0.06085234135389328, -0.15543116629123688, 0.1230911836028099, -0.14922524988651276, -0.3736121952533722, -0.05243244022130966, -0.39119666814804077, 0.06270155310630798, -0.0807635635137558, -0.19147750735282898, -0.11072783917188644, -0.09481868892908096, -0.0417635515332222, -0.04825034365057945, 0.02171945944428444, -0.7463671565055847, 0.1590021699666977, -0.14236079156398773, -0.061595216393470764, 0.12054092437028885, 0.03293567895889282, 0.26497742533683777, -0.16832901537418365, 0.13565322756767273, 0.5544328689575195, -0.00012991492985747755, 0.01509423553943634, 0.260471373796463, -0.08027757704257965, -0.03854940086603165, -0.030207589268684387, 0.47373446822166443, -0.2054695188999176, -0.029171667993068695, -0.3476128876209259, -0.12511323392391205, -0.020856697112321854, 0.02437189780175686, -0.17170681059360504, -0.16438178718090057, 0.276851087808609, 0.06856167316436768, 0.36645275354385376, -0.16478665173053741, 0.11559181660413742, 0.27904343605041504, 0.4699633717536926, -0.2317313402891159, 0.2792344093322754, 0.10662095993757248, 0.23089975118637085, 0.0753614604473114, 0.2821725904941559, -0.5142707824707031, 0.08580557256937027, 0.30193066596984863, 0.08202328532934189, -0.5834623575210571, -0.05018084496259689, 0.08329639583826065, 0.1783755123615265, 0.2962140142917633, -0.35236814618110657, -0.09157084673643112, -0.07590766996145248, -0.3203681707382202, 0.02404261939227581, 0.06742436438798904, 0.5474756956100464, 0.22134293615818024, -0.005512591451406479, -0.30626749992370605, 0.36678871512413025, -0.19261348247528076, 0.2899938225746155, -0.2994975447654724, 0.05410774052143097, 0.02838263288140297, 0.3651551902294159, -0.4115244746208191, 0.30827796459198, 0.2750501334667206, -0.2660038471221924, 0.3045845329761505, -0.1386965811252594, 0.1825444996356964, 0.09318049252033234, -0.320035845041275, -0.290976345539093, -0.24508953094482422, -0.24551062285900116, 0.23532502353191376, 0.11683960258960724, 0.028674539178609848, 0.03756025806069374, 0.03745903819799423, 0.07257112860679626, -0.10042736679315567, 0.09219203889369965, -0.007242463529109955, -0.3843223452568054, 0.43792015314102173, -0.05665808916091919, 0.20564746856689453, -0.25714778900146484, 0.05002826824784279, -0.1172773465514183, 0.16688191890716553, 0.07104460895061493, -0.1262761801481247, -0.39617595076560974, -0.24251431226730347, 0.031784314662218094, -0.03681306913495064, 0.21972963213920593, -0.20762330293655396, 0.30071890354156494, 0.4687432050704956, 0.2315908670425415, -0.04724792763590813, 0.3383216857910156, -0.09884264320135117, -0.07038187980651855, -0.1932092159986496, -0.343949556350708, -0.10733281075954437, -0.32529425621032715, 0.11616632342338562, 0.2966530919075012, 0.4402261972427368, 0.3487088680267334, 0.00164748914539814, -0.04431864619255066, 0.7066233158111572, 0.06548475474119186, -0.30308347940444946, 0.1300501674413681, 0.1741754561662674, 0.5467325448989868, -0.19976599514484406, 0.26458632946014404, -0.6074967384338379, -0.08927195519208908, -0.28129005432128906, 0.016490619629621506, 0.021562814712524414, 0.15067003667354584, 0.30829334259033203, -0.2558366656303406, 0.28796303272247314, -0.3127184212207794, 0.38687875866889954, -0.536413311958313, -0.051295019686222076, -0.2841344177722931, 0.010923070833086967, -0.05543799698352814, -0.12683068215847015, -0.06480767577886581, 0.5846177339553833, 0.2466733455657959, 0.5200930833816528, 0.24934230744838715, -0.15048854053020477, -0.1350320279598236, -0.31580880284309387, -0.09665949642658234, 0.1401434689760208, -0.41707995533943176, -0.1993563175201416, -0.12146888673305511, 0.061365023255348206, 0.04361580312252045, 0.11757949739694595, 0.32946354150772095, 0.15167288482189178, -0.11675869673490524, -0.031597502529621124, 0.335699200630188, 0.017079614102840424, 0.2000507414340973, -0.26633208990097046, -0.06212352216243744, 0.4818083643913269, 0.05940678343176842, -0.07099947333335876, -0.011111348867416382, 0.0236697718501091, 0.19442245364189148, 0.1397833228111267, -0.1753627359867096, -0.12477955967187881, -0.19966278970241547, -0.10976605117321014, 0.045558176934719086, 0.15129348635673523, 0.049234211444854736, -0.2809302806854248, 0.047556765377521515, 0.07736261934041977, 0.1406608521938324, 0.16476425528526306, -0.16400153934955597, 0.04675294831395149, -0.21561448276042938, -0.09503987431526184, -0.09988635778427124, -0.0906790941953659, 0.0637340247631073, -0.11197105050086975, -0.2416040003299713, -0.005813863128423691, 0.23907345533370972, -0.1484365463256836, -0.027524886652827263, -0.07009875774383545, 0.2666662335395813, -0.15584079921245575, -0.09773856401443481, -0.3458380699157715, 0.22263026237487793, 0.07092681527137756, -0.13921627402305603, -0.034208495169878006, 0.2709706723690033, -0.015085715800523758, -0.12123391032218933, -0.7300976514816284, -0.00849202275276184, 0.3744949996471405, -0.24623088538646698, 0.2609012722969055, 0.4635339379310608, 0.1454267054796219, -0.21433457732200623, -0.08645366877317429, 0.43389177322387695, 0.21443887054920197, 0.10585364699363708, -0.3502050042152405, 0.062033288180828094, -0.21492332220077515, 0.06103048846125603, -0.11104215681552887, -0.10882975906133652, -0.00005313009023666382, -0.21620678901672363, 0.09574900567531586, 0.10841638594865799, -0.4783139228820801, -0.03432353585958481, 0.4633713662624359, 0.03745969012379646, 0.17537155747413635, 0.15751037001609802, -0.07424554973840714, -0.11983450502157211, 0.3350464105606079, -0.4980573356151581, 0.27639997005462646, 0.0550401546061039, -0.24613776803016663, 0.021514318883419037, -0.3092532753944397, -0.15654756128787994, 0.15100863575935364, 0.07800894230604172, -0.1416260302066803, -0.10193482786417007, 0.32067129015922546, 0.18163849413394928, -0.023980893194675446, -0.050935544073581696, -0.27238035202026367, -0.38606926798820496, -0.29281604290008545, 0.3306247591972351, -0.36082300543785095, 0.12785914540290833, -0.3949807584285736, -0.11405771225690842, -0.23916828632354736, 0.14006583392620087, 0.041235484182834625, 0.004226315766572952, 0.02406017854809761, 0.06836099922657013, -0.025851331651210785, 0.22685526311397552, 0.1481008380651474, -0.359613835811615, -0.33225366473197937, 0.06392742693424225, -0.2592221796512604, -0.16020166873931885, -0.2605575919151306, -0.08930888026952744, 0.32586991786956787, -0.21413163840770721, -0.11706545203924179, -0.35510867834091187, -0.4443398714065552, 0.11974751204252243, 0.030218996107578278, -0.33256638050079346, 0.29506492614746094, -0.04355055093765259, -0.08217222988605499, -0.08997614681720734, 0.17763520777225494, -0.08321995288133621, 0.01929275132715702, 0.34127485752105713, -0.23099549114704132, 0.0975051298737526, -0.15294352173805237, -0.06819232553243637, -0.16623884439468384, -0.08105103671550751, -0.17251069843769073, -0.11586853861808777, 0.1621134877204895, 0.33030837774276733, 0.18105168640613556, -0.0541834682226181, -0.13784047961235046, 0.31994208693504333, -0.16689540445804596, -0.06359075009822845, 0.28470736742019653, -0.03918388485908508, -0.5616064667701721, -0.22142988443374634, -0.12095286697149277, -0.18977251648902893, 0.8006651997566223, -0.29291829466819763, -0.3111400902271271, -0.06439217180013657, 0.2778780460357666, 0.16686126589775085, 0.054631054401397705, 0.25397324562072754, 0.05495860427618027, 0.17343004047870636, -0.14408323168754578, 0.04237247630953789, -0.032956816256046295, 0.05574793741106987, 0.37397462129592896, 0.22484174370765686, 0.09722506254911423, 0.20964935421943665, 0.6380025148391724, -0.2775879502296448, -0.5583105087280273, 0.15781812369823456, -0.18472439050674438, 0.4990704357624054, -0.3254701793193817, -0.3473576307296753, 0.5516461133956909, 0.043929100036621094, 0.1822337806224823, 0.05041788890957832, -0.15781119465827942, -0.11217508465051651, -0.023860860615968704, 0.26200053095817566, 0.1097143217921257, -0.036495938897132874, 0.39166712760925293, 0.08535654842853546, 0.40706464648246765, -0.19798898696899414, 0.2542871832847595, -0.03663558512926102, -0.2744835317134857, 0.2143254429101944, 0.2827528417110443, 0.15092414617538452, 0.20516431331634521, -0.21451561152935028, -0.06915502995252609, -0.09070675820112228, 0.28009843826293945, 0.35959750413894653, 0.5680971145629883, -0.02918485552072525, -0.17652535438537598, 0.037929240614175797, 0.24404627084732056, 0.5639088749885559, 0.21215040981769562, -0.22715671360492706, 0.07069815695285797, -0.30285102128982544, -0.6666884422302246, -0.2277648150920868, -0.06626468896865845, 0.1587650030851364, 0.18728706240653992, 0.3882817327976227, -0.17216993868350983, -0.24669203162193298, 0.13610514998435974, 0.3873746693134308, -0.09836415201425552, 0.033234838396310806, -0.26744312047958374, -0.329473078250885, -0.1530606597661972, -0.2621520161628723, 0.2369786947965622, 0.06419587135314941, -0.024663852527737617, -0.13480235636234283, -0.3145950138568878, -0.04843343049287796, -0.036861300468444824, -0.3316010534763336, 0.23902815580368042, -0.07012394815683365, -0.0456538088619709, 0.03432841971516609, 0.6551954746246338, 0.22160907089710236, -0.12226057052612305, -0.0680914968252182, -0.06335699558258057, 0.08822854608297348, -0.014139244332909584, 0.05344376713037491, 0.3829915523529053, 0.08636175096035004, -0.02390120178461075, -0.24259746074676514, 0.06881523877382278, -0.2241784781217575, 0.2275870144367218, 0.3762233853340149, -0.050816554576158524, -0.28271862864494324, -0.4099191129207611, 0.1761593520641327, 0.13689285516738892, 0.21648858487606049, 0.41834819316864014, -0.2602977156639099, -0.1387844681739807, 0.3867277503013611, 0.4832380414009094, 1.0365760326385498, 0.10107918083667755, 0.6233852505683899, 0.32871368527412415, -0.339086651802063, 0.06670138239860535, 0.2287319451570511, 0.17393875122070312, -0.3375322222709656, -0.06459223479032516, -0.185876727104187, -0.32138487696647644, 0.04701661318540573, -0.05680735409259796, -0.08840471506118774, 0.10200908035039902, -0.25385308265686035, 0.5259422063827515, 0.05628862977027893, -0.19379906356334686, -0.20686107873916626, -0.166653573513031, 0.336563378572464, -0.0330096036195755, -0.2621456980705261, 0.103057861328125, -0.11918696016073227, 0.06542596220970154, -0.22339600324630737, -0.28086942434310913, -0.0367993488907814, -0.10668542981147766, -0.14606286585330963, 0.09684514254331589, 0.020505698397755623, -0.8752910494804382, 0.11847014725208282, 0.27698683738708496, 0.009897641837596893, -0.0434863306581974, 0.09628178924322128, 0.13988293707370758, 0.20807552337646484, 0.2066715806722641, 0.09373791515827179, -0.08137576282024384, 0.3010573387145996, 0.01738365739583969, 0.04555792361497879, 0.010355819016695023, 0.0408627949655056, -0.12441803514957428, -0.22506463527679443, 0.22297419607639313, 0.21795980632305145, -0.14778271317481995, -0.4731031358242035, -0.16795912384986877, 0.058404821902513504, -0.08746586740016937, 0.011507894843816757, 0.024869009852409363, 0.23166535794734955, 0.26113516092300415, 0.014305688440799713, -0.36607372760772705, -0.13490505516529083, 0.2946898639202118, 0.03818183019757271, -0.25119954347610474, 0.2504042387008667, 0.10322371125221252, -0.3438537120819092, 0.02885831892490387, 0.1162954792380333, 0.1585012674331665, -0.7036460041999817, 0.10603015869855881, -0.18076027929782867, -0.13811014592647552, -0.5269428491592407, 0.24299024045467377, 0.04336903244256973, -0.09447372704744339, -0.23638902604579926, 0.07761090993881226, -0.2440427839756012, -0.03752434253692627, 0.07758523523807526, 0.38028064370155334, 0.23563078045845032, 0.1833842545747757, -0.034979600459337234, -0.21439605951309204, -0.1587730199098587, -0.03602670133113861, 0.4682008922100067, 0.310552179813385, -0.2551042139530182, 0.03428202122449875, -0.017217334359884262, -0.1369195133447647, -0.0380881205201149, 0.1672459989786148, 0.06286315619945526, -0.00988033041357994, -0.28126949071884155, 0.21683824062347412, 0.03290177136659622, -0.2505791187286377, -0.04190068691968918, -0.2738313674926758, -0.19653764367103577, -0.20808091759681702, 0.2395291030406952, 0.5474368929862976, -0.1019117534160614, 0.1273803412914276, -0.05323195084929466, -0.12749308347702026, 0.06599745899438858, -0.044085703790187836, 0.01424386352300644, 0.2626696228981018, 0.0995318591594696, 0.09652643650770187, -0.16784347593784332, -0.07231245934963226, -0.0006829916383139789, 0.21256279945373535, -0.002560138702392578, 0.12358008325099945, 0.23175513744354248, -0.1140928864479065, 0.21743625402450562, -0.057642605155706406, 0.3031236231327057, -0.15882466733455658, -0.2846476435661316, -0.23700831830501556, 0.3243093490600586, 0.00045897625386714935, -0.10728289186954498, -0.08825824409723282, -0.16928832232952118, 0.21680928766727448, -0.059445902705192566, 0.17688630521297455, 0.01422184333205223, 0.006452478468418121, -0.1977759152650833, -0.00799467135220766, 0.3304366171360016, -0.3492245674133301, 0.04956066235899925, 0.49989792704582214, 0.033572349697351456, 0.3445989489555359, 0.5150763988494873, 0.02077287808060646, -0.009218789637088776, -0.015059337019920349, 0.5101564526557922, 0.5864273905754089, 0.4672551453113556, -0.062228452414274216, 0.19722382724285126, 0.08504056930541992, -0.37639501690864563, -0.24660518765449524, 0.14237189292907715, 0.40648114681243896, 0.10611948370933533, 0.26806631684303284, -0.3768776059150696, -0.36126208305358887, 0.249855637550354, -0.10503046214580536, -0.09525515884160995, 0.31196916103363037, -0.17028649151325226, 0.17913177609443665, 0.1958737075328827, -0.11304019391536713, -0.20913615822792053, 0.050799958407878876, 0.25749650597572327, 0.28472739458084106, -0.14485286176204681, -0.008682407438755035, 0.04334777593612671, -0.11927317827939987, 0.20592831075191498, -0.05271310731768608, -0.05703921616077423, 0.14316537976264954, 0.06901638954877853, 0.1849110871553421, 0.45237666368484497, 0.32613933086395264, 0.37830352783203125, 0.0325150266289711, -0.11395309865474701, -0.0305100716650486, -0.08097454160451889, 0.053771622478961945, 0.16482079029083252, 0.22048255801200867, -0.20546288788318634, 0.21107922494411469, 0.029326369985938072, -0.04084671288728714, 0.013977404683828354, 0.013927295804023743, -0.09402930736541748, -0.19094468653202057, 0.5248362421989441, -0.40578222274780273, -0.41948673129081726, 0.08774687349796295, -0.08062263578176498, -0.30170392990112305, 0.17252513766288757, 0.6442065834999084, 0.11883174628019333, 0.13806885480880737, 0.08997040241956711, -0.027011942118406296, 0.26111358404159546, 0.21496644616127014, -0.043543290346860886, 0.31924623250961304, 0.09130281209945679, 0.07514524459838867, 0.028514020144939423, 0.24335238337516785, -0.050089213997125626, 0.0775744691491127, 0.0012905257754027843, -0.10590602457523346, 0.19901791214942932, -0.19064068794250488, 0.377613365650177, -0.12728384137153625, 0.36182671785354614, 0.22930678725242615, -0.04560133442282677, 0.09536398947238922, -0.06477846205234528, 0.2318580448627472, -0.05251180753111839, -0.4347286522388458, 0.11056241393089294, 0.2584395110607147, 0.0501316636800766, -0.4859597086906433, 0.0033584237098693848, 0.024766653776168823, -0.08851677179336548, 0.16824403405189514, -0.011631166562438011, 0.3206890821456909, -0.19020971655845642, 0.07948321104049683, -0.10675612092018127, 0.026696225628256798, -0.06073388084769249, 0.05816749855875969, -0.12537312507629395, 0.30591338872909546, 0.031214827671647072, -0.462109237909317, -0.3257361352443695, 0.7052779197692871, 0.11610037088394165, -0.10196609050035477, 0.0030082091689109802, 0.45599377155303955, -0.5862374305725098, -0.2903466522693634, 0.12050369381904602, 0.48221355676651, 0.08460178971290588, -0.19763290882110596, -0.3135654926300049, -0.43803268671035767, 0.47831565141677856, -0.3213149905204773, -0.2597074508666992, 0.017956841737031937, 0.02897893637418747, -0.0324653685092926, 0.39024555683135986, -0.22255313396453857, -0.26236993074417114, 0.09655462205410004, -0.02796078473329544, -0.10685274004936218, -0.0376657098531723, 0.26673758029937744, -0.028888091444969177, -0.05325589329004288, 0.5899927616119385, 0.07112270593643188, -0.32016098499298096, -0.15641601383686066, -0.278266966342926 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
We can define something like `.with_format("torch", image_data_format="channels_first")` and recommend using this in the docs maybe ? also cc @NielsRogge
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
19
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 We can define something like `.with_format("torch", image_data_format="channels_first")` and recommend using this in the docs maybe ? also cc @NielsRogge
[ -0.005527760833501816, -0.8179534077644348, 0.10662205517292023, 0.2007114142179489, 0.089569091796875, -0.031037520617246628, 0.7662638425827026, 0.28172019124031067, -0.17129702866077423, 0.07466153800487518, -0.07177087664604187, 0.16285964846611023, -0.2619469165802002, -0.40270692110061646, -0.040831390768289566, -0.4318128526210785, 0.09390588849782944, -0.07308125495910645, -0.15670230984687805, -0.09224063158035278, -0.14727385342121124, -0.014509642496705055, -0.1371426284313202, -0.0019404441118240356, -0.832605242729187, 0.1566179245710373, -0.1512906551361084, -0.07759537547826767, 0.07701417803764343, -0.015391835942864418, 0.18870952725410461, -0.251713365316391, 0.1579030454158783, 0.5608179569244385, -0.00012798751413356513, -0.03490358591079712, 0.30099278688430786, -0.08762063086032867, 0.047771256417036057, -0.03181460499763489, 0.45921358466148376, -0.2263646274805069, -0.08830727636814117, -0.36013883352279663, -0.11734701693058014, -0.028774850070476532, 0.05748933553695679, -0.10752753913402557, -0.11737482249736786, 0.3270609974861145, 0.08235815167427063, 0.3536921441555023, -0.1040884256362915, 0.1739981472492218, 0.30903345346450806, 0.3869946599006653, -0.20460325479507446, 0.3084242343902588, 0.09212396293878555, 0.2543469965457916, 0.11356960237026215, 0.35306400060653687, -0.4955405294895172, 0.021482937037944794, 0.3091077208518982, 0.05021754279732704, -0.5266692042350769, -0.14524990320205688, 0.004924200475215912, 0.118055559694767, 0.246008038520813, -0.364862322807312, -0.0652710348367691, -0.132335364818573, -0.25867223739624023, -0.08481967449188232, 0.06652947515249252, 0.5840634107589722, 0.20840436220169067, -0.04520491883158684, -0.4039655327796936, 0.36174869537353516, -0.20049667358398438, 0.2623286843299866, -0.23049688339233398, 0.04516877233982086, 0.022341230884194374, 0.3385962247848511, -0.31413358449935913, 0.3130130171775818, 0.3089120090007782, -0.23239317536354065, 0.2955927848815918, -0.11720708012580872, 0.1577039510011673, 0.058912456035614014, -0.31840988993644714, -0.2725435197353363, -0.2879520058631897, -0.23370106518268585, 0.19417807459831238, 0.06943173706531525, 0.06042872741818428, 0.09005874395370483, 0.019915563985705376, 0.13672330975532532, -0.11034028977155685, 0.13653883337974548, -0.07099123299121857, -0.3683355748653412, 0.4055336117744446, -0.07522737979888916, 0.19175972044467926, -0.31271570920944214, 0.07086245715618134, -0.0887322649359703, 0.2055160403251648, 0.10366824269294739, -0.05521965026855469, -0.427094429731369, -0.28607165813446045, 0.025698630139231682, -0.0044394927099347115, 0.24383097887039185, -0.19520971179008484, 0.32537248730659485, 0.4742605686187744, 0.20493915677070618, -0.025575552135705948, 0.31735649704933167, -0.11112731695175171, -0.02791503071784973, -0.16532295942306519, -0.2779000699520111, -0.13223722577095032, -0.37249869108200073, 0.13785365223884583, 0.26026928424835205, 0.47116225957870483, 0.260884165763855, -0.007055255584418774, -0.013998661190271378, 0.699903666973114, 0.04305451735854149, -0.33852413296699524, 0.10829515010118484, 0.1013278067111969, 0.5691821575164795, -0.17385417222976685, 0.3166349530220032, -0.6141376495361328, -0.16097621619701385, -0.2621663510799408, 0.03352566063404083, 0.006211414933204651, 0.19397655129432678, 0.32196322083473206, -0.23954670131206512, 0.32297563552856445, -0.28806498646736145, 0.3928588330745697, -0.5314382314682007, -0.08783730864524841, -0.29560747742652893, 0.023085525259375572, -0.07980883121490479, -0.08137877285480499, -0.033300235867500305, 0.5289257168769836, 0.26618626713752747, 0.5662158727645874, 0.2168615609407425, -0.10912306606769562, -0.07967794686555862, -0.3054763674736023, -0.16873815655708313, 0.12176167964935303, -0.36569249629974365, -0.19081220030784607, -0.21320445835590363, 0.015606850385665894, 0.04207400232553482, 0.12168841809034348, 0.34191691875457764, 0.11852061748504639, -0.14082840085029602, -0.010985508561134338, 0.32607537508010864, 0.013498017564415932, 0.26706352829933167, -0.27628499269485474, -0.02348274737596512, 0.5266159176826477, 0.08202645182609558, -0.11384156346321106, 0.014814741909503937, -0.020759448409080505, 0.26290857791900635, 0.08924413472414017, -0.16722624003887177, -0.14510367810726166, -0.21212667226791382, -0.08616776764392853, -0.06265003979206085, 0.15788409113883972, 0.03480621427297592, -0.2274760901927948, 0.07135452330112457, 0.050415247678756714, 0.1423371583223343, 0.1341739147901535, -0.12941205501556396, 0.078366719186306, -0.22565600275993347, -0.07908599078655243, -0.1482200026512146, -0.07075564563274384, 0.010059535503387451, -0.04845238849520683, -0.22269651293754578, -0.03627998009324074, 0.23989661037921906, -0.14846079051494598, -0.033821284770965576, -0.08167688548564911, 0.20847344398498535, -0.15822429955005646, -0.12020745873451233, -0.3388374149799347, 0.18627570569515228, 0.13780274987220764, -0.12507733702659607, -0.05535777658224106, 0.3672599792480469, -0.04318021982908249, -0.11177396774291992, -0.8237510323524475, -0.04808180034160614, 0.4151628315448761, -0.2968374788761139, 0.1987442672252655, 0.4377938210964203, 0.13267014920711517, -0.16658446192741394, -0.08167269080877304, 0.40965110063552856, 0.20798581838607788, 0.0665036290884018, -0.37873131036758423, 0.015695204958319664, -0.23995168507099152, 0.0886477530002594, -0.12215597182512283, -0.11174268275499344, 0.008820924907922745, -0.1969585418701172, 0.06478209793567657, 0.11976655572652817, -0.4755431115627289, -0.08682320266962051, 0.4618164896965027, -0.010396510362625122, 0.15830110013484955, 0.13652043044567108, -0.11475444585084915, -0.14111758768558502, 0.32715803384780884, -0.44916966557502747, 0.22721198201179504, 0.05398977920413017, -0.34393632411956787, 0.011674188077449799, -0.30025187134742737, -0.1444701850414276, 0.2191004753112793, 0.12957164645195007, -0.09641649574041367, -0.1316118836402893, 0.3442875146865845, 0.15829919278621674, -0.00701078400015831, -0.02047484926879406, -0.25521525740623474, -0.32989299297332764, -0.25194182991981506, 0.25312110781669617, -0.3076859414577484, 0.13171949982643127, -0.3746907114982605, -0.10426416248083115, -0.19861416518688202, 0.19987422227859497, 0.09939488768577576, 0.0222978163510561, 0.034633178263902664, 0.07738815993070602, 0.0036500338464975357, 0.22619569301605225, 0.1767270416021347, -0.3337280750274658, -0.3387649953365326, 0.09283152222633362, -0.18228113651275635, -0.143238365650177, -0.2718205153942108, -0.1599898785352707, 0.3172715902328491, -0.23152941465377808, -0.1160709336400032, -0.30987194180488586, -0.3933422565460205, 0.11668004095554352, 0.001447383314371109, -0.33944860100746155, 0.2088027149438858, -0.024981200695037842, -0.07721570134162903, -0.09686476737260818, 0.15376333892345428, -0.09329437464475632, 0.015611710026860237, 0.3588998019695282, -0.17910656332969666, 0.07282698154449463, -0.1705402284860611, -0.12511146068572998, -0.15362291038036346, -0.08454882353544235, -0.15136997401714325, -0.04610119387507439, 0.17652273178100586, 0.3226664662361145, 0.2578299343585968, -0.04861732944846153, -0.1940283477306366, 0.3372113108634949, -0.11924709379673004, -0.0719376653432846, 0.3461254835128784, -0.03942502290010452, -0.5169057846069336, -0.21002112329006195, -0.12346012890338898, -0.22109976410865784, 0.7217265963554382, -0.2210896760225296, -0.32382020354270935, -0.0826941505074501, 0.2084140181541443, 0.1682710498571396, 0.05858109891414642, 0.30185607075691223, 0.07871249318122864, 0.17478224635124207, -0.10983191430568695, 0.025601599365472794, -0.11721708625555038, 0.10490141063928604, 0.40863069891929626, 0.26105013489723206, 0.10004114359617233, 0.21395903825759888, 0.6456466913223267, -0.28871950507164, -0.5793659687042236, 0.1307937502861023, -0.22402766346931458, 0.46200066804885864, -0.29927438497543335, -0.34024736285209656, 0.5879173874855042, 0.03664831072092056, 0.13179272413253784, 0.014539815485477448, -0.12663167715072632, -0.11788658052682877, -0.04619331285357475, 0.23974508047103882, 0.022369183599948883, 0.006349977105855942, 0.3657686412334442, 0.15285569429397583, 0.40448564291000366, -0.26763972640037537, 0.20186927914619446, 0.02154141291975975, -0.29021981358528137, 0.1692989319562912, 0.24465636909008026, 0.23768562078475952, 0.20129086077213287, -0.29750311374664307, -0.14503344893455505, -0.07167636603116989, 0.23332324624061584, 0.35068801045417786, 0.5275734066963196, 0.01392657682299614, -0.17439976334571838, 0.0300457626581192, 0.2482718676328659, 0.5786209106445312, 0.22328601777553558, -0.23525698482990265, 0.04332314804196358, -0.280051052570343, -0.6446045637130737, -0.2555515766143799, -0.06184661388397217, 0.13437972962856293, 0.1467820703983307, 0.3799044191837311, -0.12457170337438583, -0.22298921644687653, 0.1371367871761322, 0.4306384325027466, -0.112082839012146, 0.0415940098464489, -0.26073840260505676, -0.32346001267433167, -0.20707912743091583, -0.2340734302997589, 0.24799473583698273, 0.10152992606163025, -0.01179021317511797, -0.1312883496284485, -0.2388170212507248, -0.08116309344768524, -0.0908592939376831, -0.29536280035972595, 0.3022242784500122, -0.05798470228910446, 0.028577659279108047, 0.05714759603142738, 0.5977942943572998, 0.1659361720085144, -0.1385578066110611, -0.022615782916545868, -0.06900806725025177, 0.05192958563566208, 0.07661227881908417, 0.09387693554162979, 0.3474593162536621, 0.0542670413851738, -0.034707844257354736, -0.2476855218410492, 0.11952197551727295, -0.18532584607601166, 0.25178849697113037, 0.4186874330043793, -0.08968830108642578, -0.2668871283531189, -0.39084985852241516, 0.1723688542842865, 0.14998142421245575, 0.2005041390657425, 0.37316757440567017, -0.3895533084869385, -0.1547427624464035, 0.3878403306007385, 0.47254452109336853, 1.0841971635818481, 0.12849906086921692, 0.5865375399589539, 0.30338823795318604, -0.2550048232078552, 0.09965654462575912, 0.23149733245372772, 0.24185119569301605, -0.3199053406715393, -0.09572757035493851, -0.16917763650417328, -0.31832945346832275, -0.017440393567085266, -0.06010714918375015, -0.15796644985675812, 0.11408460140228271, -0.26818859577178955, 0.4640137255191803, 0.017498206347227097, -0.1747533231973648, -0.15999644994735718, -0.17893479764461517, 0.36487460136413574, -0.03607404977083206, -0.20966659486293793, 0.09459351003170013, -0.11271446198225021, 0.0767739787697792, -0.1786380261182785, -0.3277992010116577, -0.028197340667247772, -0.0930592268705368, -0.2384571135044098, 0.014122329652309418, 0.03826707601547241, -0.8399701714515686, 0.10065867006778717, 0.3566131293773651, -0.07592448592185974, 0.005002513527870178, 0.08155709505081177, 0.1777561604976654, 0.24706944823265076, 0.17546378076076508, 0.09033066779375076, -0.048328448086977005, 0.2850181460380554, -0.04536600410938263, 0.058873213827610016, 0.006491169333457947, 0.04281250759959221, -0.08989118784666061, -0.2514963150024414, 0.21430662274360657, 0.24402424693107605, -0.09694243967533112, -0.5530561804771423, -0.13003991544246674, -0.0016514770686626434, -0.1010342687368393, 0.04338335990905762, 0.03909256309270859, 0.1608370989561081, 0.28310880064964294, -0.008460327982902527, -0.32072731852531433, -0.11868783831596375, 0.2950376272201538, 0.035952795296907425, -0.22279906272888184, 0.2323889285326004, 0.09757038950920105, -0.29956406354904175, 0.023755982518196106, 0.14374640583992004, 0.06567647308111191, -0.7261056900024414, 0.12480737268924713, -0.08856003731489182, -0.12843772768974304, -0.5298304557800293, 0.2277846485376358, 0.038459911942481995, -0.07436566799879074, -0.24029438197612762, 0.1438920497894287, -0.279991090297699, -0.02394775301218033, 0.10087793320417404, 0.4295836389064789, 0.217880517244339, 0.16474783420562744, -0.017625870183110237, -0.2089148461818695, -0.17388802766799927, -0.036700502038002014, 0.4514476954936981, 0.33025866746902466, -0.21167489886283875, 0.05540783703327179, 0.007507785223424435, -0.13682419061660767, -0.011558186262845993, 0.23010079562664032, 0.09053779393434525, -0.030865266919136047, -0.25036904215812683, 0.2043912559747696, 0.04192902892827988, -0.27301257848739624, -0.06322633475065231, -0.24009005725383759, -0.1656147986650467, -0.16569684445858002, 0.1667812317609787, 0.5354735851287842, -0.0911637395620346, 0.14257705211639404, -0.1014123260974884, -0.1756928563117981, 0.06835301965475082, -0.07920176535844803, -0.06692180037498474, 0.2520211338996887, 0.13008490204811096, 0.10424362123012543, -0.14071176946163177, -0.0968635231256485, -0.037659816443920135, 0.17701829969882965, -0.09792424738407135, 0.16980475187301636, 0.26451581716537476, -0.06396876275539398, 0.2026107758283615, -0.0890166163444519, 0.282529354095459, -0.21117240190505981, -0.31400954723358154, -0.19335615634918213, 0.38935586810112, 0.02362249046564102, -0.15910392999649048, -0.1393750011920929, -0.22903123497962952, 0.20476780831813812, -0.020874973386526108, 0.1771865338087082, -0.09417429566383362, 0.008126996457576752, -0.2529836893081665, 0.04930974543094635, 0.36740657687187195, -0.3553454279899597, 0.034136757254600525, 0.44302788376808167, 0.038587216287851334, 0.3007696270942688, 0.5083221197128296, 0.0045124851167202, 0.00461336225271225, -0.05744095891714096, 0.4556784927845001, 0.5430783033370972, 0.4785661995410919, -0.08602471649646759, 0.24144986271858215, 0.16402292251586914, -0.4155176877975464, -0.18967479467391968, 0.09773948788642883, 0.41441723704338074, 0.06843700259923935, 0.28505924344062805, -0.35100769996643066, -0.35347095131874084, 0.2826416492462158, -0.06695190072059631, -0.030940309166908264, 0.3401484489440918, -0.20225456357002258, 0.18963658809661865, 0.16282406449317932, -0.12150436639785767, -0.17215986549854279, 0.00261518731713295, 0.23820796608924866, 0.29172542691230774, -0.16623790562152863, 0.11046964675188065, 0.01400098018348217, -0.08685741573572159, 0.2851560711860657, -0.08016827702522278, 0.017853403463959694, 0.14627310633659363, 0.07056456804275513, 0.18600064516067505, 0.46174195408821106, 0.3898419439792633, 0.40436485409736633, 0.020212024450302124, 0.004458479583263397, 0.013961004093289375, -0.08251214772462845, 0.11398988962173462, 0.19496116042137146, 0.20058730244636536, -0.21063828468322754, 0.15279941260814667, 0.052716173231601715, -0.07929130643606186, 0.0518176406621933, 0.032046083360910416, -0.08214883506298065, -0.18083560466766357, 0.48834097385406494, -0.40002307295799255, -0.43611010909080505, 0.04304848238825798, -0.0687718614935875, -0.31701216101646423, 0.1338787078857422, 0.6532064080238342, 0.11341842263936996, 0.12214229255914688, 0.09775973111391068, -0.01969544030725956, 0.2522939443588257, 0.16897596418857574, -0.06373186409473419, 0.3289792239665985, 0.06133328005671501, 0.08928319811820984, 0.0594610720872879, 0.16972050070762634, -0.009922213852405548, 0.08831339329481125, 0.005799612030386925, -0.1541975438594818, 0.12378177046775818, -0.12907108664512634, 0.38263851404190063, -0.09864237159490585, 0.29027605056762695, 0.2863517999649048, -0.005269546061754227, 0.1444586217403412, -0.053382910788059235, 0.2815304398536682, -0.026249583810567856, -0.43223634362220764, 0.1208098903298378, 0.16073378920555115, 0.07060854136943817, -0.43424487113952637, 0.012040600180625916, -0.008530562743544579, -0.06617850065231323, 0.21955013275146484, 0.002248108386993408, 0.2893926501274109, -0.24047526717185974, 0.12630507349967957, -0.0776071846485138, 0.026397189125418663, -0.07244507223367691, -0.05238630622625351, -0.05627411976456642, 0.3287687301635742, 0.050518907606601715, -0.4382220208644867, -0.37065449357032776, 0.715387225151062, 0.10724660754203796, -0.1878698319196701, 0.01918095164000988, 0.4210624098777771, -0.5695746541023254, -0.2915216386318207, 0.09412173181772232, 0.42522966861724854, 0.04805169627070427, -0.24920320510864258, -0.34577345848083496, -0.49763980507850647, 0.5387238264083862, -0.3698514699935913, -0.22203125059604645, 0.06648769229650497, 0.06290437281131744, 0.015492402017116547, 0.40046510100364685, -0.1592288315296173, -0.28730663657188416, 0.0811481773853302, -0.011991932988166809, -0.16146472096443176, -0.020034313201904297, 0.2479379028081894, -0.04144733399152756, -0.006681937724351883, 0.5518925786018372, 0.08293601870536804, -0.2963477373123169, -0.12901298701763153, -0.29626643657684326 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
Sounds good to me. I guess it's not allowed to use the channels first format by default for backwards compatibility purposes?
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
21
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 Sounds good to me. I guess it's not allowed to use the channels first format by default for backwards compatibility purposes?
[ -0.0015842914581298828, -0.8372874855995178, 0.12175257503986359, 0.12647145986557007, 0.10686703026294708, 0.0056000202894210815, 0.8336380124092102, 0.25820162892341614, -0.2750168740749359, 0.11379469931125641, -0.09049117565155029, 0.15729452669620514, -0.22999632358551025, -0.4061449468135834, -0.11085295677185059, -0.37672919034957886, 0.06495940685272217, 0.03249809890985489, -0.13832716643810272, -0.11702731251716614, -0.10988453030586243, -0.027874404564499855, -0.12540629506111145, -0.015501298010349274, -0.8294697403907776, 0.24350157380104065, -0.11894247680902481, -0.0531773716211319, -0.030732600018382072, -0.028055837377905846, 0.1988518089056015, -0.2441491186618805, 0.2007342129945755, 0.4874526560306549, -0.0001307342026848346, -0.017598740756511688, 0.31006884574890137, -0.09886107593774796, 0.07295066118240356, -0.029485374689102173, 0.4241330623626709, -0.19887501001358032, -0.08607102185487747, -0.40304046869277954, -0.11865215003490448, -0.03396707400679588, 0.05258343368768692, -0.10574644804000854, -0.05551649630069733, 0.29193368554115295, 0.06600496917963028, 0.39311376214027405, -0.1571570634841919, 0.14659501612186432, 0.31114792823791504, 0.32293272018432617, -0.18622919917106628, 0.37035223841667175, 0.050830114632844925, 0.2469644546508789, 0.10368217527866364, 0.372951865196228, -0.46004047989845276, 0.04164620488882065, 0.25771135091781616, 0.0380672849714756, -0.44937950372695923, -0.16960319876670837, 0.05896696820855141, 0.12470114231109619, 0.30867624282836914, -0.3842882812023163, -0.06460615247488022, -0.148246169090271, -0.29495564103126526, -0.14733316004276276, 0.03488615155220032, 0.5674111247062683, 0.22081516683101654, 0.014458460733294487, -0.3069612979888916, 0.3453257381916046, -0.18791571259498596, 0.241020068526268, -0.2707829475402832, 0.12514759600162506, 0.04754176363348961, 0.3305278718471527, -0.2811310589313507, 0.3675435185432434, 0.40769660472869873, -0.1817319691181183, 0.2518281936645508, -0.15388256311416626, 0.17442335188388824, 0.04422169178724289, -0.24465590715408325, -0.2657727897167206, -0.3494919538497925, -0.20403733849525452, 0.03625398501753807, 0.02546362765133381, 0.05529997870326042, 0.06090840324759483, 0.03731842711567879, 0.0948965847492218, -0.10788915306329727, 0.2394501268863678, -0.11924375593662262, -0.35468050837516785, 0.3909832537174225, -0.0738544836640358, 0.25226059556007385, -0.2662414312362671, 0.07803168892860413, -0.14334902167320251, 0.20730814337730408, 0.09690247476100922, -0.059402912855148315, -0.4627770483493805, -0.28504177927970886, 0.009784815832972527, -0.02494000643491745, 0.24056151509284973, -0.11972272396087646, 0.3687865734100342, 0.3971219062805176, 0.2369726151227951, -0.009013872593641281, 0.34305745363235474, -0.08280149847269058, -0.023469775915145874, -0.16054508090019226, -0.4113798439502716, -0.1448352187871933, -0.4399965703487396, 0.16539917886257172, 0.23017911612987518, 0.4759843349456787, 0.31300172209739685, 0.0057173240929841995, 0.014195101335644722, 0.7236068844795227, 0.10474152863025665, -0.3739987015724182, 0.18355625867843628, 0.09026272594928741, 0.5722097158432007, -0.17276209592819214, 0.3032311797142029, -0.5959365367889404, -0.2265060693025589, -0.22360898554325104, 0.010100598447024822, 0.07030268013477325, 0.22987109422683716, 0.3973170518875122, -0.23312564194202423, 0.22771042585372925, -0.35589170455932617, 0.35449671745300293, -0.5528175234794617, -0.14285288751125336, -0.29577478766441345, 0.007951050996780396, -0.05105213820934296, -0.1646638959646225, -0.04535699635744095, 0.5072275996208191, 0.24499990046024323, 0.582819402217865, 0.2098587602376938, -0.18527892231941223, -0.14118003845214844, -0.3248608112335205, -0.1865839660167694, 0.1591511070728302, -0.3590627610683441, -0.23978102207183838, -0.22131673991680145, -0.06759200990200043, 0.08692694455385208, 0.14557474851608276, 0.3757265508174896, 0.1600709855556488, -0.18462859094142914, 0.03458941727876663, 0.2631545066833496, 0.016507182270288467, 0.27470511198043823, -0.24438872933387756, -0.018152523785829544, 0.6101446151733398, 0.07130159437656403, -0.14089041948318481, 0.10995002090930939, -0.026380687952041626, 0.2636677920818329, 0.10022173076868057, -0.1752481907606125, -0.12432301789522171, -0.19207541644573212, -0.10954152047634125, -0.07156723737716675, 0.16515518724918365, 0.038224056363105774, -0.22976481914520264, 0.1114383116364479, 0.08976270258426666, 0.12713885307312012, 0.1815873682498932, -0.09153810143470764, 0.0792640820145607, -0.19358263909816742, -0.10013283789157867, -0.12771418690681458, -0.10330699384212494, 0.0997258722782135, -0.05005462095141411, -0.2105979472398758, -0.12122602760791779, 0.29122141003608704, -0.15837453305721283, -0.006893743760883808, -0.07580575346946716, 0.1950303316116333, -0.19784769415855408, -0.0458495132625103, -0.3244011700153351, 0.19291254878044128, 0.11324095726013184, -0.07920308411121368, -0.0706244632601738, 0.3382117748260498, -0.0157591812312603, -0.08284348249435425, -0.7960889935493469, -0.012559488415718079, 0.3727424144744873, -0.3418755829334259, 0.21653294563293457, 0.4586615562438965, 0.10509172827005386, -0.1793268620967865, -0.09092596918344498, 0.411220908164978, 0.2853991985321045, 0.02873164415359497, -0.38921546936035156, -0.010853343643248081, -0.2353881597518921, 0.1513720005750656, -0.22286555171012878, -0.1372813880443573, 0.035969074815511703, -0.18899454176425934, 0.0010411553084850311, 0.10996029525995255, -0.5230509042739868, -0.07189462333917618, 0.47043395042419434, -0.04009421169757843, 0.08295691013336182, 0.17310786247253418, -0.061789147555828094, -0.1454293578863144, 0.3293309807777405, -0.4115028977394104, 0.26415613293647766, 0.029294248670339584, -0.2522645890712738, 0.06142027676105499, -0.3901209235191345, -0.1938573569059372, 0.23408381640911102, 0.14302456378936768, -0.05851149186491966, -0.1261424720287323, 0.3889249265193939, 0.18076477944850922, -0.07737631350755692, -0.023664440959692, -0.29919832944869995, -0.35929223895072937, -0.25536322593688965, 0.22292079031467438, -0.3182756006717682, 0.08600615710020065, -0.35962823033332825, -0.1421375423669815, -0.1407732367515564, 0.2027389109134674, 0.09530297666788101, 0.022841695696115494, 0.03525562956929207, 0.081650011241436, -0.03889517858624458, 0.21673335134983063, 0.1664111167192459, -0.26094284653663635, -0.3934647738933563, 0.06562098115682602, -0.1143995001912117, -0.1731524020433426, -0.3634253144264221, -0.17913785576820374, 0.2852133512496948, -0.21068674325942993, -0.16236275434494019, -0.3109418749809265, -0.4092126190662384, 0.0830429196357727, 0.005432236939668655, -0.29271140694618225, 0.19267649948596954, 0.026139788329601288, -0.06923249363899231, -0.06619127094745636, 0.12566053867340088, -0.038059964776039124, 0.03338027000427246, 0.3483765125274658, -0.1897893249988556, 0.06729245185852051, -0.14468148350715637, -0.12478312104940414, -0.12614412605762482, -0.13313929736614227, -0.16165870428085327, -0.03715263679623604, 0.11599820852279663, 0.2859188914299011, 0.17404745519161224, -0.07672496885061264, -0.18652299046516418, 0.3673228621482849, -0.08556830137968063, -0.004984728991985321, 0.3588150143623352, -0.02017294615507126, -0.5089303851127625, -0.22355367243289948, -0.13424967229366302, -0.25689175724983215, 0.669097363948822, -0.21195447444915771, -0.271386981010437, -0.05567782372236252, 0.14432565867900848, 0.16455167531967163, 0.11333360522985458, 0.31517475843429565, 0.06109895929694176, 0.2286183089017868, -0.1101982444524765, 0.006202399730682373, -0.16751393675804138, 0.16267642378807068, 0.3139004111289978, 0.28494423627853394, 0.1796078383922577, 0.17934750020503998, 0.6198211312294006, -0.2598631978034973, -0.5442948937416077, 0.1675974726676941, -0.20255893468856812, 0.5168085694313049, -0.39734333753585815, -0.3377227485179901, 0.5412678122520447, 0.07822774350643158, 0.1504446566104889, 0.06338292360305786, -0.12597030401229858, -0.14778907597064972, -0.08229641616344452, 0.3586879372596741, -0.04473800212144852, 0.05935119464993477, 0.2994990646839142, 0.045785196125507355, 0.40078505873680115, -0.17317523062229156, 0.22697588801383972, 0.08797137439250946, -0.25563758611679077, 0.14307700097560883, 0.24262826144695282, 0.17709174752235413, 0.22115877270698547, -0.36145520210266113, -0.14465941488742828, -0.08142995089292526, 0.15433445572853088, 0.357400506734848, 0.4954652786254883, 0.06893514096736908, -0.18587681651115417, 0.02784624695777893, 0.21369226276874542, 0.5954882502555847, 0.18906202912330627, -0.15841981768608093, 0.06197138503193855, -0.19973930716514587, -0.6708665490150452, -0.27932417392730713, -0.08197996020317078, 0.08575364202260971, 0.10426382720470428, 0.3756161034107208, -0.11866414546966553, -0.16535606980323792, 0.1090330109000206, 0.41094061732292175, -0.03953932598233223, 0.0858365148305893, -0.29733872413635254, -0.29836544394493103, -0.21122650802135468, -0.2299354076385498, 0.24395667016506195, 0.09796203672885895, -0.1265229433774948, -0.08803772926330566, -0.18993449211120605, -0.0860503613948822, -0.1310882419347763, -0.2745371460914612, 0.31471487879753113, -0.02993161231279373, 0.005482826381921768, 0.11297568678855896, 0.6028479337692261, 0.08138910681009293, -0.1223519891500473, -0.006761249154806137, -0.11680491268634796, 0.09918011724948883, 0.13906621932983398, 0.08435282856225967, 0.43890970945358276, 0.07140437513589859, -0.03681928664445877, -0.2111915946006775, 0.059918634593486786, -0.12333201617002487, 0.1783088594675064, 0.5182955861091614, -0.15842589735984802, -0.2958551049232483, -0.40996024012565613, 0.17393937706947327, 0.033115047961473465, 0.1690147966146469, 0.44531649351119995, -0.34692907333374023, -0.08178455382585526, 0.38013172149658203, 0.36846357583999634, 1.1329293251037598, 0.1735234558582306, 0.6327656507492065, 0.3613129258155823, -0.33923614025115967, 0.10982430726289749, 0.2308262139558792, 0.2894470691680908, -0.31188806891441345, -0.06810669600963593, -0.1758529394865036, -0.35729795694351196, -0.03800240159034729, 0.014840386807918549, -0.1188778430223465, 0.07380416244268417, -0.24637262523174286, 0.537330687046051, 0.0663260668516159, -0.1932433694601059, -0.06503625214099884, -0.13841032981872559, 0.3044357895851135, -0.06869647651910782, -0.13566090166568756, 0.04225645214319229, -0.15675005316734314, 0.1382778435945511, -0.14638276398181915, -0.4112067222595215, 0.0031956061720848083, -0.061693619936704636, -0.2700495719909668, 0.09249575436115265, 0.09322165697813034, -0.754452109336853, 0.08990368247032166, 0.41271188855171204, -0.048217207193374634, -0.004898160696029663, 0.06533782929182053, 0.15604710578918457, 0.35207599401474, 0.18131068348884583, 0.14008773863315582, -0.048695825040340424, 0.29078131914138794, -0.07285980880260468, 0.062078870832920074, 0.04768814891576767, -0.020695384591817856, -0.17619290947914124, -0.30885252356529236, 0.26530736684799194, 0.21306884288787842, -0.04630478844046593, -0.5845956206321716, -0.07000292837619781, 0.03366033360362053, -0.11471159756183624, 0.01498599722981453, -0.00038917362689971924, 0.15437062084674835, 0.21761825680732727, -0.039201971143484116, -0.3423452079296112, -0.13440607488155365, 0.3263872563838959, 0.023848194628953934, -0.139708012342453, 0.18721617758274078, 0.08921045064926147, -0.31880754232406616, 0.05653880536556244, 0.11066151410341263, 0.010651351884007454, -0.6708700060844421, 0.10473154485225677, -0.04559884965419769, -0.13859839737415314, -0.5119589567184448, 0.23197968304157257, 0.017755242064595222, -0.0728413537144661, -0.25827595591545105, 0.13359059393405914, -0.21154296398162842, 0.009151458740234375, 0.07198832929134369, 0.4507564306259155, 0.24522000551223755, 0.1660195291042328, -0.008121793158352375, -0.22258557379245758, -0.1469641774892807, 0.023299822583794594, 0.4907054901123047, 0.38208192586898804, -0.18796783685684204, 0.0760873407125473, 0.03824837505817413, -0.08804772794246674, -0.018453387543559074, 0.25467121601104736, 0.012997864745557308, -0.016276881098747253, -0.2389613837003708, 0.22737041115760803, 0.05471085011959076, -0.2753124535083771, -0.09027199447154999, -0.2868298292160034, -0.209249809384346, -0.13505826890468597, 0.160077765583992, 0.5558837652206421, -0.08450339734554291, 0.11447650194168091, -0.049616213887929916, -0.18892842531204224, 0.11588385701179504, -0.056900881230831146, -0.09775136411190033, 0.21379294991493225, 0.10584033280611038, 0.09663490951061249, -0.15236058831214905, -0.08062144368886948, -0.13755789399147034, 0.2117803394794464, -0.08044646680355072, 0.1703694462776184, 0.20819056034088135, -0.08766146004199982, 0.2531833350658417, -0.12035218626260757, 0.3973851203918457, -0.18752005696296692, -0.31121891736984253, -0.23271909356117249, 0.3853524625301361, -0.0008358433842658997, -0.18410390615463257, -0.18482212722301483, -0.17640961706638336, 0.22048461437225342, -0.00008924305438995361, 0.15326771140098572, -0.049061525613069534, 0.06233164668083191, -0.2493446320295334, 0.03197271376848221, 0.24925397336483002, -0.4393361210823059, 0.04911549389362335, 0.4265151917934418, 0.07004590332508087, 0.3280395269393921, 0.45880040526390076, 0.0419602245092392, 0.024267613887786865, -0.012510232627391815, 0.5001211762428284, 0.521182119846344, 0.40971940755844116, -0.18091492354869843, 0.19328048825263977, 0.05713200941681862, -0.43441417813301086, -0.20785826444625854, 0.004191920161247253, 0.38006317615509033, 0.06960883736610413, 0.2863754630088806, -0.3228970468044281, -0.3177926242351532, 0.2057259976863861, -0.09797140955924988, -0.06514675170183182, 0.2665342688560486, -0.1285865604877472, 0.19390901923179626, 0.21266251802444458, -0.10691000521183014, -0.16697409749031067, 0.10506043583154678, 0.2790829539299011, 0.2748440206050873, -0.14433243870735168, 0.12900467216968536, 0.12000084668397903, -0.17427662014961243, 0.22938582301139832, -0.08126059174537659, 0.012073356658220291, 0.09444579482078552, 0.11617253720760345, 0.2124195247888565, 0.4014360010623932, 0.3887040913105011, 0.347442626953125, 0.06707393378019333, -0.014277397654950619, 0.008154754526913166, -0.15125125646591187, 0.0965019166469574, 0.19449758529663086, 0.2228579968214035, -0.18999291956424713, 0.2168702483177185, 0.04158888757228851, -0.0961097702383995, 0.07050947844982147, 0.06671436876058578, -0.05371697619557381, -0.2341974377632141, 0.4303780794143677, -0.4175596237182617, -0.4189165532588959, 0.08178834617137909, -0.052620746195316315, -0.316292941570282, 0.07918934524059296, 0.5842875242233276, 0.12293799966573715, 0.0878976359963417, 0.06971267610788345, -0.03397819399833679, 0.27605465054512024, 0.15476003289222717, 0.028236187994480133, 0.3160706162452698, 0.0642923042178154, 0.02088283747434616, 0.0032197460532188416, 0.15693284571170807, -0.05408772453665733, 0.15400531888008118, 0.009224947541952133, -0.1437685340642929, 0.12156658619642258, -0.14860279858112335, 0.362407386302948, -0.08261805772781372, 0.22309206426143646, 0.26928430795669556, 0.07171742618083954, 0.15770073235034943, 0.029377710074186325, 0.24368739128112793, -0.08643826842308044, -0.46574369072914124, 0.12190866470336914, 0.14437289535999298, 0.04438790678977966, -0.3421141505241394, 0.07978874444961548, 0.00032756850123405457, -0.08250822126865387, 0.2494446039199829, 0.001037532463669777, 0.31646305322647095, -0.23345905542373657, 0.07945507019758224, -0.10503295063972473, -0.009411964565515518, -0.04028359800577164, -0.10911839455366135, -0.0800749808549881, 0.43039214611053467, 0.013326846063137054, -0.43940672278404236, -0.34596970677375793, 0.6296170353889465, 0.10969749093055725, -0.16121459007263184, -0.018277136608958244, 0.45605403184890747, -0.6184322834014893, -0.20168350636959076, 0.05485635623335838, 0.3547329306602478, 0.08793308585882187, -0.21165546774864197, -0.3232765793800354, -0.5098931193351746, 0.5906755924224854, -0.34161463379859924, -0.2525595426559448, 0.014303906820714474, 0.018822520971298218, 0.08370400965213776, 0.42942771315574646, -0.14487704634666443, -0.24255794286727905, 0.08173364400863647, 0.022478876635432243, -0.20465707778930664, 0.028801633045077324, 0.21011994779109955, -0.04378650709986687, -0.034507229924201965, 0.5626518726348877, 0.08512964844703674, -0.316455215215683, -0.1393086165189743, -0.28113895654678345 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
This works, but am wondering how widespread the use of the function is for image datasets? My hunch would be that it's not used widely enough with image datasets to favour backwards compat (keeping default channels_last) over clumsiness of needing this to be 'correct' for typical use.. but don't have the data to back that up.
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
56
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 This works, but am wondering how widespread the use of the function is for image datasets? My hunch would be that it's not used widely enough with image datasets to favour backwards compat (keeping default channels_last) over clumsiness of needing this to be 'correct' for typical use.. but don't have the data to back that up.
[ -0.11516211926937103, -0.6742500066757202, 0.07550469040870667, 0.13351060450077057, 0.05325189232826233, -0.03168388456106186, 0.8220062851905823, 0.21712803840637207, -0.03994326665997505, -0.0042914822697639465, -0.006008129566907883, 0.1460382044315338, -0.25539156794548035, -0.3848693370819092, -0.10087752342224121, -0.4097083806991577, 0.08545348793268204, -0.14484813809394836, -0.21825233101844788, -0.02182433381676674, -0.21537186205387115, -0.023975377902388573, -0.22814416885375977, 0.03517979010939598, -0.7058343887329102, 0.12540553510189056, -0.09338062256574631, -0.09138340502977371, 0.20592711865901947, 0.08673130720853806, 0.15646474063396454, -0.21335777640342712, 0.0549192801117897, 0.5233092904090881, -0.0001313545653829351, -0.012367818504571915, 0.3760404586791992, -0.1149526834487915, -0.06491635739803314, -0.02661411464214325, 0.36345410346984863, -0.2379830777645111, -0.11243189126253128, -0.379184365272522, -0.04711204767227173, 0.03870820626616478, 0.17041775584220886, -0.19281688332557678, -0.045303866267204285, 0.2685956656932831, 0.06663796305656433, 0.31364700198173523, -0.06481285393238068, 0.174985870718956, 0.2528175115585327, 0.5276357531547546, -0.2271827757358551, 0.20942339301109314, 0.14220158755779266, 0.20319588482379913, 0.12360884249210358, 0.30855000019073486, -0.474276065826416, -0.03615377098321915, 0.3601830005645752, 0.016719093546271324, -0.6265774369239807, -0.12412086129188538, 0.06519068032503128, 0.09862019121646881, 0.3246898651123047, -0.3525557518005371, -0.1521773338317871, -0.204612135887146, -0.29853713512420654, -0.009026063606142998, 0.0948183536529541, 0.45607471466064453, 0.16586539149284363, -0.07177916169166565, -0.4488741159439087, 0.24221405386924744, -0.16568158566951752, 0.1904129981994629, -0.23011824488639832, 0.0688575804233551, 0.0036989066284149885, 0.42654839158058167, -0.24217291176319122, 0.24734798073768616, 0.2241547703742981, -0.28656813502311707, 0.389358788728714, -0.1661134511232376, 0.20603744685649872, 0.08282224833965302, -0.2504090964794159, -0.2579721510410309, -0.30296486616134644, -0.1632782518863678, 0.19217270612716675, 0.14666074514389038, 0.06801532953977585, 0.14157840609550476, 0.1033494621515274, 0.14628000557422638, -0.08715277165174484, 0.1392747312784195, 0.08614437282085419, -0.39201200008392334, 0.3963664472103119, -0.051033444702625275, 0.15407270193099976, -0.2986454665660858, 0.11302202939987183, -0.09989969432353973, 0.14175361394882202, 0.10296806693077087, -0.10443628579378128, -0.4296913743019104, -0.24000868201255798, -0.07916192710399628, -0.008918044157326221, 0.17038266360759735, -0.11057887226343155, 0.3228986859321594, 0.40760529041290283, 0.16651932895183563, 0.05084831267595291, 0.3731597065925598, -0.051209911704063416, -0.06840133666992188, -0.24383188784122467, -0.3436325788497925, -0.159544438123703, -0.32419562339782715, 0.07302889972925186, 0.09160493314266205, 0.5084600448608398, 0.3987877070903778, 0.002399098128080368, -0.12698708474636078, 0.7329919338226318, 0.16102831065654755, -0.3803993761539459, 0.04855072498321533, 0.07312901318073273, 0.5818028450012207, -0.25267884135246277, 0.3061389923095703, -0.5949270129203796, -0.24609918892383575, -0.255245566368103, -0.011654569767415524, 0.0185060016810894, 0.2490716278553009, 0.26824167370796204, -0.2307492047548294, 0.3309018313884735, -0.29237011075019836, 0.4700581431388855, -0.548370361328125, -0.1764765977859497, -0.3378545343875885, -0.06374919414520264, -0.053274333477020264, -0.04744613170623779, -0.0007308721542358398, 0.5286215543746948, 0.22052346169948578, 0.45060864090919495, 0.17313849925994873, -0.21938668191432953, -0.05784109979867935, -0.2974361479282379, -0.20781518518924713, 0.1596219539642334, -0.4146082103252411, -0.15447472035884857, -0.24295853078365326, 0.10605333745479584, 0.06333217024803162, 0.09900352358818054, 0.2929234504699707, 0.08313166350126266, -0.2587263286113739, -0.04567798972129822, 0.34534358978271484, 0.06083615869283676, 0.15891146659851074, -0.13154307007789612, 0.021455062553286552, 0.4273412823677063, 0.1887034922838211, -0.026323165744543076, 0.0018793120980262756, 0.047198425978422165, 0.3586321771144867, 0.0511515736579895, -0.1630224734544754, -0.18888963758945465, -0.195040762424469, -0.09863775968551636, -0.048885270953178406, 0.22180058062076569, 0.06867650896310806, -0.24589788913726807, 0.09680656343698502, 0.24413883686065674, 0.020053304731845856, 0.10002240538597107, -0.11137085407972336, 0.20765888690948486, -0.1876988708972931, -0.08570732176303864, -0.08887073397636414, -0.12544435262680054, 0.007443077862262726, 0.004347257316112518, -0.16426733136177063, -0.17080733180046082, 0.19748751819133759, -0.1685679852962494, -0.046834301203489304, -0.06730590760707855, 0.1000630259513855, -0.06602376699447632, -0.11205565184354782, -0.3386700451374054, 0.25432729721069336, -0.0239737406373024, -0.14950700104236603, -0.007528059184551239, 0.3563325107097626, 0.037149108946323395, -0.13103942573070526, -0.7899000644683838, 0.016573399305343628, 0.4524504244327545, -0.20645771920681, 0.2261718064546585, 0.35002630949020386, 0.1972867101430893, -0.14742586016654968, -0.23886814713478088, 0.3650303781032562, 0.12825217843055725, 0.10368739068508148, -0.3065100908279419, -0.02915497124195099, -0.2812650203704834, 0.1178482323884964, -0.2238965630531311, -0.03391634300351143, -0.04235543683171272, -0.2346060425043106, 0.12666524946689606, 0.07207276672124863, -0.4440583288669586, -0.19583472609519958, 0.4689846932888031, -0.036021605134010315, 0.23053574562072754, 0.214607834815979, -0.06382136791944504, -0.1236526221036911, 0.3415255546569824, -0.4494648575782776, 0.3258669674396515, 0.04157605394721031, -0.20870715379714966, -0.04438271373510361, -0.30523648858070374, -0.12270431220531464, 0.2631025016307831, 0.12263773381710052, -0.052429717034101486, -0.18414029479026794, 0.2953401505947113, 0.20742519199848175, -0.11551615595817566, -0.12046697735786438, -0.32755547761917114, -0.41740110516548157, -0.2065761536359787, 0.25319239497184753, -0.22207580506801605, 0.0710432380437851, -0.23193997144699097, 0.07440658658742905, -0.08070579171180725, 0.11654281616210938, -0.01937399059534073, -0.06407786905765533, 0.0077723972499370575, 0.07569611817598343, 0.026798304170370102, 0.3151232600212097, 0.16761580109596252, -0.4481353461742401, -0.32979243993759155, 0.11352328956127167, -0.12384171038866043, -0.12026999890804291, -0.27610257267951965, -0.23954728245735168, 0.30912545323371887, -0.25291386246681213, -0.12782666087150574, -0.3274479806423187, -0.37995997071266174, 0.14333708584308624, 0.061651431024074554, -0.39312052726745605, 0.33494579792022705, -0.1446310430765152, -0.12405408173799515, -0.012864263728260994, 0.1382274478673935, -0.07797841727733612, 0.04061713069677353, 0.2872333824634552, -0.1773255467414856, 0.05767897143959999, -0.1997041553258896, 0.10968466103076935, -0.15927694737911224, -0.057841308414936066, -0.0637584775686264, 0.012387081980705261, 0.1923840194940567, 0.37224069237709045, 0.2173701822757721, -0.0342121459543705, -0.2844291925430298, 0.2393856942653656, -0.1373746544122696, -0.08978620171546936, 0.29768529534339905, 0.05527418479323387, -0.47141793370246887, -0.19430901110172272, -0.000695960596203804, -0.2820720374584198, 0.8419517278671265, -0.21857130527496338, -0.4033866226673126, -0.043269768357276917, 0.247883141040802, 0.19752340018749237, 0.2166457325220108, 0.23416687548160553, 0.119643434882164, 0.22173728048801422, -0.11836832761764526, 0.05688188597559929, -0.07888824492692947, 0.09314089268445969, 0.3471192419528961, 0.35724225640296936, 0.11886225640773773, 0.3046477735042572, 0.531612753868103, -0.283293753862381, -0.6006307601928711, 0.14870882034301758, -0.2314344048500061, 0.5248281359672546, -0.30728766322135925, -0.3090522587299347, 0.7350634932518005, 0.039206042885780334, 0.1219930499792099, -0.09566278755664825, -0.1610645353794098, -0.1677248328924179, -0.08624690771102905, 0.273423969745636, 0.03050597757101059, 0.02255268022418022, 0.3311154246330261, 0.18241752684116364, 0.4925455152988434, -0.2048453986644745, 0.2606748342514038, 0.04325808957219124, -0.24035823345184326, 0.2566573917865753, 0.18175935745239258, 0.35681867599487305, 0.15224602818489075, -0.2249283492565155, -0.0837261825799942, -0.11343944817781448, 0.30671218037605286, 0.2915645241737366, 0.5113745331764221, -0.05978265777230263, -0.23488855361938477, -0.03752301633358002, 0.2095317393541336, 0.5336567163467407, 0.09226661175489426, -0.19654802978038788, -0.005148755386471748, -0.4182877540588379, -0.5697453618049622, -0.17131905257701874, -0.09026207774877548, 0.22264426946640015, 0.07928530871868134, 0.4577648341655731, -0.13184431195259094, -0.2261044979095459, 0.20848272740840912, 0.2895103991031647, -0.025709429755806923, 0.019782859832048416, -0.29943180084228516, -0.2992314398288727, -0.210535928606987, -0.1887373924255371, 0.19394896924495697, 0.035184528678655624, 0.050949834287166595, -0.09705135226249695, -0.38350215554237366, -0.13294580578804016, -0.09684127569198608, -0.262803852558136, 0.2556590437889099, -0.09268578141927719, 0.006824109703302383, 0.1250988245010376, 0.5198006629943848, 0.23042431473731995, -0.10571232438087463, -0.12754668295383453, -0.0652485191822052, 0.15221953392028809, 0.14347746968269348, 0.108314149081707, 0.402182012796402, 0.028806015849113464, -0.22506114840507507, -0.2994018495082855, 0.16370558738708496, -0.1747101992368698, 0.14350810647010803, 0.4693293273448944, -0.042280860245227814, -0.29717734456062317, -0.3783222734928131, 0.20044076442718506, 0.2369648963212967, 0.14604991674423218, 0.32833173871040344, -0.323408842086792, -0.16846174001693726, 0.33081477880477905, 0.5549904108047485, 1.0061836242675781, 0.06638689339160919, 0.5935943126678467, 0.22688689827919006, -0.1776704341173172, 0.19296328723430634, 0.17588093876838684, 0.14508996903896332, -0.2125374972820282, -0.04497687518596649, -0.2175530046224594, -0.37263667583465576, 0.14708420634269714, 0.0006844662129878998, -0.10545048117637634, 0.11406834423542023, -0.19566255807876587, 0.4825303554534912, 0.03179670870304108, -0.19152212142944336, -0.29038411378860474, -0.1341770887374878, 0.39403194189071655, -0.055497027933597565, -0.16625505685806274, 0.0865950956940651, -0.06817023456096649, 0.11189007759094238, -0.10673730820417404, -0.23179839551448822, -0.04648963734507561, -0.14157286286354065, -0.18737873435020447, -0.0015897434204816818, 0.045086927711963654, -0.89349764585495, 0.17425791919231415, 0.29205724596977234, -0.007010959088802338, 0.0403933972120285, 0.1304997354745865, 0.23000633716583252, 0.18251629173755646, 0.2709554433822632, 0.048816390335559845, -0.04854268208146095, 0.3125223219394684, 0.0012789778411388397, 0.09744206815958023, 0.038374386727809906, 0.04107239097356796, -0.1149263083934784, -0.3136325478553772, 0.27948519587516785, 0.20756597816944122, -0.04810540750622749, -0.5733320116996765, -0.07233281433582306, 0.044228363782167435, -0.10547071695327759, -0.003037933260202408, 0.019370291382074356, 0.29659610986709595, 0.38969388604164124, -0.10944774746894836, -0.33909133076667786, -0.10767930746078491, 0.21116240322589874, -0.006330803036689758, -0.243962824344635, 0.1360112428665161, 0.003080412745475769, -0.26797807216644287, 0.046383172273635864, 0.17953360080718994, 0.13956107199192047, -0.7218677997589111, 0.14180903136730194, -0.09619894623756409, -0.1511518806219101, -0.49935802817344666, 0.24490030109882355, -0.01968381553888321, -0.12600478529930115, -0.2661626636981964, 0.06238079071044922, -0.09577635675668716, 0.06826162338256836, 0.11691795289516449, 0.34065118432044983, 0.18763619661331177, 0.0022394629195332527, 0.10704144835472107, -0.3514464497566223, -0.1392400711774826, -0.08102863281965256, 0.523097038269043, 0.2224978506565094, -0.13817265629768372, 0.10788834095001221, -0.03037923015654087, -0.10387590527534485, -0.026443015784025192, 0.25204500555992126, 0.08089959621429443, -0.006652824580669403, -0.22696921229362488, 0.22225302457809448, 0.024898650124669075, -0.2602193355560303, -0.04191295802593231, -0.3426221013069153, -0.25762325525283813, -0.20059674978256226, 0.16001327335834503, 0.5503169298171997, -0.1359778344631195, 0.1811370551586151, -0.1333656907081604, -0.15386366844177246, 0.2166167050600052, -0.002089444547891617, -0.06936785578727722, 0.34450477361679077, 0.16894154250621796, 0.20084215700626373, -0.06334641575813293, -0.06692609190940857, -0.05631628260016441, 0.2073880136013031, -0.06454004347324371, 0.046935100108385086, 0.2894755005836487, -0.08302462100982666, 0.2056974470615387, -0.18079139292240143, 0.39058786630630493, -0.02721170336008072, -0.320728600025177, -0.29191824793815613, 0.29696357250213623, -0.028289666399359703, -0.15676406025886536, -0.22044463455677032, -0.2277584820985794, 0.2934845983982086, -0.048674266785383224, 0.22317829728126526, 0.04875906929373741, 0.04039745777845383, -0.21096326410770416, -0.01865844428539276, 0.4320168197154999, -0.3542124629020691, -0.0357358381152153, 0.5202882885932922, 0.04618066921830177, 0.2990519404411316, 0.467141717672348, 0.06476463377475739, 0.07628009468317032, 0.08368679881095886, 0.4648883044719696, 0.655522882938385, 0.5031352639198303, -0.0030418597161769867, 0.23727598786354065, 0.07216383516788483, -0.22486265003681183, -0.125950425863266, 0.054454512894153595, 0.4518905580043793, 0.04054401069879532, 0.201949343085289, -0.3562605082988739, -0.22281548380851746, 0.26117798686027527, -0.08444970846176147, -0.02707063779234886, 0.21344895660877228, -0.1685449182987213, 0.11149323731660843, 0.10349515080451965, -0.05654008686542511, -0.2538648545742035, 0.0141865573823452, 0.2766719460487366, 0.18721869587898254, -0.059455081820487976, 0.13756439089775085, 0.01947353407740593, -0.21130162477493286, 0.28227540850639343, -0.05046374723315239, -0.1061769351363182, 0.06089596822857857, 0.10896721482276917, 0.19032888114452362, 0.5273295640945435, 0.40423402190208435, 0.35664448142051697, -0.02319680154323578, -0.08162704855203629, -0.13255606591701508, -0.06302128732204437, 0.009524350985884666, 0.23514877259731293, 0.18430845439434052, -0.16952742636203766, 0.22063162922859192, 0.03022213838994503, -0.025975365191698074, 0.06101187318563461, -0.08077692985534668, -0.13200516998767853, -0.25234323740005493, 0.41213950514793396, -0.46428146958351135, -0.42671719193458557, 0.11997532099485397, 0.056124839931726456, -0.23666244745254517, 0.11329749971628189, 0.5935448408126831, 0.17708732187747955, 0.11567225307226181, 0.07999683171510696, -0.052762873470783234, 0.27766165137290955, 0.19104932248592377, -0.09555664658546448, 0.3338400721549988, 0.1794413924217224, -0.007828660309314728, -0.06473376601934433, 0.15803301334381104, 0.026974506676197052, 0.02531728707253933, 0.009547813795506954, -0.16914154589176178, 0.20709273219108582, -0.07301881909370422, 0.4064064025878906, -0.1090022549033165, 0.3058275282382965, 0.21632224321365356, 0.06870098412036896, 0.1807323843240738, -0.07278650999069214, 0.25437140464782715, -0.09287776052951813, -0.5240882039070129, 0.09163163602352142, 0.06654626876115799, 0.03998269885778427, -0.5282384157180786, -0.06875820457935333, -0.04817289486527443, 0.01975066587328911, 0.2925352454185486, 0.06652344763278961, 0.14202600717544556, -0.19559907913208008, 0.1532132923603058, -0.039297375828027725, 0.04332193732261658, 0.01695476844906807, 0.04749756306409836, -0.09867498278617859, 0.2551587224006653, 0.000483514741063118, -0.4210769236087799, -0.28321558237075806, 0.6127032041549683, 0.10669776797294617, -0.13168084621429443, -0.052251674234867096, 0.3414389491081238, -0.5334242582321167, -0.283856064081192, 0.10614246129989624, 0.4564793109893799, 0.03913175314664841, -0.32659855484962463, -0.3699718117713928, -0.3360220491886139, 0.4565116763114929, -0.38378843665122986, -0.27500319480895996, -0.024521715939044952, -0.012893691658973694, -0.03228052705526352, 0.34069767594337463, -0.19776535034179688, -0.3324901759624481, 0.08791285008192062, 0.02737024426460266, -0.12840324640274048, -0.07110923528671265, 0.25844770669937134, -0.0809360221028328, -0.033326972275972366, 0.5671378374099731, -0.02362840622663498, -0.29118025302886963, -0.15743984282016754, -0.24679341912269592 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
I see. I just checked in the HF libraries and it shouldn't break anything. And to be consistent with them we should actually use C H W. For example `transformers` image processors use C H W by default too. So I'm ok with doing a breaking change to make it consistent with `transformers`, `torchvision`, etc.
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
55
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 I see. I just checked in the HF libraries and it shouldn't break anything. And to be consistent with them we should actually use C H W. For example `transformers` image processors use C H W by default too. So I'm ok with doing a breaking change to make it consistent with `transformers`, `torchvision`, etc.
[ 0.013568025082349777, -0.7600610852241516, 0.09970152378082275, 0.17568852007389069, 0.05750557780265808, 0.012449882924556732, 0.7862699031829834, 0.24647554755210876, -0.07333644479513168, 0.08758491277694702, -0.09880152344703674, 0.07621756941080093, -0.14560505747795105, -0.4490041732788086, -0.03142595663666725, -0.4337215721607208, 0.1298028826713562, -0.08582544326782227, -0.2255617380142212, -0.12206697463989258, -0.17630596458911896, -0.01034531183540821, -0.08293330669403076, 0.09720446169376373, -0.8192940354347229, 0.1346478909254074, -0.16381525993347168, 0.005407661199569702, 0.161183163523674, 0.029333598911762238, 0.16905391216278076, -0.223844975233078, 0.15543566644191742, 0.5845076441764832, -0.00013029866386204958, -0.0035096630454063416, 0.2582700252532959, -0.0722460150718689, 0.0638563334941864, 0.021823175251483917, 0.4564265310764313, -0.21995002031326294, -0.10495899617671967, -0.3183659017086029, -0.023363638669252396, -0.0322919562458992, 0.030461063608527184, -0.07576483488082886, -0.15665824711322784, 0.285170316696167, 0.06951607763767242, 0.3522757291793823, -0.13016173243522644, 0.13746197521686554, 0.32296329736709595, 0.4373408555984497, -0.21805831789970398, 0.23481017351150513, 0.027500811964273453, 0.1995084434747696, 0.09267158806324005, 0.2845603823661804, -0.48439157009124756, 0.05217653140425682, 0.32461798191070557, 0.06808125227689743, -0.5308306813240051, -0.09994661808013916, 0.09433776140213013, 0.14940841495990753, 0.19112616777420044, -0.33320289850234985, -0.0961102619767189, -0.04390490800142288, -0.31561586260795593, -0.08235086500644684, 0.0773332342505455, 0.573741614818573, 0.24819964170455933, -0.06143539026379585, -0.3106817603111267, 0.3163031339645386, -0.1628628969192505, 0.2214391976594925, -0.21624846756458282, 0.08619679510593414, 0.02479371801018715, 0.3434000015258789, -0.3686142861843109, 0.3885933756828308, 0.2974698841571808, -0.23365670442581177, 0.2624279260635376, -0.1616480052471161, 0.2264370322227478, 0.0996183305978775, -0.3669157028198242, -0.32338449358940125, -0.2596871852874756, -0.30925172567367554, 0.13325878977775574, 0.05355124920606613, 0.026840679347515106, 0.05544798821210861, -0.0008753892034292221, 0.06619170308113098, -0.17549991607666016, 0.1441413015127182, -0.016717366874217987, -0.38133761286735535, 0.38534966111183167, -0.09238553792238235, 0.21635673940181732, -0.2711319923400879, 0.04832765832543373, -0.14425531029701233, 0.13179631531238556, 0.08120246231555939, -0.043185487389564514, -0.3755651116371155, -0.23788148164749146, 0.015858449041843414, -0.08984555304050446, 0.30567193031311035, -0.17072464525699615, 0.3215172588825226, 0.45672839879989624, 0.19418945908546448, -0.04078451544046402, 0.30535393953323364, -0.11376622319221497, -0.05480146035552025, -0.20696555078029633, -0.2729988694190979, -0.16872161626815796, -0.3062640428543091, 0.12053357809782028, 0.24553753435611725, 0.49282974004745483, 0.29694461822509766, -0.0006522946059703827, -0.05612300708889961, 0.6900780200958252, 0.11215369403362274, -0.3325520157814026, 0.10351834446191788, 0.17409171164035797, 0.5552724003791809, -0.15244856476783752, 0.27674418687820435, -0.6305402517318726, -0.12105850875377655, -0.3357534110546112, 0.013578967191278934, 0.06478308886289597, 0.21423177421092987, 0.3237064480781555, -0.3047788143157959, 0.33154934644699097, -0.30350449681282043, 0.4843543469905853, -0.5257551074028015, -0.07780128717422485, -0.2936055660247803, -0.05145363509654999, -0.067408487200737, -0.06814775615930557, -0.060101158916950226, 0.528454065322876, 0.27900031208992004, 0.5321940183639526, 0.2701031267642975, -0.1424957513809204, -0.09227066487073898, -0.3236442506313324, -0.15699748694896698, 0.08037988096475601, -0.3508831560611725, -0.15962330996990204, -0.13330680131912231, 0.06927631795406342, 0.030052198097109795, 0.11139921098947525, 0.2830568253993988, 0.13608600199222565, -0.19039800763130188, -0.05946372449398041, 0.26815909147262573, 0.0011197179555892944, 0.22219818830490112, -0.2668609917163849, -0.08013331890106201, 0.4775548577308655, 0.014753323048353195, -0.008875496685504913, 0.08841566741466522, 0.018776535987854004, 0.2773404121398926, 0.11633075028657913, -0.1901707500219345, -0.18545159697532654, -0.16561764478683472, -0.12354075908660889, 0.05614054203033447, 0.20371602475643158, 0.05736146867275238, -0.22573891282081604, 0.030891284346580505, -0.06283897161483765, 0.120722196996212, 0.2013607621192932, -0.12546810507774353, 0.10140374302864075, -0.17739614844322205, -0.03822208568453789, -0.16861797869205475, -0.0963355228304863, 0.030622240155935287, -0.09032849967479706, -0.24801218509674072, -0.029843805357813835, 0.24594882130622864, -0.13322347402572632, -0.020906096324324608, -0.0028807837516069412, 0.2493649572134018, -0.19692464172840118, -0.08245602250099182, -0.4047216475009918, 0.15797844529151917, 0.08743838220834732, -0.15140533447265625, -0.06972305476665497, 0.34220221638679504, -0.003807848785072565, -0.17073754966259003, -0.8132222890853882, -0.039092302322387695, 0.3918206989765167, -0.2990504801273346, 0.26659801602363586, 0.45896658301353455, 0.1274077445268631, -0.18578526377677917, -0.019270658493041992, 0.3500891923904419, 0.17133958637714386, 0.07884549349546432, -0.36030977964401245, 0.014009220525622368, -0.26678499579429626, 0.053052883595228195, -0.055748350918293, -0.09425041079521179, 0.03941377252340317, -0.1932026892900467, 0.0450122244656086, 0.06406192481517792, -0.46356573700904846, -0.14712461829185486, 0.5409586429595947, 0.005979873239994049, 0.17168235778808594, 0.18724119663238525, -0.0820126011967659, -0.0986495167016983, 0.33479371666908264, -0.47705885767936707, 0.31985363364219666, 0.035257138311862946, -0.376227468252182, 0.07053688168525696, -0.35231271386146545, -0.14935962855815887, 0.20060332119464874, 0.14689138531684875, -0.0995490550994873, -0.12352713197469711, 0.3094634413719177, 0.23003044724464417, -0.01440846361219883, -0.04927607253193855, -0.26798221468925476, -0.3669041395187378, -0.2789130210876465, 0.35860511660575867, -0.299256831407547, 0.16887718439102173, -0.3625905215740204, -0.01158530917018652, -0.2074718028306961, 0.14466239511966705, 0.04938768595457077, 0.004614230245351791, 0.030220363289117813, 0.07002868503332138, -0.08246809989213943, 0.19306322932243347, 0.13106615841388702, -0.3020196259021759, -0.33921951055526733, 0.14224587380886078, -0.2423376441001892, -0.17120321094989777, -0.25908011198043823, -0.15764188766479492, 0.2764735519886017, -0.2162352353334427, -0.1823277324438095, -0.2700125575065613, -0.41837820410728455, 0.13303279876708984, 0.022915668785572052, -0.3686072528362274, 0.2590513825416565, -0.04543177783489227, -0.06456322222948074, -0.09032417833805084, 0.14709824323654175, -0.14545664191246033, 0.06350602209568024, 0.3727787733078003, -0.19736997783184052, 0.05601372569799423, -0.1784081608057022, -0.023726150393486023, -0.14572550356388092, -0.078769750893116, -0.19047324359416962, -0.07464371621608734, 0.17673617601394653, 0.3497958481311798, 0.18481256067752838, -0.046128228306770325, -0.1630016565322876, 0.2663205564022064, -0.1643633097410202, 0.0011755004525184631, 0.3005734384059906, -0.07543191313743591, -0.5589244961738586, -0.19298049807548523, -0.14029181003570557, -0.2444857656955719, 0.6767575740814209, -0.3019886016845703, -0.2458694875240326, -0.1343495100736618, 0.1811056137084961, 0.14216691255569458, 0.10642967373132706, 0.2606518268585205, 0.0385691337287426, 0.17289090156555176, -0.14019054174423218, 0.03036230430006981, -0.06826675683259964, 0.04808003455400467, 0.4157547950744629, 0.19337016344070435, 0.10928027331829071, 0.20841319859027863, 0.6306943893432617, -0.28555989265441895, -0.5171529054641724, 0.16860201954841614, -0.1694275140762329, 0.5014967918395996, -0.346024751663208, -0.3383512496948242, 0.5661454200744629, 0.005852997303009033, 0.09326937794685364, -0.013730339705944061, -0.15464895963668823, -0.10363179445266724, 0.009771149605512619, 0.22552865743637085, 0.15840935707092285, -0.017601758241653442, 0.39642202854156494, 0.18286624550819397, 0.3976927399635315, -0.20760464668273926, 0.25466546416282654, 0.018580440431833267, -0.27538222074508667, 0.2781417965888977, 0.28638342022895813, 0.16768206655979156, 0.20876291394233704, -0.2305961549282074, -0.1339266300201416, -0.03628062456846237, 0.24571175873279572, 0.3572205603122711, 0.5568008422851562, -0.022283602505922318, -0.153516486287117, 0.000023253262042999268, 0.2226957082748413, 0.6347999572753906, 0.21065270900726318, -0.214726522564888, 0.08637987077236176, -0.31109368801116943, -0.5891470313072205, -0.2781510651111603, -0.1094122976064682, 0.06808190792798996, 0.13922443985939026, 0.37122172117233276, -0.11734628677368164, -0.23430860042572021, 0.18468256294727325, 0.3439997136592865, -0.1378343254327774, -0.005395413376390934, -0.3182111084461212, -0.32785168290138245, -0.2162015289068222, -0.29294511675834656, 0.18632063269615173, 0.024639131501317024, -0.07165748625993729, -0.12239019572734833, -0.2622404396533966, -0.08172765374183655, -0.07371242344379425, -0.33989188075065613, 0.20220819115638733, -0.06078578531742096, -0.07897685468196869, 0.03078429400920868, 0.6070836782455444, 0.17673099040985107, -0.17537318170070648, -0.05758531764149666, -0.0338316410779953, 0.11945034563541412, 0.04535786435008049, 0.0627318024635315, 0.41737446188926697, 0.07411562651395798, -0.0068541765213012695, -0.1562885344028473, 0.1480320543050766, -0.20768962800502777, 0.21764950454235077, 0.42096176743507385, -0.05923067405819893, -0.2621644139289856, -0.33716535568237305, 0.20003654062747955, 0.1592775583267212, 0.22273655235767365, 0.34824663400650024, -0.24485354125499725, -0.16047140955924988, 0.4648939371109009, 0.49864813685417175, 1.0515732765197754, 0.13203488290309906, 0.6051110625267029, 0.30316585302352905, -0.3420042395591736, 0.10833518207073212, 0.2152734249830246, 0.185489684343338, -0.3065977692604065, -0.14335216581821442, -0.1990681290626526, -0.31775763630867004, 0.05356637388467789, -0.09649793803691864, -0.126057967543602, 0.1319894790649414, -0.2806418538093567, 0.46665433049201965, 0.03133167326450348, -0.1633049100637436, -0.1620650738477707, -0.19612151384353638, 0.4104064404964447, -0.026325315237045288, -0.18185794353485107, 0.12792424857616425, -0.12544837594032288, 0.08183597028255463, -0.1754349321126938, -0.27517756819725037, -0.09830731153488159, -0.06898228824138641, -0.15751664340496063, 0.033035244792699814, 0.071221262216568, -0.7325735688209534, 0.1950390487909317, 0.21639838814735413, 0.04989353567361832, 0.008963100612163544, 0.11378572136163712, 0.14477995038032532, 0.21872004866600037, 0.1982543021440506, 0.12237980216741562, -0.045219797641038895, 0.281272828578949, -0.008561480790376663, 0.058593593537807465, 0.03239822760224342, 0.009996098466217518, -0.11447346955537796, -0.22938767075538635, 0.17775088548660278, 0.22310201823711395, -0.12023141235113144, -0.4890744984149933, -0.12218201160430908, 0.027347702533006668, -0.09778610616922379, 0.018206387758255005, -0.03614651411771774, 0.19977234303951263, 0.27830466628074646, -0.012590382248163223, -0.34947335720062256, -0.16551770269870758, 0.24348127841949463, 0.025317035615444183, -0.23609203100204468, 0.24525503814220428, 0.13201695680618286, -0.31748026609420776, 0.03319220244884491, 0.12551584839820862, 0.10346894711256027, -0.7542833089828491, 0.0976530984044075, -0.15148408710956573, -0.19614025950431824, -0.5338343977928162, 0.263502836227417, 0.053282443434000015, -0.074953593313694, -0.2934533655643463, 0.14581191539764404, -0.2923146188259125, -0.003647066652774811, 0.03700845688581467, 0.32876941561698914, 0.2334170937538147, 0.22956529259681702, -0.05319789797067642, -0.13318614661693573, -0.14992272853851318, -0.06451978534460068, 0.4513741433620453, 0.2611188292503357, -0.2822059094905853, 0.025370808318257332, 0.005946369841694832, -0.10388903319835663, -0.04012630507349968, 0.276498019695282, 0.08928444981575012, 0.0007726885378360748, -0.29963040351867676, 0.21524560451507568, 0.039686501026153564, -0.29814326763153076, -0.04955125227570534, -0.28098124265670776, -0.14960536360740662, -0.14171487092971802, 0.22002556920051575, 0.5005431771278381, -0.08985823392868042, 0.21126678586006165, -0.08885900676250458, -0.17076754570007324, 0.04645167291164398, -0.07033640146255493, 0.003939233720302582, 0.33309072256088257, 0.12322711944580078, 0.11510439962148666, -0.14669160544872284, -0.09142490476369858, -0.10249805450439453, 0.21116581559181213, -0.06073601543903351, 0.13019989430904388, 0.2859797179698944, -0.17663000524044037, 0.21726658940315247, -0.12912026047706604, 0.2697756588459015, -0.19033125042915344, -0.28549084067344666, -0.22103437781333923, 0.3682593107223511, -0.008625952526926994, -0.13526955246925354, -0.13806022703647614, -0.2075636237859726, 0.2350749522447586, -0.04538995772600174, 0.22826649248600006, -0.017102815210819244, -0.015364028513431549, -0.15823957324028015, 0.05450282245874405, 0.3386102616786957, -0.3781283497810364, -0.012834159657359123, 0.4883037805557251, 0.01406044140458107, 0.411676287651062, 0.49600017070770264, 0.008541727438569069, 0.007191859185695648, -0.004601120948791504, 0.570910632610321, 0.49185872077941895, 0.41182419657707214, -0.018847007304430008, 0.2441934049129486, 0.11488936841487885, -0.39984405040740967, -0.1718214452266693, 0.13974998891353607, 0.4090104103088379, 0.0670023187994957, 0.1963767111301422, -0.3170603811740875, -0.3870597183704376, 0.22733646631240845, -0.09022107720375061, -0.07070175558328629, 0.3166488707065582, -0.13859184086322784, 0.23591530323028564, 0.16804206371307373, -0.08701372891664505, -0.18289658427238464, 0.048236649483442307, 0.26198628544807434, 0.27926212549209595, -0.15804409980773926, 0.09446687251329422, 0.018329443410038948, -0.14769533276557922, 0.2541094720363617, -0.061297908425331116, -0.011064743623137474, 0.12335396558046341, 0.06061287596821785, 0.17642611265182495, 0.4392859637737274, 0.3573990762233734, 0.3672393262386322, 0.05383286625146866, -0.10655184090137482, 0.003029279410839081, -0.06684118509292603, 0.13691206276416779, 0.21502576768398285, 0.22996725142002106, -0.18005742132663727, 0.19539040327072144, 0.01965007744729519, -0.06514381617307663, -0.019948530942201614, 0.03680294752120972, -0.03332887217402458, -0.17279943823814392, 0.5665884613990784, -0.4008866250514984, -0.38180288672447205, 0.08240959048271179, -0.058624766767024994, -0.3019232451915741, 0.21980544924736023, 0.6539395451545715, 0.06529586762189865, 0.12455850094556808, 0.09671944379806519, -0.029018305242061615, 0.2783340513706207, 0.18771125376224518, -0.011443931609392166, 0.3587477207183838, 0.07714036852121353, 0.12846198678016663, 0.0910460352897644, 0.2385004162788391, -0.05878332629799843, 0.1344202607870102, 0.06423369795084, -0.13452081382274628, 0.1648094654083252, -0.16979163885116577, 0.4451499581336975, -0.12450524419546127, 0.31276485323905945, 0.3016761839389801, 0.05148721858859062, 0.118485227227211, -0.08902163803577423, 0.3075885772705078, -0.06131519749760628, -0.4486159384250641, 0.12852127850055695, 0.2154597043991089, 0.038270652294158936, -0.47767090797424316, 0.010337524116039276, 0.011523783206939697, -0.08881424367427826, 0.17622914910316467, 0.03350946679711342, 0.24755069613456726, -0.22421395778656006, 0.07239607721567154, -0.08713939785957336, 0.02323347143828869, -0.08096233010292053, -0.06568225473165512, -0.08312337100505829, 0.34294894337654114, 0.036088235676288605, -0.4511234760284424, -0.3654278516769409, 0.7202315330505371, 0.13543245196342468, -0.14667081832885742, -0.012810075655579567, 0.5186103582382202, -0.5873852968215942, -0.2915727496147156, 0.15920697152614594, 0.4778972566127777, 0.10637612640857697, -0.22129803895950317, -0.3251917362213135, -0.4161810874938965, 0.4997093379497528, -0.355660080909729, -0.2869972288608551, 0.05542153865098953, 0.07943491637706757, -0.03616362065076828, 0.2843644917011261, -0.1466870903968811, -0.3319767713546753, 0.02937772497534752, 0.013065328821539879, -0.16459348797798157, -0.06918932497501373, 0.23096126317977905, -0.03294944018125534, -0.019338738173246384, 0.5590679049491882, 0.030112506821751595, -0.3613857328891754, -0.12597626447677612, -0.24769610166549683 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
Since it is quite connected, the proposed PR #6402 will not work for monochrome `PIL` images since they only have 2 dimensions as `numpy `arrays. [Torchvision ](https://pytorch.org/vision/stable/_modules/torchvision/transforms/functional.html#pil_to_tensor) adds a channel before permuting. Would that make sense here as well?
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
39
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 Since it is quite connected, the proposed PR #6402 will not work for monochrome `PIL` images since they only have 2 dimensions as `numpy `arrays. [Torchvision ](https://pytorch.org/vision/stable/_modules/torchvision/transforms/functional.html#pil_to_tensor) adds a channel before permuting. Would that make sense here as well?
[ -0.037376243621110916, -0.7864429354667664, 0.08790720999240875, 0.23845580220222473, 0.061577096581459045, -0.035391464829444885, 0.7305800318717957, 0.26690301299095154, -0.09479202330112457, 0.08478910475969315, -0.06551163643598557, 0.16598454117774963, -0.21500340104103088, -0.42678508162498474, -0.045996859669685364, -0.5122741460800171, 0.053138960152864456, -0.050719112157821655, -0.19602510333061218, -0.07358337938785553, -0.19960729777812958, -0.018927736207842827, -0.12008318305015564, 0.020994529128074646, -0.7363244295120239, 0.17625361680984497, -0.16878047585487366, -0.06061847507953644, 0.06485950946807861, 0.03872303292155266, 0.2059095948934555, -0.2183188498020172, 0.18511486053466797, 0.49569231271743774, -0.00012680616055149585, -0.051532991230487823, 0.2656730115413666, -0.11108759045600891, 0.09679898619651794, -0.04053950309753418, 0.5226090550422668, -0.251823365688324, -0.12789204716682434, -0.35297155380249023, -0.1507537066936493, -0.028336051851511, 0.07810074090957642, -0.07313048094511032, -0.18653176724910736, 0.2580617368221283, 0.08665822446346283, 0.35469478368759155, -0.027020106092095375, 0.17571532726287842, 0.24751347303390503, 0.4266166090965271, -0.22237494587898254, 0.2522541284561157, 0.09267354756593704, 0.22658191621303558, 0.11221139132976532, 0.34754303097724915, -0.4973892867565155, 0.03488512709736824, 0.2685088813304901, 0.08071970194578171, -0.47359299659729004, -0.12704084813594818, 0.012949595227837563, 0.10622571408748627, 0.09855126589536667, -0.3095913827419281, -0.06487484276294708, -0.0838385820388794, -0.2807443141937256, -0.08539377897977829, 0.054312072694301605, 0.6132423281669617, 0.1983967423439026, -0.061930011957883835, -0.3907558023929596, 0.3930606245994568, -0.23286910355091095, 0.2795291543006897, -0.23695918917655945, 0.007330954074859619, 0.043731145560741425, 0.3477207124233246, -0.2969359755516052, 0.2703997790813446, 0.32733145356178284, -0.1915772706270218, 0.3825376033782959, -0.14458931982517242, 0.23861268162727356, 0.0864572525024414, -0.30055227875709534, -0.314113587141037, -0.28190556168556213, -0.2822107672691345, 0.2371462881565094, 0.08643382787704468, 0.04935378581285477, 0.07766897231340408, -0.0037499666213989258, 0.09460780024528503, -0.10309434682130814, 0.1205449178814888, -0.06594124436378479, -0.32988646626472473, 0.4300229847431183, -0.04111038148403168, 0.19192174077033997, -0.26915961503982544, 0.024760358035564423, -0.10004713386297226, 0.149901881814003, 0.130838081240654, -0.09257704764604568, -0.40340787172317505, -0.3368762731552124, 0.06178617477416992, -0.044150009751319885, 0.22212716937065125, -0.1848512887954712, 0.3820013701915741, 0.5696633458137512, 0.13648822903633118, -0.051269449293613434, 0.3150774836540222, -0.11689143627882004, -0.006049200892448425, -0.17346300184726715, -0.3013976812362671, -0.12622056901454926, -0.28273826837539673, 0.11788345128297806, 0.23455266654491425, 0.41721296310424805, 0.2889712452888489, 0.037565745413303375, 0.028947457671165466, 0.7183183431625366, 0.054732292890548706, -0.3064788281917572, 0.007160382345318794, 0.06749093532562256, 0.5720232725143433, -0.1600123643875122, 0.33404362201690674, -0.5449850559234619, -0.09572096168994904, -0.2728881537914276, 0.03744187206029892, 0.0005609877407550812, 0.20751868188381195, 0.3724191188812256, -0.27225685119628906, 0.3089239001274109, -0.30162855982780457, 0.4200587570667267, -0.5994833707809448, -0.043897610157728195, -0.26919808983802795, 0.03135674446821213, -0.10625949501991272, -0.05373042821884155, 0.008399158716201782, 0.5072903633117676, 0.20425020158290863, 0.5381835699081421, 0.24266937375068665, -0.09158065170049667, -0.12321802228689194, -0.3050841689109802, -0.1607699692249298, 0.05216941237449646, -0.3463708758354187, -0.18349450826644897, -0.23127079010009766, 0.0009949952363967896, 0.022461215034127235, 0.13260050117969513, 0.37004417181015015, 0.05595221370458603, -0.12479531764984131, 0.0009425878524780273, 0.34453755617141724, -0.0014659874141216278, 0.2525325417518616, -0.27279752492904663, -0.044283945113420486, 0.4999538064002991, 0.10041823983192444, -0.06301848590373993, -0.020798735320568085, -0.02599937468767166, 0.3298204243183136, 0.13829872012138367, -0.17351266741752625, -0.15981851518154144, -0.2545839548110962, -0.12922079861164093, -0.062029749155044556, 0.15046556293964386, 0.06191246211528778, -0.1903960406780243, 0.01689654216170311, -0.006966317072510719, 0.16134236752986908, 0.1331666260957718, -0.1072775349020958, 0.09317250549793243, -0.1914464682340622, -0.037392016500234604, -0.17623271048069, -0.0481351763010025, 0.05470512807369232, -0.004285145550966263, -0.2997816801071167, 0.017586123198270798, 0.26750287413597107, -0.1500648558139801, -0.07130638509988785, -0.1468460112810135, 0.181193545460701, -0.20042215287685394, -0.12946994602680206, -0.3461815118789673, 0.21657586097717285, 0.10683806240558624, -0.1727502942085266, 0.021975994110107422, 0.3578842282295227, -0.04232069104909897, -0.16306088864803314, -0.7757325172424316, -0.0758725255727768, 0.4101984202861786, -0.3054090440273285, 0.21887218952178955, 0.47932758927345276, 0.13565292954444885, -0.1429981291294098, -0.11442478746175766, 0.4766782522201538, 0.13685622811317444, 0.07959161698818207, -0.3469085693359375, 0.03351333737373352, -0.22101065516471863, 0.06018815562129021, -0.12018255889415741, -0.14833390712738037, 0.06270089745521545, -0.16421061754226685, 0.028343621641397476, 0.10602431744337082, -0.5005532503128052, -0.058752112090587616, 0.39470627903938293, 0.006711866706609726, 0.16188007593154907, 0.12523889541625977, -0.06122057884931564, -0.11665984988212585, 0.3432583808898926, -0.4495515823364258, 0.24287070333957672, 0.049810051918029785, -0.33043307065963745, 0.06411776691675186, -0.32713040709495544, -0.13545510172843933, 0.20886144042015076, 0.1001405343413353, -0.19253888726234436, -0.169063538312912, 0.3497146666049957, 0.15747353434562683, -0.027713360264897346, -0.033434003591537476, -0.26914677023887634, -0.3366382122039795, -0.20617306232452393, 0.25091055035591125, -0.2876322269439697, 0.09111689776182175, -0.36800241470336914, -0.08409661799669266, -0.1253398358821869, 0.20129333436489105, 0.0673774853348732, 0.08129581809043884, 0.01990605890750885, 0.06698936223983765, 0.009792495518922806, 0.19775450229644775, 0.1739140748977661, -0.34917137026786804, -0.2951894700527191, 0.15235380828380585, -0.16100972890853882, -0.12832699716091156, -0.3075096607208252, -0.13864466547966003, 0.3430481255054474, -0.27607885003089905, -0.11150325834751129, -0.3256438374519348, -0.43371325731277466, 0.10203619301319122, 0.00010989978909492493, -0.34876152873039246, 0.2834745943546295, -0.02149365097284317, -0.019418705254793167, -0.12175091356039047, 0.19337359070777893, -0.12998875975608826, -0.004093088209629059, 0.326687753200531, -0.14295776188373566, 0.07494203001260757, -0.2233414351940155, -0.14032980799674988, -0.1574251353740692, -0.05152098089456558, -0.13012874126434326, -0.023643340915441513, 0.20008376240730286, 0.2330457717180252, 0.2692159116268158, -0.012126830406486988, -0.1983921378850937, 0.2747812271118164, -0.13492999970912933, 0.007591668516397476, 0.30585265159606934, -0.04918801039457321, -0.5319726467132568, -0.22301961481571198, -0.1428254246711731, -0.22668009996414185, 0.7313944697380066, -0.22306734323501587, -0.3536243438720703, -0.10025499016046524, 0.24737530946731567, 0.15728998184204102, 0.04528725892305374, 0.35102465748786926, 0.07557984441518784, 0.14082591235637665, -0.1059073656797409, -0.043441206216812134, -0.10704012960195541, 0.08908607065677643, 0.4751707911491394, 0.20660242438316345, 0.049219612032175064, 0.22056257724761963, 0.6229929327964783, -0.27141422033309937, -0.5931839942932129, 0.10271807014942169, -0.19728974997997284, 0.46360644698143005, -0.2615232765674591, -0.324114054441452, 0.5707740783691406, 0.05806468427181244, 0.10500329732894897, -0.016089975833892822, -0.1384861171245575, -0.15026645362377167, -0.05625069886445999, 0.21536414325237274, 0.057449355721473694, -0.009227406233549118, 0.3881143629550934, 0.2173878252506256, 0.40430498123168945, -0.2729138731956482, 0.22169533371925354, -0.020513933151960373, -0.31435421109199524, 0.1287669539451599, 0.24804192781448364, 0.22579661011695862, 0.22279313206672668, -0.2828313708305359, -0.15547846257686615, -0.051710911095142365, 0.27462923526763916, 0.3594508171081543, 0.5799139738082886, 0.003410305827856064, -0.20279359817504883, 0.04664403572678566, 0.21102125942707062, 0.6080787777900696, 0.21766474843025208, -0.21429727971553802, 0.08210073411464691, -0.3322913646697998, -0.6440199613571167, -0.2405577152967453, -0.08285568654537201, 0.11978147178888321, 0.20410287380218506, 0.34356051683425903, -0.16171911358833313, -0.1830998659133911, 0.20963981747627258, 0.3827333152294159, -0.09611528366804123, 0.0170590877532959, -0.2670482099056244, -0.39104023575782776, -0.1591167002916336, -0.2364831566810608, 0.23820583522319794, 0.1045546904206276, -0.0018728370778262615, -0.09335091710090637, -0.2453376203775406, -0.10705628246068954, -0.08890694379806519, -0.2799709439277649, 0.2614299952983856, -0.06925193965435028, -0.0077658761292696, 0.030639436095952988, 0.5803698301315308, 0.1897135078907013, -0.21222007274627686, -0.03423834219574928, -0.030312195420265198, 0.09438765048980713, 0.028615523129701614, 0.06398246437311172, 0.36424630880355835, 0.06495422124862671, -0.09041906148195267, -0.20013761520385742, 0.09552165120840073, -0.1657097190618515, 0.25361257791519165, 0.3472254276275635, -0.090900719165802, -0.20405882596969604, -0.3612266182899475, 0.13732020556926727, 0.21511609852313995, 0.20932067930698395, 0.2961839437484741, -0.42160677909851074, -0.15466424822807312, 0.4133725166320801, 0.5206239223480225, 1.0651187896728516, 0.07457675039768219, 0.5652344822883606, 0.2659187614917755, -0.2769457697868347, 0.15872223675251007, 0.29289841651916504, 0.24847306311130524, -0.30416804552078247, -0.054621487855911255, -0.1709950864315033, -0.3312210440635681, 0.015549495816230774, -0.1461959183216095, -0.14008472859859467, 0.10550194978713989, -0.2495470941066742, 0.3908827006816864, 0.04589984565973282, -0.16849517822265625, -0.1892574578523636, -0.15775588154792786, 0.3856135606765747, -0.024182621389627457, -0.21623601019382477, 0.08461564779281616, -0.14320465922355652, 0.06852900981903076, -0.2079627364873886, -0.27057942748069763, -0.05379122868180275, -0.06770588457584381, -0.2286088615655899, 0.0013061556965112686, 0.025477536022663116, -0.8490071296691895, -0.008204913698136806, 0.36444228887557983, -0.07520595192909241, -0.022028248757123947, 0.04724390432238579, 0.15617144107818604, 0.22185379266738892, 0.1479475498199463, 0.11642565578222275, -0.07014468312263489, 0.26071807742118835, -0.04932094365358353, 0.08572693914175034, -0.02816671133041382, 0.02569045126438141, -0.07626650482416153, -0.2832906246185303, 0.24752168357372284, 0.25359585881233215, -0.06893626600503922, -0.5172666907310486, -0.15454640984535217, -0.04752053692936897, -0.11851228773593903, 0.04344286769628525, 0.018954195082187653, 0.18066038191318512, 0.26387879252433777, 0.023730266839265823, -0.32137441635131836, -0.11188355088233948, 0.3009765148162842, 0.036421600729227066, -0.27878835797309875, 0.17866596579551697, 0.09981627762317657, -0.29341262578964233, 0.026750564575195312, 0.1582697331905365, 0.04870745167136192, -0.6913391351699829, 0.13020995259284973, -0.10679623484611511, -0.17172729969024658, -0.45925402641296387, 0.23086731135845184, 0.07586941123008728, -0.11519081145524979, -0.24334965646266937, 0.13933661580085754, -0.2854088842868805, -0.06212274730205536, 0.08321473747491837, 0.38496172428131104, 0.24159011244773865, 0.20832115411758423, -0.03275568038225174, -0.2640083134174347, -0.1771411895751953, -0.012954188510775566, 0.39239493012428284, 0.34837600588798523, -0.24039635062217712, 0.043062373995780945, -0.06050601601600647, -0.11168350279331207, 0.000826127827167511, 0.26210349798202515, 0.050564974546432495, -0.013735394924879074, -0.2627444863319397, 0.20318296551704407, 0.057421788573265076, -0.3062588572502136, -0.056967947632074356, -0.24418041110038757, -0.15090084075927734, -0.15566012263298035, 0.15941333770751953, 0.5082016587257385, -0.10063982009887695, 0.11603106558322906, -0.1697707325220108, -0.1394405961036682, 0.07731601595878601, -0.07236512005329132, -0.07035854458808899, 0.2618483901023865, 0.13435620069503784, 0.12693485617637634, -0.15852198004722595, -0.09212436527013779, 0.03070480190217495, 0.13076120615005493, -0.10385926067829132, 0.19526147842407227, 0.2814992368221283, -0.026105836033821106, 0.15913346409797668, -0.13912150263786316, 0.3128543794155121, -0.1988677680492401, -0.3363855183124542, -0.16160452365875244, 0.29471686482429504, 0.0296497642993927, -0.15062811970710754, -0.0655144602060318, -0.1880069375038147, 0.2520175576210022, -0.02126425690948963, 0.22046995162963867, -0.07379765063524246, 0.0055992454290390015, -0.1736803501844406, 0.018774718046188354, 0.4145106077194214, -0.37634700536727905, -0.012902768328785896, 0.4976748526096344, -0.008698370307683945, 0.328469455242157, 0.5529578328132629, -0.012592744082212448, -0.01987265795469284, -0.026605665683746338, 0.46201640367507935, 0.5912322402000427, 0.4572071433067322, -0.00472128763794899, 0.23514115810394287, 0.22098810970783234, -0.3847937285900116, -0.1924659013748169, 0.17856910824775696, 0.45715317130088806, 0.03998090326786041, 0.3089293837547302, -0.42424440383911133, -0.2901844084262848, 0.28730636835098267, -0.07424208521842957, -0.06556033343076706, 0.3239807188510895, -0.22954079508781433, 0.1492432951927185, 0.18112337589263916, -0.10664235055446625, -0.1625540852546692, 0.021629828959703445, 0.30159905552864075, 0.27369046211242676, -0.18503008782863617, 0.023876599967479706, -0.01880113035440445, -0.12797674536705017, 0.24123841524124146, -0.09532248973846436, 0.024587683379650116, 0.18078520894050598, 0.05422048643231392, 0.17352771759033203, 0.4992464780807495, 0.35802197456359863, 0.4128256142139435, 0.030183522030711174, -0.04386720061302185, -0.009192651137709618, -0.08215964585542679, 0.03273750841617584, 0.19631624221801758, 0.23829719424247742, -0.18317215144634247, 0.13140089809894562, 0.06309998780488968, -0.075731061398983, 0.08100356161594391, 0.05130767077207565, -0.06488169729709625, -0.15354083478450775, 0.49961721897125244, -0.43776124715805054, -0.4300452470779419, 0.08336970210075378, -0.07265783101320267, -0.2844935953617096, 0.1894034594297409, 0.5837914943695068, 0.06939046829938889, 0.14823174476623535, 0.12373129278421402, -0.016037264838814735, 0.24757611751556396, 0.1736810803413391, -0.06902676820755005, 0.2789834141731262, 0.08565157651901245, 0.1134609580039978, 0.020786017179489136, 0.20346322655677795, 0.00829092413187027, 0.10483430325984955, -0.013996848836541176, -0.09731894731521606, 0.16405317187309265, -0.1186881959438324, 0.35551148653030396, -0.08024183660745621, 0.3433128893375397, 0.3031371533870697, -0.04131238907575607, 0.1491851806640625, 0.026048723608255386, 0.24465590715408325, 0.018274761736392975, -0.4127933382987976, 0.15345992147922516, 0.1594599485397339, 0.08883731812238693, -0.4729841351509094, 0.012455359101295471, -0.05166015028953552, 0.024552229791879654, 0.19903947412967682, 0.08972402662038803, 0.28218376636505127, -0.24318745732307434, 0.10049448162317276, -0.12038859724998474, 0.08124150335788727, -0.09287916123867035, -0.03844686597585678, -0.03289363160729408, 0.3363158404827118, 0.01798919215798378, -0.4585246741771698, -0.3563670814037323, 0.7030284404754639, 0.09938658773899078, -0.14680929481983185, 0.0018447376787662506, 0.46116775274276733, -0.6161399483680725, -0.3050946891307831, 0.05902528390288353, 0.4389808177947998, 0.09861717373132706, -0.26563048362731934, -0.33903709053993225, -0.4973808526992798, 0.48265743255615234, -0.3200012743473053, -0.23537017405033112, 0.08220166712999344, 0.014862991869449615, -0.06430972367525101, 0.37256452441215515, -0.15636971592903137, -0.2800271511077881, 0.035895783454179764, -0.02394167333841324, -0.16372671723365784, -0.03848135098814964, 0.17135068774223328, -0.0448162741959095, -0.013473812490701675, 0.6041030883789062, 0.11393019556999207, -0.32766953110694885, -0.11033006012439728, -0.2726494073867798 ]
https://github.com/huggingface/datasets/issues/6394
TorchFormatter images (H, W, C) instead of (C, H, W) format
@Modexus yes, indeed that would make sense as torch expects 1, H, W for monochrome, not H,W as you'd often see in numpy (via PIL), OpenCV, etc. The reference should be the torchvision fn https://pytorch.org/vision/main/_modules/torchvision/transforms/functional.html#pil_to_tensor
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
35
TorchFormatter images (H, W, C) instead of (C, H, W) format ### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2 @Modexus yes, indeed that would make sense as torch expects 1, H, W for monochrome, not H,W as you'd often see in numpy (via PIL), OpenCV, etc. The reference should be the torchvision fn https://pytorch.org/vision/main/_modules/torchvision/transforms/functional.html#pil_to_tensor
[ 0.013370279222726822, -0.7921171188354492, 0.0881350040435791, 0.22050978243350983, 0.07247814536094666, -0.011022321879863739, 0.768912672996521, 0.2581658959388733, -0.057951733469963074, 0.11149706691503525, -0.08306442201137543, 0.1641283631324768, -0.19243280589580536, -0.4251430630683899, -0.044110480695962906, -0.43765631318092346, 0.06585954874753952, -0.09317904710769653, -0.20796164870262146, -0.12310628592967987, -0.15247631072998047, -0.0022259075194597244, -0.11837461590766907, -0.003212869167327881, -0.7782201766967773, 0.17142879962921143, -0.19071370363235474, -0.05899237096309662, 0.09319201111793518, 0.04452356696128845, 0.21759545803070068, -0.2563444674015045, 0.13378804922103882, 0.5441074967384338, -0.0001265487226191908, -0.07142720371484756, 0.2473241537809372, -0.09476138651371002, 0.03316530957818031, -0.07043646275997162, 0.49611249566078186, -0.20426690578460693, -0.07800758630037308, -0.3354354798793793, -0.13955417275428772, 0.03680188208818436, 0.06303426623344421, -0.15492026507854462, -0.16476751863956451, 0.2879283130168915, 0.08813907206058502, 0.33290690183639526, -0.09099743515253067, 0.13965320587158203, 0.2951597273349762, 0.42550843954086304, -0.21503165364265442, 0.26947975158691406, 0.10473889857530594, 0.22510740160942078, 0.07646293193101883, 0.3190976679325104, -0.4711850583553314, 0.07859380543231964, 0.3019821047782898, 0.04550807550549507, -0.49481672048568726, -0.11570173501968384, 0.02889474481344223, 0.14015847444534302, 0.1739148199558258, -0.2961185574531555, -0.044411540031433105, -0.09799429029226303, -0.2866835296154022, -0.03945188596844673, 0.05964260175824165, 0.5926755666732788, 0.18637698888778687, -0.04292389377951622, -0.35410887002944946, 0.39574098587036133, -0.17624273896217346, 0.2745102643966675, -0.23800775408744812, 0.059274543076753616, -0.0025292932987213135, 0.3222307562828064, -0.34162062406539917, 0.33912521600723267, 0.28008121252059937, -0.24339964985847473, 0.31497320532798767, -0.10873758792877197, 0.22016923129558563, 0.13736571371555328, -0.29418912529945374, -0.3050273358821869, -0.29252904653549194, -0.26130837202072144, 0.25588029623031616, 0.11329833418130875, 0.02363036945462227, 0.09136161208152771, 0.020730245858430862, 0.10381713509559631, -0.09866040199995041, 0.06774348765611649, -0.09367787837982178, -0.36266475915908813, 0.43273013830184937, -0.06746748834848404, 0.17487989366054535, -0.3026767671108246, 0.03422985598444939, -0.052433907985687256, 0.16900841891765594, 0.11983266472816467, -0.10463608801364899, -0.437912255525589, -0.2770750820636749, 0.023371517658233643, -0.04718904569745064, 0.21970516443252563, -0.19292160868644714, 0.31146809458732605, 0.5200496912002563, 0.1951914131641388, -0.0630958303809166, 0.3226308524608612, -0.121547169983387, -0.04264046624302864, -0.18929320573806763, -0.31976333260536194, -0.13179196417331696, -0.3149711489677429, 0.13022564351558685, 0.26080241799354553, 0.45711445808410645, 0.24480673670768738, 0.009661411866545677, -0.0038653891533613205, 0.7374941110610962, 0.0032540857791900635, -0.32376646995544434, 0.09966541826725006, 0.1561037003993988, 0.5694586634635925, -0.1576235592365265, 0.2943819463253021, -0.568396806716919, -0.07578492164611816, -0.2800942063331604, 0.04886171594262123, 0.03555551543831825, 0.19586272537708282, 0.3570215404033661, -0.2729775607585907, 0.3369746506214142, -0.25068897008895874, 0.39724013209342957, -0.5618930459022522, -0.06328696757555008, -0.2969317138195038, 0.011982044205069542, -0.07676646113395691, -0.03769036754965782, -0.05392345413565636, 0.5340883731842041, 0.2584216892719269, 0.5259406566619873, 0.21945443749427795, -0.09842458367347717, -0.1378578245639801, -0.32560741901397705, -0.16339701414108276, 0.06235198676586151, -0.35874924063682556, -0.1304597407579422, -0.23161692917346954, 0.0024176016449928284, 0.08700812608003616, 0.09007003158330917, 0.3270839750766754, 0.09717221558094025, -0.12268725782632828, 0.04364696145057678, 0.3282831311225891, 0.025663860142230988, 0.2385273575782776, -0.25687986612319946, 0.02756284736096859, 0.5216238498687744, 0.03742484375834465, -0.10120373964309692, -0.010012619197368622, -0.043019212782382965, 0.24356187880039215, 0.16160792112350464, -0.16263215243816376, -0.16891731321811676, -0.2286251038312912, -0.13387636840343475, -0.005619220435619354, 0.1478699892759323, 0.08122093975543976, -0.16269591450691223, 0.05870223790407181, 0.058617107570171356, 0.1498100459575653, 0.17366832494735718, -0.11541115492582321, 0.10356508195400238, -0.2205694317817688, -0.07671128213405609, -0.17310814559459686, -0.054966412484645844, 0.04271799698472023, -0.05542498826980591, -0.2577753961086273, 0.04525481536984444, 0.22993052005767822, -0.13852788507938385, -0.06524208933115005, -0.11256943643093109, 0.14154362678527832, -0.18338634073734283, -0.10798665136098862, -0.3111433684825897, 0.21522623300552368, 0.11835826188325882, -0.14166072010993958, -0.026794888079166412, 0.3112001121044159, -0.04975034296512604, -0.1592746526002884, -0.8225589394569397, -0.0962207168340683, 0.39216142892837524, -0.24724499881267548, 0.2411210685968399, 0.4798829257488251, 0.13026782870292664, -0.20677316188812256, -0.08279409259557724, 0.4322940707206726, 0.14322496950626373, 0.0890674814581871, -0.39567476511001587, 0.05185164511203766, -0.2306932806968689, 0.09676109254360199, -0.1124601811170578, -0.11974438279867172, 0.03845467418432236, -0.22272372245788574, 0.045597922056913376, 0.0928458496928215, -0.4562976360321045, -0.07824739068746567, 0.40560099482536316, 0.02928062155842781, 0.17868530750274658, 0.09689584374427795, -0.10995350033044815, -0.11465857923030853, 0.35007718205451965, -0.4840220808982849, 0.2658843398094177, 0.03673665225505829, -0.31740522384643555, -0.00992751307785511, -0.2899055778980255, -0.16243639588356018, 0.1605817675590515, 0.12001171708106995, -0.13356898725032806, -0.139911949634552, 0.33941933512687683, 0.1470724493265152, 0.005764473229646683, 0.011981677263975143, -0.2778756618499756, -0.3939661383628845, -0.23049703240394592, 0.29656273126602173, -0.2967539131641388, 0.15333634614944458, -0.3526824712753296, -0.08879443258047104, -0.14817051589488983, 0.18503765761852264, 0.05669964849948883, 0.037089549005031586, 0.03684517368674278, 0.025601869449019432, 0.0368674211204052, 0.1620146930217743, 0.15004681050777435, -0.3716724216938019, -0.29644447565078735, 0.08463675528764725, -0.20104244351387024, -0.12181447446346283, -0.30646783113479614, -0.17341142892837524, 0.3471096158027649, -0.27747759222984314, -0.12371934950351715, -0.2671050727367401, -0.349513977766037, 0.08946159482002258, -0.032221369445323944, -0.4091695547103882, 0.2530204653739929, -0.018591947853565216, -0.07852263748645782, -0.07777547091245651, 0.18895909190177917, -0.08360476791858673, -0.0042343828827142715, 0.3253091275691986, -0.13262291252613068, 0.05782235786318779, -0.18184836208820343, -0.1179623082280159, -0.13520944118499756, -0.03646308556199074, -0.1451578438282013, -0.03060869313776493, 0.18004314601421356, 0.26892927289009094, 0.2624109089374542, -0.038095686584711075, -0.19084607064723969, 0.32760077714920044, -0.17503264546394348, -0.04054240137338638, 0.3087032735347748, -0.04299505427479744, -0.5261059403419495, -0.18911860883235931, -0.12142971903085709, -0.22211256623268127, 0.7011151909828186, -0.22609838843345642, -0.29559874534606934, -0.06053558737039566, 0.25626692175865173, 0.17563961446285248, 0.059527866542339325, 0.3047550916671753, 0.08234358578920364, 0.15286405384540558, -0.13324607908725739, -0.004287475720047951, -0.102374367415905, 0.06478206813335419, 0.4311840832233429, 0.1831563413143158, 0.04094678536057472, 0.22372278571128845, 0.6000960469245911, -0.3230539858341217, -0.5684217810630798, 0.08935755491256714, -0.17403224110603333, 0.47255608439445496, -0.2812414765357971, -0.3382606506347656, 0.6026033759117126, 0.008509397506713867, 0.14998513460159302, -0.01476278156042099, -0.11298727244138718, -0.08998821675777435, -0.03239799663424492, 0.2157362401485443, 0.06461893767118454, -0.023028094321489334, 0.39405062794685364, 0.11288349330425262, 0.3738104999065399, -0.2379721701145172, 0.2595841586589813, -0.020197536796331406, -0.29132625460624695, 0.17097827792167664, 0.25305691361427307, 0.22148653864860535, 0.23817908763885498, -0.23908665776252747, -0.11303099989891052, -0.08729196339845657, 0.25482305884361267, 0.3487703204154968, 0.5178343057632446, 0.016499843448400497, -0.18335282802581787, 0.03262663632631302, 0.24171528220176697, 0.54437255859375, 0.2670890986919403, -0.23406361043453217, 0.10909135639667511, -0.35281136631965637, -0.6642597913742065, -0.256530225276947, -0.07464335858821869, 0.1662081778049469, 0.1894787698984146, 0.3349687159061432, -0.12619361281394958, -0.23181302845478058, 0.17085064947605133, 0.43242114782333374, -0.11433815211057663, 0.02839365229010582, -0.29187852144241333, -0.3476203382015228, -0.18481963872909546, -0.25623905658721924, 0.253171443939209, 0.10432485491037369, -0.03186052292585373, -0.11199823021888733, -0.26521798968315125, -0.04429800808429718, -0.08088019490242004, -0.3258211314678192, 0.25773993134498596, -0.09040696173906326, -0.03703029081225395, 0.05155399069190025, 0.638791561126709, 0.13864769041538239, -0.17782367765903473, -0.04919213429093361, -0.02183886617422104, 0.06716979295015335, 0.022200755774974823, 0.035072244703769684, 0.3253536820411682, 0.06452971696853638, -0.08390320092439651, -0.253096342086792, 0.055032163858413696, -0.2333318442106247, 0.2487046867609024, 0.40066492557525635, -0.04113617539405823, -0.25124070048332214, -0.3740798532962799, 0.162683367729187, 0.13196441531181335, 0.21045561134815216, 0.3649628460407257, -0.41208869218826294, -0.18014003336429596, 0.40987586975097656, 0.501842200756073, 1.007948875427246, 0.057182975113391876, 0.5934227108955383, 0.280574232339859, -0.2529296278953552, 0.06941334158182144, 0.2964404225349426, 0.24702374637126923, -0.32261034846305847, -0.05493777245283127, -0.16469164192676544, -0.32287389039993286, -0.009645320475101471, -0.08727425336837769, -0.11297508329153061, 0.08910274505615234, -0.2853405177593231, 0.4633844792842865, 0.048054300248622894, -0.1964619755744934, -0.17427536845207214, -0.15158428251743317, 0.44960716366767883, 0.00415324792265892, -0.2027958780527115, 0.1755891591310501, -0.12681813538074493, 0.09131546318531036, -0.22721408307552338, -0.26924189925193787, -0.05254388973116875, -0.07374157011508942, -0.22187063097953796, -0.001289544627070427, 0.03305044025182724, -0.8752022981643677, 0.08952105045318604, 0.33851295709609985, -0.0607568621635437, 0.017952406778931618, 0.12254706770181656, 0.16873759031295776, 0.23094844818115234, 0.1653212457895279, 0.12147943675518036, -0.046386923640966415, 0.22425535321235657, -0.01345112919807434, 0.06584834307432175, 0.01622866839170456, 0.0175715871155262, -0.08541488647460938, -0.29378682374954224, 0.24621081352233887, 0.23400470614433289, -0.10401169210672379, -0.5460121631622314, -0.1609763354063034, 0.009583473205566406, -0.11078500747680664, 0.054541148245334625, 0.05185457691550255, 0.1824604719877243, 0.2720058858394623, 0.0057088471949100494, -0.3209064304828644, -0.12176494300365448, 0.3037436902523041, 0.012082552537322044, -0.2422909289598465, 0.2153235524892807, 0.12151391804218292, -0.3041730523109436, 0.014558684080839157, 0.11087744683027267, 0.09735207259654999, -0.6816446781158447, 0.14683634042739868, -0.11438442766666412, -0.14636974036693573, -0.5149976015090942, 0.24690255522727966, 0.057708241045475006, -0.08550932258367538, -0.2455100268125534, 0.12516401708126068, -0.25190678238868713, -0.06830801069736481, 0.10109101235866547, 0.3883271813392639, 0.25389519333839417, 0.1462046355009079, -0.026234865188598633, -0.2043524980545044, -0.18437829613685608, -0.06251060217618942, 0.44534409046173096, 0.3186626434326172, -0.23117861151695251, 0.07054678350687027, -0.012206561863422394, -0.11136519908905029, 0.005157463252544403, 0.2449231743812561, 0.09610004723072052, -0.043491166085004807, -0.25029247999191284, 0.18944771587848663, 0.004577368497848511, -0.25561991333961487, -0.029226042330265045, -0.23209817707538605, -0.130328968167305, -0.18612278997898102, 0.2054617553949356, 0.5419703125953674, -0.10303264856338501, 0.14182844758033752, -0.15212653577327728, -0.1338837742805481, 0.09099273383617401, -0.09632180631160736, -0.08072768151760101, 0.24959704279899597, 0.09091439098119736, 0.07917623966932297, -0.10874811559915543, -0.0796324759721756, 0.01649603247642517, 0.15992730855941772, -0.10843178629875183, 0.1766170859336853, 0.24718105792999268, -0.0645524188876152, 0.21898162364959717, -0.14784398674964905, 0.24205270409584045, -0.22408315539360046, -0.3140619695186615, -0.17847877740859985, 0.308061420917511, 0.03530943766236305, -0.13491666316986084, -0.10256747901439667, -0.23833686113357544, 0.24491621553897858, -0.022928867489099503, 0.18385379016399384, -0.10969969630241394, -0.037938009947538376, -0.23210982978343964, 0.015419799834489822, 0.31702253222465515, -0.3187776803970337, 0.018105506896972656, 0.4642723500728607, 0.010156985372304916, 0.3008468747138977, 0.5383952856063843, -0.04852287843823433, -0.03041508048772812, -0.05050069838762283, 0.49229860305786133, 0.5618897080421448, 0.49383437633514404, -0.0466410256922245, 0.21235406398773193, 0.1733357310295105, -0.39140617847442627, -0.2162364423274994, 0.16009753942489624, 0.4391176998615265, 0.06703206896781921, 0.28025978803634644, -0.40205779671669006, -0.321471244096756, 0.2808472514152527, -0.08670632541179657, -0.07033590227365494, 0.3412173092365265, -0.20752961933612823, 0.20395207405090332, 0.19561085104942322, -0.10820089280605316, -0.18291345238685608, 0.010222416371107101, 0.2448033094406128, 0.274425745010376, -0.1720690280199051, 0.06464128196239471, -0.005310390144586563, -0.1501534879207611, 0.2072802037000656, -0.04984843358397484, -0.03313671052455902, 0.16652464866638184, 0.09898896515369415, 0.1697891503572464, 0.44719216227531433, 0.34676817059516907, 0.40380117297172546, 0.01435684785246849, -0.030674263834953308, -0.030689626932144165, -0.07220062613487244, 0.08995217084884644, 0.186814084649086, 0.19787487387657166, -0.23891763389110565, 0.16963551938533783, 0.06727635115385056, -0.07549359649419785, 0.04060734808444977, 0.05075328052043915, -0.10140499472618103, -0.1444547027349472, 0.5064358115196228, -0.4408418536186218, -0.416035920381546, 0.016561366617679596, -0.034324489533901215, -0.2604881227016449, 0.15118466317653656, 0.6225836873054504, 0.1216750368475914, 0.14808952808380127, 0.11810668557882309, -0.010589112527668476, 0.25927481055259705, 0.14270757138729095, -0.09130911529064178, 0.30245837569236755, 0.058615297079086304, 0.10516014695167542, 0.06198333948850632, 0.21125224232673645, -0.038472484797239304, 0.07899035513401031, -0.04042815417051315, -0.10847843438386917, 0.15875153243541718, -0.12998269498348236, 0.38482189178466797, -0.07060795277357101, 0.3413641154766083, 0.3022494614124298, -0.025471806526184082, 0.15452489256858826, -0.03992640972137451, 0.23778307437896729, 0.01366320252418518, -0.3985693156719208, 0.09978984296321869, 0.17838908731937408, 0.10630420595407486, -0.46219682693481445, 0.005561500787734985, -0.029979601502418518, -0.047257378697395325, 0.1895054578781128, 0.015109322965145111, 0.2338317334651947, -0.21547400951385498, 0.10981463640928268, -0.10948427021503448, 0.08294258266687393, -0.05388679355382919, 0.0026705563068389893, -0.0805237740278244, 0.3162972927093506, 0.0701039731502533, -0.42226266860961914, -0.36512863636016846, 0.7840914130210876, 0.10596062242984772, -0.2032276690006256, -0.007836863398551941, 0.46253177523612976, -0.5977033972740173, -0.2896844744682312, 0.09747747331857681, 0.4625835418701172, 0.07869911193847656, -0.24602383375167847, -0.3353494107723236, -0.47590023279190063, 0.4845201373100281, -0.3458365499973297, -0.2314893901348114, 0.03114350512623787, 0.048589736223220825, 0.007699154317378998, 0.39060553908348083, -0.14215990900993347, -0.2648339867591858, 0.04416423290967941, -0.013042330741882324, -0.12329855561256409, -0.06563414633274078, 0.20525585114955902, -0.030111948028206825, -0.010087672621011734, 0.5426012277603149, 0.0939626544713974, -0.2817799150943756, -0.1259852647781372, -0.2672388553619385 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
Adding some more information, it seems to occur more frequently with large (millions of samples) datasets.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
16
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 Adding some more information, it seems to occur more frequently with large (millions of samples) datasets.
[ -0.3641052544116974, -0.007195755839347839, -0.07324476540088654, 0.16546952724456787, 0.3414561152458191, -0.19884690642356873, 0.07616081088781357, 0.03563354164361954, 0.1303383857011795, 0.10187119990587234, 0.2923227846622467, 0.45391708612442017, -0.27917852997779846, -0.01014036126434803, -0.34032732248306274, 0.11434400826692581, -0.052950285375118256, -0.06530006229877472, 0.13933996856212616, 0.13726989924907684, -0.32577139139175415, 0.28493303060531616, -0.13513123989105225, 0.1080482006072998, -0.16357357800006866, -0.2433682084083557, 0.43180766701698303, -0.07779362052679062, 0.20258544385433197, -0.3835974633693695, 0.12424775958061218, 0.053042612969875336, -0.1589081734418869, 0.753282904624939, -0.00012116116704419255, -0.05328992009162903, 0.32145023345947266, 0.12955066561698914, -0.4190693795681, -0.21531029045581818, -0.16255809366703033, 0.16429881751537323, 0.1272895783185959, 0.24891114234924316, 0.11184763163328171, 0.36258411407470703, -0.2831646502017975, -0.4807162880897522, 0.10614407807588577, 0.32107093930244446, 0.1384100466966629, 0.17893390357494354, -0.22460927069187164, -0.039869748055934906, 0.20809242129325867, 0.3277338743209839, -0.1768481433391571, 0.07521744817495346, 0.4212392568588257, -0.20945824682712555, 0.04875869303941727, 0.5053617358207703, -0.04948507994413376, -0.2802046537399292, 0.05369770526885986, -0.28146347403526306, 0.5100595355033875, -0.5448805093765259, 0.3330605924129486, 0.09074626863002777, 0.2206360101699829, -0.10916819423437119, -0.2208964228630066, -0.23917970061302185, -0.001695771235972643, -0.44045010209083557, 0.22963294386863708, -0.2017620950937271, -0.4019894599914551, 0.0863364189863205, -0.06539272516965866, -0.2859496772289276, -0.09682158380746841, 0.017526913434267044, -0.39927175641059875, 0.01912938803434372, -0.10512998700141907, 0.27293285727500916, -0.019502270966768265, -0.1899690479040146, 0.3010083734989166, -0.10855555534362793, 0.0732947587966919, 0.016912318766117096, -0.2781831622123718, 0.13408631086349487, 0.2910560965538025, -0.07126028090715408, -0.17073926329612732, 0.10085464268922806, -0.09091804176568985, 0.12745735049247742, 0.08762972801923752, 0.239976167678833, 0.24153141677379608, -0.27238166332244873, 0.166434645652771, 0.2526896297931671, 0.6369774341583252, 0.0342068187892437, -0.1826263666152954, -0.04867824167013168, 0.23935988545417786, -0.09435896575450897, 0.18206140398979187, -0.15630927681922913, 0.04051625728607178, -0.1475655436515808, -0.4412120282649994, 0.4890204966068268, -0.21162286400794983, 0.2928714156150818, 0.48648178577423096, 0.26914501190185547, 0.14228379726409912, 0.2085285186767578, 0.2272731512784958, -0.09673839807510376, -0.007294856011867523, 0.1419253796339035, -0.040615811944007874, -0.36207255721092224, 0.08446796238422394, -0.057280704379081726, 0.018010549247264862, -0.365048348903656, -0.022407671436667442, -0.0670229122042656, 0.2677304148674011, -0.20078550279140472, 0.14165495336055756, -0.17063336074352264, 0.3426247537136078, 0.8163967728614807, -0.11735045909881592, 0.3755537271499634, -0.04108970984816551, -0.37311726808547974, -0.031200885772705078, 0.19702479243278503, 0.09698347747325897, -0.1948089450597763, 0.0622420459985733, 0.13586026430130005, 0.03254077583551407, 0.27304574847221375, 0.17905530333518982, -0.008308567106723785, 0.33938834071159363, -0.21297334134578705, 0.3448992073535919, -0.42357850074768066, -0.2726706564426422, -0.16421057283878326, 0.18299852311611176, 0.351968377828598, -0.5150479674339294, 0.06113763153553009, -0.5620112419128418, 0.010870112106204033, 0.2001863718032837, 0.27080267667770386, 0.024576250463724136, 0.0999445915222168, -0.192257359623909, 0.094941645860672, 0.4933799207210541, 0.07530657947063446, -0.33487850427627563, 0.22606368362903595, -0.08184326440095901, 0.32850319147109985, -0.3193433880805969, -0.04168636351823807, 0.13785284757614136, -0.1363072246313095, 0.26608777046203613, 0.023334365338087082, -0.29614904522895813, -0.1361001431941986, -0.25995734333992004, 0.36590832471847534, 0.10233498364686966, -0.01665588840842247, 0.11390073597431183, -0.336119145154953, 0.03686211258172989, -0.2949253022670746, 0.04339415580034256, 0.259156733751297, 0.0375642329454422, 0.24396143853664398, 0.8158904910087585, -0.09774014353752136, -0.027589643374085426, -0.374332070350647, -0.01880362629890442, 0.259671151638031, -0.05207452178001404, -0.35965272784233093, -0.2999732494354248, -0.2111922800540924, -0.1467113494873047, 0.5431210994720459, 0.002559676766395569, -0.06923753023147583, -0.0032530874013900757, -0.13208501040935516, 0.021453969180583954, 0.09292629361152649, -0.05644028261303902, 0.21214546263217926, -0.17924202978610992, 0.029970020055770874, 0.07763094455003738, 0.33687227964401245, 0.18308411538600922, -0.2377357929944992, -0.3631996810436249, 0.06668255478143692, -0.004464291036128998, 0.011106634512543678, -0.18918246030807495, 0.3763163983821869, 0.23572884500026703, -0.18622387945652008, -0.05718933045864105, -0.09229253232479095, 0.1068958193063736, 0.15861734747886658, -0.13413038849830627, 0.1061212420463562, 0.17963539063930511, -0.14898714423179626, -0.011876538395881653, 0.21311703324317932, -0.060347121208906174, 0.44798415899276733, -0.027250807732343674, 0.20449860394001007, 0.45020562410354614, 0.3306584060192108, -0.20564091205596924, -0.15008249878883362, 0.33520403504371643, -0.13704843819141388, 0.1349755972623825, 0.05448928475379944, -0.39941826462745667, 0.35397741198539734, 0.32330724596977234, 0.012775540351867676, -0.010289080440998077, 0.39291152358055115, -0.03213395178318024, 0.04846128821372986, 0.11029262840747833, 0.15240737795829773, 0.43265998363494873, 0.03189800679683685, 0.07544358819723129, -0.20132075250148773, -0.32868775725364685, -0.20612841844558716, 0.17250654101371765, 0.26279860734939575, 0.06990988552570343, 0.3715015649795532, 0.2542371451854706, 0.10155855864286423, -0.1376773715019226, -0.21262745559215546, 0.013140128925442696, 0.21424748003482819, -0.17715157568454742, 0.32534343004226685, -0.18432274460792542, -0.2449761927127838, 0.10673098266124725, -0.03279104456305504, -0.4077339172363281, -0.4629096984863281, 0.06863600015640259, 0.26523277163505554, -0.20610831677913666, 0.1874186098575592, -0.032213300466537476, 0.48967790603637695, 0.24426843225955963, -0.15401583909988403, -0.47809937596321106, -0.2776768207550049, -0.2624826431274414, -0.07755744457244873, 0.277373343706131, 0.055720556527376175, 0.4374134838581085, 0.311585009098053, -0.0598130077123642, -0.19273625314235687, -0.4873618483543396, 0.14180046319961548, 0.0015149004757404327, 0.5693771839141846, 0.2858814001083374, 0.1787947714328766, -0.13922064006328583, 0.06394589692354202, 0.15740206837654114, -0.15277016162872314, -0.01123109646141529, 0.19567567110061646, 0.054456017911434174, 0.034811824560165405, -0.42849084734916687, 0.22604140639305115, -0.24915359914302826, -0.40243056416511536, 0.13684482872486115, -0.38260456919670105, -0.09173306822776794, 0.15230874717235565, 0.07238992303609848, 0.009435826912522316, -0.3031879961490631, -0.12658776342868805, -0.24715115129947662, 0.060811299830675125, 0.12366800010204315, -0.07339935749769211, -0.1088269054889679, 0.10632796585559845, -0.0192433949559927, 0.012978706508874893, 0.1800340861082077, -0.6803299784660339, 0.027245495468378067, -0.17250755429267883, 0.1378045231103897, 0.04592115804553032, -0.19147889316082, 0.1909799426794052, 0.037270959466695786, 0.03698909282684326, -0.10604918003082275, -0.2891736626625061, -0.02538946270942688, 0.000453166663646698, 0.23459851741790771, -0.044194065034389496, 0.8586364388465881, 0.07526399195194244, 0.4736670255661011, 0.27478575706481934, -0.08382284641265869, -0.15031009912490845, 0.16235864162445068, 0.5090163946151733, -0.07402964681386948, -0.23548519611358643, -0.09494754672050476, -0.1211717426776886, -0.4702910780906677, -0.09123644232749939, 0.10579605400562286, -0.22868958115577698, 0.040777288377285004, 0.168341726064682, 0.09285008162260056, -0.45744824409484863, 0.12243707478046417, -0.2288224995136261, 0.34165987372398376, 0.09249654412269592, 0.04113927483558655, -0.15042510628700256, 0.051832739263772964, -0.03245304152369499, 0.3389196991920471, 0.37854504585266113, -0.18900062143802643, -0.14736604690551758, -0.24755609035491943, -0.36343908309936523, 0.26015448570251465, 0.20702750980854034, 0.5021674036979675, -0.3711015582084656, -0.07876716554164886, 0.08166906982660294, -0.14354725182056427, 0.6286781430244446, -0.3764110207557678, -0.23406799137592316, 0.2372487485408783, -0.12258507311344147, -0.6083980202674866, 0.03752697631716728, -0.09028470516204834, 0.3699451684951782, 0.28889861702919006, 0.38999807834625244, -0.06098543852567673, -0.17795729637145996, -0.06036680191755295, 0.14423604309558868, -0.21916885673999786, -0.07128968089818954, -0.19160641729831696, -0.3589668273925781, -0.07449741661548615, 0.38578203320503235, 0.22988252341747284, -0.058061517775058746, -0.12594002485275269, -0.31780216097831726, 0.05698949098587036, -0.4432855546474457, -0.01538792997598648, 0.21737901866436005, 0.07139434665441513, -0.143987238407135, 0.4039764702320099, -0.04234173148870468, -0.26452404260635376, 0.0720706507563591, 0.2963445782661438, -0.379854291677475, -0.24758589267730713, 0.2692818343639374, -0.005523907020688057, 0.35695648193359375, 0.5414955615997314, -0.2857314348220825, 0.3404088318347931, -0.23391729593276978, 0.21426843106746674, 0.0658479556441307, 0.05415975674986839, 0.07753150910139084, 0.29977989196777344, -0.26146623492240906, 0.0804983526468277, 0.1472921073436737, 0.2570452392101288, -0.19603803753852844, 0.7897716760635376, -0.2153702825307846, -0.14775456488132477, 0.2604979872703552, -0.020643316209316254, 0.7402245998382568, 0.1174900084733963, -0.09536053240299225, 0.02457277663052082, -0.1732083410024643, -0.05392712354660034, -0.02710338495671749, 0.0950724259018898, -0.01774105802178383, -0.4656584560871124, -0.017201749607920647, -0.25557756423950195, 0.29530593752861023, -0.08015665411949158, -0.005378909409046173, 0.06556602567434311, -0.3127480149269104, 0.2339744120836258, 0.21957193315029144, -0.10531377047300339, -0.035970643162727356, -0.08461405336856842, -0.3430706858634949, 0.06673253327608109, 0.24119895696640015, -0.07697166502475739, -0.17450016736984253, 0.06817281246185303, 0.317696750164032, -0.12262406945228577, -0.43666398525238037, -0.12795490026474, -0.3951786458492279, -0.028401292860507965, 0.3278045058250427, -0.20265132188796997, 0.13200534880161285, -0.3070177733898163, -0.17737756669521332, 0.2891656160354614, 0.0881321057677269, 0.35107654333114624, 0.31460073590278625, 0.3915441334247589, 0.23008589446544647, -0.02115209773182869, 0.21317119896411896, 0.08144503831863403, 0.047852300107479095, 0.3019086718559265, -0.34373903274536133, -0.2015952318906784, 0.14211076498031616, 0.20479537546634674, -0.010775633156299591, -0.021041758358478546, 0.17477671802043915, -0.1220790296792984, -0.17856594920158386, -0.2998557984828949, 0.08240199089050293, 0.23630072176456451, 0.004276464693248272, 0.4505693018436432, -0.17627747356891632, -0.23959176242351532, -0.13661879301071167, 0.11699900031089783, -0.39412978291511536, 0.1693560928106308, 0.08279278129339218, 0.12661007046699524, -0.4059777855873108, -0.29105979204177856, 0.1135459914803505, -0.22106577455997467, -0.3462006449699402, 0.45508450269699097, -0.21460111439228058, -0.11620203405618668, 0.37059733271598816, -0.19912376999855042, 0.005839783698320389, -0.4294610023498535, -0.5180812478065491, -0.5285107493400574, -0.10577074438333511, -0.12253092229366302, 0.28044092655181885, 0.12790387868881226, -0.2720542550086975, 0.040865398943424225, -0.2450440675020218, -0.05726419389247894, -0.20342853665351868, -0.20239640772342682, -0.12560854852199554, 0.18983714282512665, -0.10435450077056885, 0.0931963324546814, 0.16234341263771057, -0.26623234152793884, 0.0006223265081644058, 0.3331913948059082, -0.10791721194982529, -0.13174086809158325, -0.04318812116980553, 0.20641100406646729, -0.057788923382759094, -0.15582865476608276, 0.07193677127361298, -0.18904663622379303, 0.0208266768604517, -0.10733187198638916, 0.14102089405059814, -0.1567918062210083, -0.13375812768936157, -0.3977019786834717, 0.05850250646471977, 0.2404344379901886, 0.29987436532974243, 0.43793603777885437, -0.10935568809509277, 0.17258545756340027, 0.14212283492088318, 0.20458827912807465, 0.0009667298290878534, -0.08461116999387741, -0.10920368880033493, -0.09298811107873917, -0.2612984776496887, -0.09873642772436142, 0.5622304081916809, -0.1926722377538681, -0.08414755761623383, 0.30492106080055237, 0.2855338454246521, 0.6209412217140198, -0.23775352537631989, -0.0179744865745306, 0.21201938390731812, 0.11066532880067825, -0.2812363803386688, 0.021245267242193222, -0.15429385006427765, 0.417374849319458, 0.11713287234306335, 0.20550742745399475, -0.04053695499897003, -0.0956265777349472, 0.46809399127960205, 0.4768059253692627, 0.4549024999141693, -0.07756134867668152, -0.06142924353480339, 0.3384375274181366, 0.09927839040756226, 0.06781533360481262, 0.2909083962440491, -0.0401187427341938, 0.1022191122174263, 0.44912034273147583, 0.0860423594713211, 0.11584299057722092, 0.15415692329406738, 0.16022346913814545, 0.11456041038036346, -0.2951021194458008, -0.09621895849704742, -0.031155019998550415, -0.4398847222328186, 0.11871382594108582, 0.1952732801437378, -0.2799503803253174, -0.2879014313220978, -0.22400648891925812, 0.03891943395137787, 0.31183063983917236, -0.26150164008140564, -0.02882421389222145, -0.08534941077232361, -0.137482151389122, 0.05498550832271576, -0.14159420132637024, 0.18999475240707397, 0.04270952194929123, 0.34753963351249695, 0.17249029874801636, 0.12676483392715454, -0.28979116678237915, -0.4155060350894928, -0.16821065545082092, 0.20210105180740356, -0.21022959053516388, 0.12770630419254303, 0.2610117197036743, -0.09952442348003387, 0.006638754159212112, -0.28641143441200256, 0.4137372076511383, 0.3210078775882721, -0.4638623297214508, 0.11091378331184387, -0.23943059146404266, -0.032684314996004105, -0.15459159016609192, 0.3724827468395233, -0.09959438443183899, 0.023335326462984085, 0.13743621110916138, 0.0900089293718338, -0.10225037485361099, 0.10477732121944427, 0.23125557601451874, 0.5905151963233948, -0.3488595485687256, 0.3921439051628113, 0.0662679374217987, 0.26095452904701233, -0.16926345229148865, -0.07236149162054062, -0.16786879301071167, -0.15737929940223694, 0.7602772116661072, -0.20706084370613098, 0.12167052179574966, -0.030587226152420044, 0.06080269068479538, -0.1427638679742813, 0.3156108260154724, 0.2648935616016388, -0.06264510005712509, -0.15209434926509857, -0.07807254791259766, -0.47864654660224915, -0.11055736988782883, -0.15738070011138916, -0.0412786602973938, 0.1283431351184845, 0.04340093582868576, -0.08496449142694473, 0.13601170480251312, 0.2401309758424759, -0.04508007690310478, 0.14129792153835297, 0.15295857191085815, -0.32259905338287354, -0.15020915865898132, -0.25967055559158325, -0.21392597258090973, -0.026763541623950005, -0.2866065800189972, 0.10739797353744507, -0.17633967101573944, 0.06326096504926682, -0.07573830336332321, -0.5492552518844604, 0.21008384227752686, 0.440100759267807, 0.23097087442874908, 0.25802138447761536, 0.08154859393835068, 0.05821608006954193, -0.06584574282169342, -0.010860402137041092, -0.22029012441635132, 0.05964139476418495, 0.03239990770816803, -0.055719468742609024, 0.13838084042072296, -0.1726425737142563, -0.34116390347480774, -0.19158576428890228, -0.0559866838157177, 0.05989914387464523, 0.1527594029903412, -0.1539749950170517, 0.11721348017454147, -0.18278199434280396, 0.17942431569099426, -0.0396697074174881, 0.19676893949508667, 0.14300861954689026, 0.2128763049840927, -0.1748843789100647, -0.29090258479118347, 0.7315102815628052, -0.47188234329223633, -0.3282804489135742, -0.1390465795993805, 0.1773127168416977, -0.05082324892282486, -0.3606858253479004, -0.22097525000572205, -0.4622683823108673, 0.3388691842556, -0.16179487109184265, -0.16813556849956512, -0.19187188148498535, -0.01851825788617134, 0.06544451415538788, -0.2200562208890915, 0.337614506483078, 0.026286479085683823, -0.006134718656539917, 0.23424476385116577, -0.1642613559961319 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
More information. My code is structured as (1) load (2) map (3) filter (4) filter. It was always the second filter that failed. Combining the two filters into one seems to reliably work.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
33
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 More information. My code is structured as (1) load (2) map (3) filter (4) filter. It was always the second filter that failed. Combining the two filters into one seems to reliably work.
[ -0.30096885561943054, 0.025974690914154053, -0.05257938429713249, 0.209523543715477, 0.375465989112854, -0.19390548765659332, 0.14301086962223053, 0.05488806962966919, 0.15424707531929016, 0.051871493458747864, 0.23899009823799133, 0.46147820353507996, -0.2146490216255188, -0.030090421438217163, -0.308720201253891, 0.11141428351402283, -0.05137144774198532, -0.027852535247802734, 0.09920532256364822, 0.16036219894886017, -0.31550318002700806, 0.31906208395957947, -0.07375776767730713, 0.06822433322668076, -0.16136333346366882, -0.19845050573349, 0.3506876230239868, -0.055468738079071045, 0.23214615881443024, -0.3872288763523102, 0.17473307251930237, 0.09189800918102264, -0.158981055021286, 0.7728318572044373, -0.00012215861352160573, -0.048993345350027084, 0.2929975986480713, 0.12350521981716156, -0.3755955398082733, -0.24063752591609955, -0.13944467902183533, 0.1744401752948761, 0.145685076713562, 0.27434006333351135, 0.11740005761384964, 0.3826848566532135, -0.28081902861595154, -0.4809176027774811, 0.13626059889793396, 0.26279085874557495, 0.11406257003545761, 0.15805135667324066, -0.22035719454288483, -0.03928728029131889, 0.1641240119934082, 0.28386151790618896, -0.16569411754608154, 0.13843661546707153, 0.434283584356308, -0.2319408506155014, 0.019963286817073822, 0.5094873309135437, -0.05182543396949768, -0.25189635157585144, 0.08333361148834229, -0.24030376970767975, 0.5391090512275696, -0.5808919668197632, 0.33189642429351807, 0.0920325368642807, 0.20920655131340027, -0.09599516540765762, -0.22718577086925507, -0.26979389786720276, -0.03251415863633156, -0.4062412977218628, 0.28226906061172485, -0.267789363861084, -0.38243889808654785, 0.07415178418159485, -0.07174315303564072, -0.24850736558437347, -0.041726842522621155, 0.05506334453821182, -0.38524794578552246, -0.04195006191730499, -0.08287345618009567, 0.3195290267467499, 0.020513303577899933, -0.18099017441272736, 0.337434858083725, -0.15232278406620026, 0.1027972549200058, 0.03388305753469467, -0.32043957710266113, 0.14981448650360107, 0.3232991695404053, -0.10623154789209366, -0.19607844948768616, 0.0479617714881897, -0.068362757563591, 0.10694851726293564, 0.06813041865825653, 0.20779916644096375, 0.27464762330055237, -0.26693224906921387, 0.15346196293830872, 0.26842108368873596, 0.5857107043266296, 0.036327388137578964, -0.1975456178188324, -0.042980439960956573, 0.24440234899520874, -0.10406513512134552, 0.1812961846590042, -0.16345423460006714, 0.049591951072216034, -0.1396210491657257, -0.42950439453125, 0.47244682908058167, -0.1920422613620758, 0.2642308175563812, 0.4783410429954529, 0.30072543025016785, 0.15600045025348663, 0.23237979412078857, 0.23530124127864838, -0.08080491423606873, 0.010758193209767342, 0.15972398221492767, -0.0183846615254879, -0.3211318254470825, 0.06035919114947319, -0.029206758365035057, 0.05059153959155083, -0.39093050360679626, -0.019128460437059402, -0.06561914831399918, 0.27152761816978455, -0.22173044085502625, 0.10742265731096268, -0.216525599360466, 0.307129830121994, 0.8158303499221802, -0.11954180896282196, 0.4207235872745514, -0.05083439126610756, -0.32520514726638794, -0.04394644871354103, 0.16144345700740814, 0.07767060399055481, -0.14577676355838776, 0.13695575296878815, 0.10111087560653687, 0.039734259247779846, 0.30879002809524536, 0.16119898855686188, 0.025596050545573235, 0.34990358352661133, -0.24409344792366028, 0.2730676829814911, -0.4093296527862549, -0.2902836501598358, -0.19259032607078552, 0.1883433759212494, 0.4012463688850403, -0.4953748285770416, 0.07031428813934326, -0.5434926748275757, 0.042939506471157074, 0.17385002970695496, 0.2965722680091858, 0.004671657457947731, 0.1252301186323166, -0.19967857003211975, 0.1174946129322052, 0.47834762930870056, 0.050805848091840744, -0.35387739539146423, 0.2792864143848419, -0.08162063360214233, 0.3387176990509033, -0.308604896068573, -0.043642621487379074, 0.14126715064048767, -0.1542597860097885, 0.28863853216171265, 0.024724703282117844, -0.3426612317562103, -0.1345282346010208, -0.24623599648475647, 0.36971092224121094, 0.10707482695579529, -0.0060401055961847305, 0.13190056383609772, -0.3226602077484131, 0.02749510109424591, -0.3099173605442047, 0.03481852263212204, 0.24974581599235535, 0.06779252737760544, 0.23846325278282166, 0.7277433276176453, -0.09671410918235779, -0.04824119433760643, -0.3249399960041046, -0.09997264295816422, 0.29571595788002014, -0.07601626217365265, -0.37275996804237366, -0.29844987392425537, -0.17120946943759918, -0.14105954766273499, 0.4908134341239929, 0.0005858615040779114, -0.07880675792694092, -0.021499663591384888, -0.08057886362075806, -0.023084495216608047, 0.028156567364931107, -0.09993460029363632, 0.296235591173172, -0.1603628545999527, 0.011845690198242664, 0.08403554558753967, 0.36405667662620544, 0.15298590064048767, -0.26884639263153076, -0.3229370713233948, 0.05970048904418945, 0.051693931221961975, 0.0011676104040816426, -0.18075639009475708, 0.37999436259269714, 0.19311287999153137, -0.13444317877292633, -0.05958935618400574, -0.1455370932817459, 0.09643037617206573, 0.18517546355724335, -0.15777894854545593, 0.08031569421291351, 0.17544490098953247, -0.21804320812225342, -0.006302341818809509, 0.1758469045162201, -0.08128505945205688, 0.45559269189834595, -0.04008107632398605, 0.19047428667545319, 0.38646504282951355, 0.2877862751483917, -0.2093004286289215, -0.13172125816345215, 0.34566959738731384, -0.09043404459953308, 0.15629076957702637, 0.10064386576414108, -0.38213837146759033, 0.3735177516937256, 0.35029885172843933, 0.00041000545024871826, -0.04429742693901062, 0.36772844195365906, 0.012563236057758331, 0.031660351902246475, 0.10878241807222366, 0.15285463631153107, 0.47633492946624756, 0.0015955017879605293, 0.06268317997455597, -0.20159752666950226, -0.35460954904556274, -0.15360260009765625, 0.13384371995925903, 0.24705013632774353, 0.11562452465295792, 0.3744722008705139, 0.25733235478401184, 0.11552736908197403, -0.13308635354042053, -0.20987217128276825, 0.05451110750436783, 0.18324151635169983, -0.20850810408592224, 0.32841238379478455, -0.1475391834974289, -0.18156033754348755, 0.11190036684274673, -0.08143901824951172, -0.3972732424736023, -0.446892648935318, 0.04132138192653656, 0.28606557846069336, -0.21107500791549683, 0.17622990906238556, -0.02919895201921463, 0.439718097448349, 0.20218341052532196, -0.2027176469564438, -0.46977996826171875, -0.25442343950271606, -0.22395601868629456, -0.10121504962444305, 0.3328094780445099, 0.03989456593990326, 0.37782615423202515, 0.311493456363678, -0.12378771603107452, -0.15350526571273804, -0.4504591226577759, 0.13451384007930756, -0.05563592165708542, 0.5857588052749634, 0.2732170820236206, 0.2151012420654297, -0.21115422248840332, 0.036493655294179916, 0.20336218178272247, -0.15469542145729065, 0.005620565265417099, 0.18293462693691254, 0.05068734288215637, 0.039655014872550964, -0.42103448510169983, 0.17230480909347534, -0.2143460363149643, -0.4251726567745209, 0.14595162868499756, -0.4265768527984619, -0.06925299763679504, 0.10761634260416031, 0.11360860615968704, -0.031220771372318268, -0.3292093575000763, -0.10440371930599213, -0.24491094052791595, 0.04342447593808174, 0.16030853986740112, -0.06284154206514359, -0.13911402225494385, 0.09257999062538147, 0.011162158101797104, 0.07125693559646606, 0.1894683539867401, -0.6648298501968384, 0.04576732963323593, -0.13448566198349, 0.14358046650886536, 0.052386071532964706, -0.20131351053714752, 0.22288542985916138, 0.07150314003229141, 0.04726797342300415, -0.1399991810321808, -0.2946108877658844, -0.009020477533340454, 0.04762345552444458, 0.20578987896442413, -0.020114347338676453, 0.8640382289886475, 0.04926953837275505, 0.49697935581207275, 0.2915009558200836, -0.09894134104251862, -0.08908860385417938, 0.20817433297634125, 0.49567803740501404, -0.07795483618974686, -0.26852157711982727, -0.11163496971130371, -0.13077294826507568, -0.3903483748435974, -0.06302830576896667, 0.11525111645460129, -0.2339005321264267, 0.006894584745168686, 0.1622147113084793, 0.019262857735157013, -0.47201621532440186, 0.16141638159751892, -0.21171456575393677, 0.32021859288215637, 0.08506955206394196, 0.0446932390332222, -0.17332518100738525, 0.07559729367494583, -0.026825064793229103, 0.3083009123802185, 0.396596223115921, -0.17545580863952637, -0.12882019579410553, -0.1855579912662506, -0.4121467173099518, 0.23828920722007751, 0.16878460347652435, 0.4625513553619385, -0.38421401381492615, -0.0472831055521965, 0.08073920756578445, -0.18059910833835602, 0.6909501552581787, -0.35861724615097046, -0.22301216423511505, 0.2559245228767395, -0.19092322885990143, -0.6666409373283386, 0.05174770578742027, -0.019785495474934578, 0.36627814173698425, 0.3136346936225891, 0.4360519051551819, -0.14041383564472198, -0.18884789943695068, -0.06975764781236649, 0.1373247653245926, -0.19300009310245514, -0.10857773572206497, -0.17160958051681519, -0.37171903252601624, -0.07433123886585236, 0.33237284421920776, 0.24337105453014374, -0.03896127641201019, -0.126174196600914, -0.3240571916103363, 0.08765365928411484, -0.448275625705719, 0.02968280017375946, 0.21189652383327484, 0.06563811749219894, -0.10597323626279831, 0.4411090910434723, -0.0029572956264019012, -0.26614460349082947, 0.07852375507354736, 0.32379305362701416, -0.374249130487442, -0.23328617215156555, 0.3014112710952759, -0.016903933137655258, 0.35564401745796204, 0.5865715742111206, -0.26659828424453735, 0.28037288784980774, -0.23391291499137878, 0.1725422441959381, 0.10084401071071625, 0.057121314108371735, 0.08292344957590103, 0.25257858633995056, -0.24072742462158203, 0.0465383380651474, 0.17597201466560364, 0.22059179842472076, -0.2228427529335022, 0.8381843566894531, -0.2753065228462219, -0.1863018125295639, 0.25311923027038574, -0.019324027001857758, 0.7733656764030457, 0.06057267263531685, -0.12404592335224152, 0.016982492059469223, -0.1795457899570465, -0.06576956808567047, -0.04494571313261986, 0.09593448042869568, -0.015139691531658173, -0.46882450580596924, -0.04105614870786667, -0.23370365798473358, 0.2765626013278961, -0.03545322269201279, -0.025220166891813278, 0.09553158283233643, -0.268022358417511, 0.27314072847366333, 0.22492271661758423, -0.07994245737791061, -0.026093626394867897, -0.139912948012352, -0.403855562210083, 0.04197344928979874, 0.25403887033462524, -0.0943673700094223, -0.179843932390213, 0.05103372782468796, 0.26614463329315186, -0.12222378700971603, -0.3837709426879883, -0.09912168979644775, -0.41374507546424866, -0.03979920595884323, 0.2828942537307739, -0.17515933513641357, 0.12380336225032806, -0.2408890426158905, -0.18985988199710846, 0.20450855791568756, 0.07693219929933548, 0.32861053943634033, 0.32752594351768494, 0.39986452460289, 0.1870238184928894, -0.09789768606424332, 0.21101215481758118, 0.08710133284330368, 0.05668719857931137, 0.29005372524261475, -0.35720762610435486, -0.22817759215831757, 0.14022418856620789, 0.23858778178691864, -0.05567420274019241, -0.039577387273311615, 0.16154147684574127, -0.06816622614860535, -0.1289484202861786, -0.31401267647743225, 0.05919552221894264, 0.22988641262054443, 0.03222550079226494, 0.4478714168071747, -0.18982087075710297, -0.2365739792585373, -0.13138246536254883, 0.12112517654895782, -0.37297454476356506, 0.18142476677894592, 0.07943108677864075, 0.14364689588546753, -0.38352465629577637, -0.2670045793056488, 0.03651328384876251, -0.19159479439258575, -0.35842132568359375, 0.4719485938549042, -0.24003879725933075, -0.12899711728096008, 0.339489609003067, -0.1964610517024994, 0.023783821612596512, -0.4100830554962158, -0.48841506242752075, -0.5394426584243774, -0.14582295715808868, -0.12795881927013397, 0.2906995713710785, 0.1216650903224945, -0.2657703757286072, 0.09671707451343536, -0.20779800415039062, 0.02440522238612175, -0.1889842450618744, -0.18399067223072052, -0.11747236549854279, 0.21183635294437408, -0.08070561289787292, 0.08724695444107056, 0.18482176959514618, -0.2645386755466461, -0.027408499270677567, 0.32341551780700684, -0.1295991986989975, -0.10061721503734589, -0.02650051936507225, 0.22570116817951202, -0.05577152222394943, -0.12686851620674133, 0.06605089455842972, -0.22968128323554993, 0.01800299435853958, -0.17149542272090912, 0.14962443709373474, -0.14519545435905457, -0.18026189506053925, -0.4565582871437073, 0.11964146792888641, 0.232679545879364, 0.26742488145828247, 0.45597609877586365, -0.14038024842739105, 0.14500391483306885, 0.13070614635944366, 0.19839924573898315, 0.01538116205483675, -0.09338827431201935, -0.06207339093089104, -0.09003863483667374, -0.253625750541687, -0.14671534299850464, 0.5602627396583557, -0.1772746592760086, -0.10759668052196503, 0.3001296818256378, 0.3096587359905243, 0.632442057132721, -0.23631657660007477, 0.02869277633726597, 0.13085973262786865, 0.07341788709163666, -0.2772250175476074, 0.06526254117488861, -0.12094476819038391, 0.3999377191066742, 0.1264885812997818, 0.21357494592666626, -0.027676714584231377, -0.1288738250732422, 0.43757164478302, 0.49402594566345215, 0.4848702549934387, -0.06717130541801453, -0.08133098483085632, 0.3251012861728668, 0.10846276581287384, 0.10265141725540161, 0.3589046597480774, -0.06328146159648895, 0.08199656009674072, 0.42708832025527954, 0.04545562341809273, 0.10339047014713287, 0.10347980260848999, 0.18840347230434418, 0.10274603962898254, -0.32892629504203796, -0.05863230302929878, 0.047776028513908386, -0.42500436305999756, 0.0930154025554657, 0.21899718046188354, -0.26500165462493896, -0.2729077637195587, -0.2841707170009613, 0.026987778022885323, 0.3925328850746155, -0.2573596239089966, -0.04432494565844536, -0.10342072695493698, -0.14583104848861694, 0.0681249350309372, -0.11628846824169159, 0.18429721891880035, 0.006772119551897049, 0.46970778703689575, 0.19035716354846954, 0.08838101476430893, -0.3011714816093445, -0.4367498457431793, -0.14673903584480286, 0.19543102383613586, -0.22518035769462585, 0.18314753472805023, 0.25313666462898254, -0.11671243607997894, 0.017261508852243423, -0.26906341314315796, 0.4113211929798126, 0.3193008303642273, -0.46408069133758545, 0.12222251296043396, -0.2062627077102661, -0.024633636698126793, -0.16428712010383606, 0.36156418919563293, -0.10662694275379181, 0.049915820360183716, 0.1683812290430069, 0.0766650065779686, -0.10595964640378952, 0.07071812450885773, 0.223621666431427, 0.6148040890693665, -0.37629786133766174, 0.396469384431839, 0.08237136155366898, 0.258842796087265, -0.1255979984998703, -0.06941577047109604, -0.1826280951499939, -0.16212546825408936, 0.754782497882843, -0.23229670524597168, 0.12244433909654617, -0.03305180370807648, 0.0519196018576622, -0.13025353848934174, 0.29142627120018005, 0.27430209517478943, -0.058776214718818665, -0.2385120987892151, -0.10148560255765915, -0.5146155953407288, -0.1583867371082306, -0.15869133174419403, -0.0011819284409284592, 0.1437741369009018, 0.054655522108078, -0.046583391726017, 0.14152124524116516, 0.2831296920776367, -0.05358556658029556, 0.16072607040405273, 0.16210326552391052, -0.33076807856559753, -0.1543670892715454, -0.29140472412109375, -0.1837928295135498, -0.028233997523784637, -0.29660162329673767, 0.12556777894496918, -0.17932726442813873, 0.05268048495054245, -0.06832718104124069, -0.5547984838485718, 0.23205268383026123, 0.4138574004173279, 0.27815693616867065, 0.24477697908878326, 0.11221478134393692, 0.0708414614200592, -0.07425353676080704, -0.041269030421972275, -0.21369574964046478, 0.073931984603405, 0.012047998607158661, -0.0403679795563221, 0.175181046128273, -0.2442183643579483, -0.3360767662525177, -0.22657394409179688, -0.07179304957389832, 0.05392506718635559, 0.21050745248794556, -0.15237028896808624, 0.13049209117889404, -0.16811369359493256, 0.19783887267112732, -0.04998645931482315, 0.24419358372688293, 0.1057111918926239, 0.23966912925243378, -0.23796658217906952, -0.28934916853904724, 0.7331467866897583, -0.5382388234138489, -0.33887431025505066, -0.1593492180109024, 0.13479852676391602, -0.0826859101653099, -0.321270227432251, -0.27183204889297485, -0.45151934027671814, 0.32530927658081055, -0.10763861984014511, -0.23458929359912872, -0.21262647211551666, -0.061802636831998825, 0.06622201204299927, -0.23623137176036835, 0.3190354108810425, 0.045805707573890686, -0.04482799395918846, 0.18302254378795624, -0.16361688077449799 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
@lhoestq it'd be great if someone had a chance to look at this. I suspect it is impacting many users given the other issue that I linked.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
27
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 @lhoestq it'd be great if someone had a chance to look at this. I suspect it is impacting many users given the other issue that I linked.
[ -0.34762248396873474, 0.039869070053100586, -0.0791807770729065, 0.15619516372680664, 0.34971868991851807, -0.21276172995567322, 0.09959705173969269, 0.06106945872306824, 0.08661285042762756, 0.0801413506269455, 0.2603830397129059, 0.4729067087173462, -0.2593030333518982, 0.03419654816389084, -0.3031098544597626, 0.12562397122383118, -0.05341487377882004, -0.09160983562469482, 0.09250562638044357, 0.13876546919345856, -0.30213791131973267, 0.2734171152114868, -0.10337825119495392, 0.06522051244974136, -0.19676423072814941, -0.2201472967863083, 0.41489657759666443, -0.07009073346853256, 0.19433042407035828, -0.4089694619178772, 0.12501908838748932, 0.08165064454078674, -0.19538497924804688, 0.7429718971252441, -0.0001183380518341437, -0.05977949500083923, 0.3079557418823242, 0.16053833067417145, -0.41901931166648865, -0.23780588805675507, -0.12260602414608002, 0.13702642917633057, 0.16980502009391785, 0.2608608901500702, 0.07454787194728851, 0.353514701128006, -0.28174009919166565, -0.44406017661094666, 0.12138400226831436, 0.2890965938568115, 0.16958943009376526, 0.1899426281452179, -0.23407450318336487, -0.0667327418923378, 0.16827097535133362, 0.29634302854537964, -0.1983078271150589, 0.08985751867294312, 0.434426873922348, -0.21456378698349, 0.03130068629980087, 0.515662670135498, -0.008020877838134766, -0.23335112631320953, 0.07123266905546188, -0.2582405209541321, 0.4659821689128876, -0.5628060102462769, 0.3328649401664734, 0.10065504908561707, 0.2667243480682373, -0.08620242029428482, -0.24373914301395416, -0.24541515111923218, 0.013104128651320934, -0.4374472200870514, 0.2436428964138031, -0.19874349236488342, -0.4180867671966553, 0.0730980783700943, -0.1051425188779831, -0.24265578389167786, -0.062281474471092224, -0.026593215763568878, -0.3883776366710663, 0.013581104576587677, -0.11428835988044739, 0.2518024742603302, -0.0005192160606384277, -0.1785261332988739, 0.3275173008441925, -0.11755348742008209, 0.06386693567037582, 0.01917257346212864, -0.3249469995498657, 0.11735479533672333, 0.2724476456642151, -0.05196381360292435, -0.18309277296066284, 0.10464420914649963, -0.06994614005088806, 0.15024052560329437, 0.0693424642086029, 0.1994064748287201, 0.2607669234275818, -0.2579749822616577, 0.12914243340492249, 0.22856223583221436, 0.6417202949523926, 0.027077673003077507, -0.1782463937997818, -0.05868857353925705, 0.24664919078350067, -0.1361064612865448, 0.16948792338371277, -0.19790968298912048, 0.04048394411802292, -0.18504412472248077, -0.4317440390586853, 0.4472430348396301, -0.18406972289085388, 0.2644503712654114, 0.46569380164146423, 0.2665679454803467, 0.13162675499916077, 0.23665779829025269, 0.1854146122932434, -0.09530593454837799, 0.0013260673731565475, 0.14748236536979675, -0.03885972127318382, -0.3580983877182007, 0.07415986061096191, -0.030351916328072548, 0.05305437371134758, -0.3750566840171814, 0.00003352947533130646, -0.04747690632939339, 0.28555864095687866, -0.1910504251718521, 0.11287432909011841, -0.1635756641626358, 0.30232536792755127, 0.7919277548789978, -0.11855418980121613, 0.4027373194694519, -0.05459306761622429, -0.3630557656288147, -0.027872294187545776, 0.172611802816391, 0.09491024166345596, -0.17027433216571808, 0.09818092733621597, 0.15939773619174957, 0.01706869900226593, 0.22962459921836853, 0.18739154934883118, -0.00950862467288971, 0.28463926911354065, -0.17110152542591095, 0.30758899450302124, -0.402482271194458, -0.2664756178855896, -0.18098780512809753, 0.18378739058971405, 0.34438443183898926, -0.5287226438522339, 0.07699766755104065, -0.5359542369842529, 0.04064970463514328, 0.18455800414085388, 0.28927311301231384, 0.013366006314754486, 0.10761329531669617, -0.1653009057044983, 0.07285363972187042, 0.47414329648017883, 0.058401208370923996, -0.3368404805660248, 0.22395451366901398, -0.07668961584568024, 0.3373236358165741, -0.29882699251174927, -0.04649763181805611, 0.16672804951667786, -0.12870152294635773, 0.2775722146034241, 0.03679141402244568, -0.29176241159439087, -0.11557108163833618, -0.2826578915119171, 0.34181448817253113, 0.107886403799057, 0.0065934136509895325, 0.09424631297588348, -0.342827707529068, 0.03336504474282265, -0.3285468816757202, 0.051976997405290604, 0.22713454067707062, 0.049979038536548615, 0.2843700051307678, 0.7644591927528381, -0.07419024407863617, -0.025687020272016525, -0.34821563959121704, -0.03601505607366562, 0.28297388553619385, -0.021944675594568253, -0.3330729603767395, -0.28318607807159424, -0.20775392651557922, -0.1586318016052246, 0.5021384954452515, -0.02648165449500084, -0.09498792886734009, 0.02318498119711876, -0.13007968664169312, 0.023547399789094925, 0.09457142651081085, -0.08169723302125931, 0.22256232798099518, -0.15060029923915863, 0.02574378438293934, 0.05742449313402176, 0.3350575864315033, 0.1430906355381012, -0.24523597955703735, -0.29980000853538513, 0.07127049565315247, -0.005067750811576843, 0.021994519978761673, -0.20913955569267273, 0.38611170649528503, 0.2300439178943634, -0.15657396614551544, -0.008969277143478394, -0.04049155116081238, 0.1202913373708725, 0.1651977151632309, -0.1531834453344345, 0.08822424709796906, 0.1798200160264969, -0.16082872450351715, -0.0445592999458313, 0.19822554290294647, -0.06482897698879242, 0.43543925881385803, -0.020327545702457428, 0.22506754100322723, 0.45590463280677795, 0.3077520728111267, -0.20113010704517365, -0.15201467275619507, 0.3160094618797302, -0.12097431719303131, 0.12348751723766327, 0.06234561651945114, -0.37835174798965454, 0.3981029987335205, 0.3588784337043762, 0.012039821594953537, -0.03088313341140747, 0.3761529326438904, -0.05806838721036911, 0.007970083504915237, 0.11887720227241516, 0.17853400111198425, 0.443198561668396, 0.03800350800156593, 0.08364519476890564, -0.21066711843013763, -0.32939594984054565, -0.2132929116487503, 0.18813246488571167, 0.28581684827804565, 0.06832662969827652, 0.32565268874168396, 0.2599636912345886, 0.09108658134937286, -0.15750613808631897, -0.19377736747264862, 0.022745346650481224, 0.21031437814235687, -0.19557833671569824, 0.29941073060035706, -0.2378995418548584, -0.21012112498283386, 0.13088759779930115, -0.06009962037205696, -0.43326762318611145, -0.47823140025138855, 0.07818157970905304, 0.28484970331192017, -0.19806867837905884, 0.16552719473838806, -0.038372237235307693, 0.4929402470588684, 0.22599126398563385, -0.12417254596948624, -0.4891117811203003, -0.31457629799842834, -0.24231693148612976, -0.04337327927350998, 0.3048893213272095, 0.060791272670030594, 0.45146676898002625, 0.3085574209690094, -0.04736968129873276, -0.20824947953224182, -0.5084402561187744, 0.1414395123720169, -0.016284555196762085, 0.5757308006286621, 0.2700631618499756, 0.18606576323509216, -0.1551036238670349, 0.07506531476974487, 0.18281427025794983, -0.19096873700618744, -0.0031574945896863937, 0.16843944787979126, 0.06459509581327438, 0.006486919708549976, -0.436329185962677, 0.1802373081445694, -0.22501030564308167, -0.43350663781166077, 0.15665912628173828, -0.33833128213882446, -0.10206425189971924, 0.15904678404331207, 0.09229563176631927, 0.00705428421497345, -0.31353482604026794, -0.11129455268383026, -0.271383672952652, 0.06390002369880676, 0.13540904223918915, -0.11872249841690063, -0.1595020890235901, 0.11258344352245331, -0.01174698956310749, 0.0554659441113472, 0.1440967470407486, -0.6582192778587341, 0.014168801717460155, -0.2144869714975357, 0.1550588607788086, 0.07480590790510178, -0.16782796382904053, 0.1988878846168518, 0.05033254250884056, 0.007907452061772346, -0.11718200147151947, -0.27577510476112366, -0.02170998603105545, 0.008699096739292145, 0.22216786444187164, -0.05095238983631134, 0.8232251405715942, 0.08498276770114899, 0.4748902916908264, 0.24824702739715576, -0.07518017292022705, -0.10124997794628143, 0.14925958216190338, 0.5248007774353027, -0.10359442979097366, -0.23198701441287994, -0.10344244539737701, -0.14763686060905457, -0.4092414379119873, -0.06689958274364471, 0.13689778745174408, -0.21886874735355377, 0.045272938907146454, 0.17641209065914154, 0.07885835319757462, -0.45991137623786926, 0.10661610215902328, -0.20318563282489777, 0.32883933186531067, 0.11561465263366699, 0.07871126383543015, -0.1288602650165558, 0.021410074084997177, -0.02039378136396408, 0.3142780661582947, 0.3316127359867096, -0.23517853021621704, -0.1917538195848465, -0.2265467494726181, -0.3989596366882324, 0.2631586790084839, 0.19380418956279755, 0.4808463752269745, -0.3606407940387726, -0.07855657488107681, 0.09561741352081299, -0.15275351703166962, 0.6221671104431152, -0.39196914434432983, -0.25867295265197754, 0.23760190606117249, -0.15305131673812866, -0.6373894214630127, 0.042704638093709946, -0.10480989515781403, 0.369648814201355, 0.28603795170783997, 0.405572772026062, -0.07629463076591492, -0.21417945623397827, -0.049529947340488434, 0.13392342627048492, -0.22386851906776428, -0.05789634585380554, -0.16096477210521698, -0.3440341353416443, -0.08114004880189896, 0.3335387408733368, 0.22940228879451752, -0.054901182651519775, -0.19050316512584686, -0.32182347774505615, 0.08974923938512802, -0.4314078390598297, -0.008582733571529388, 0.24387259781360626, 0.08656162768602371, -0.10535220801830292, 0.45196136832237244, -0.007306504994630814, -0.25431790947914124, 0.08631616085767746, 0.29943186044692993, -0.3670489192008972, -0.18817836046218872, 0.2803957462310791, -0.015864040702581406, 0.3672083914279938, 0.5487046241760254, -0.2718011140823364, 0.32986339926719666, -0.2602023780345917, 0.20366767048835754, 0.06908419728279114, 0.03625684604048729, 0.0887482762336731, 0.30140170454978943, -0.235526904463768, 0.03205586224794388, 0.1464821696281433, 0.24650512635707855, -0.2066890001296997, 0.7922818064689636, -0.22282378375530243, -0.1457386612892151, 0.2741355895996094, -0.038734354078769684, 0.7352371215820312, 0.11725208908319473, -0.04834813252091408, 0.012395091354846954, -0.19673390686511993, -0.06944601237773895, -0.027154335752129555, 0.09793366491794586, -0.059780046343803406, -0.45494791865348816, -0.009066218510270119, -0.2193579524755478, 0.29583582282066345, -0.051503658294677734, -0.020599037408828735, 0.07008121907711029, -0.27862074971199036, 0.22081957757472992, 0.19228129088878632, -0.08076313883066177, -0.07502368092536926, -0.119158536195755, -0.3570955693721771, 0.10356785356998444, 0.26571038365364075, -0.07061149179935455, -0.16265136003494263, 0.042737655341625214, 0.2738262712955475, -0.11782287806272507, -0.41611045598983765, -0.12351804226636887, -0.35821592807769775, -0.019866786897182465, 0.3442068099975586, -0.18430683016777039, 0.15341497957706451, -0.29850491881370544, -0.19134287536144257, 0.27582550048828125, 0.05091072991490364, 0.3935296833515167, 0.3068366050720215, 0.4041604697704315, 0.255948007106781, -0.007431591860949993, 0.21086663007736206, 0.06182657182216644, 0.03248349577188492, 0.26829907298088074, -0.33037006855010986, -0.1977369636297226, 0.12674537301063538, 0.19458961486816406, -0.041285909712314606, -0.06927856057882309, 0.1852397918701172, -0.0844314694404602, -0.18075011670589447, -0.32830342650413513, 0.1081564724445343, 0.21136443316936493, 0.014207618311047554, 0.489276260137558, -0.15336664021015167, -0.223671093583107, -0.14265616238117218, 0.14929696917533875, -0.40697404742240906, 0.20329909026622772, 0.09289641678333282, 0.1347227543592453, -0.4081798195838928, -0.305785596370697, 0.09834825247526169, -0.2040862739086151, -0.33490189909935, 0.4568106234073639, -0.19040001928806305, -0.1134953647851944, 0.39138200879096985, -0.16536524891853333, -0.02389673888683319, -0.43707841634750366, -0.527315616607666, -0.5043114423751831, -0.08384263515472412, -0.12416577339172363, 0.25234454870224, 0.1561853289604187, -0.28659144043922424, 0.026417270302772522, -0.22979874908924103, -0.049844808876514435, -0.2424241602420807, -0.20934966206550598, -0.1340235322713852, 0.18328453600406647, -0.08415204286575317, 0.04251806065440178, 0.20924358069896698, -0.25886669754981995, 0.030083922669291496, 0.3372501730918884, -0.10902964323759079, -0.1623886525630951, -0.02564026415348053, 0.18465861678123474, -0.06489255279302597, -0.1784619837999344, 0.036355067044496536, -0.18684406578540802, 0.004199404269456863, -0.12227343022823334, 0.14108909666538239, -0.114728182554245, -0.13011592626571655, -0.4131489098072052, 0.05627911537885666, 0.21974870562553406, 0.3206411600112915, 0.4410986006259918, -0.14323678612709045, 0.17812204360961914, 0.1583944708108902, 0.16885694861412048, -0.02206621877849102, -0.08408955484628677, -0.10719328373670578, -0.0832299217581749, -0.24522803723812103, -0.1137562170624733, 0.5569903254508972, -0.18018773198127747, -0.10435672104358673, 0.3258792757987976, 0.32500842213630676, 0.6249843239784241, -0.22426758706569672, -0.02168985828757286, 0.2342265248298645, 0.13931362330913544, -0.27473387122154236, 0.018732646480202675, -0.16832572221755981, 0.40567952394485474, 0.12620501220226288, 0.199588805437088, 0.021956030279397964, -0.10522060096263885, 0.4803730845451355, 0.47180554270744324, 0.44903436303138733, -0.08207083493471146, -0.06424519419670105, 0.29923325777053833, 0.10490855574607849, 0.05847219377756119, 0.3391140401363373, -0.08494596183300018, 0.08140387386083603, 0.43672072887420654, 0.06510043889284134, 0.08990342170000076, 0.1429302990436554, 0.15639647841453552, 0.14478346705436707, -0.28642937541007996, -0.07149538397789001, -0.0490831583738327, -0.4079912304878235, 0.120993971824646, 0.20438283681869507, -0.2761344015598297, -0.26448172330856323, -0.23643316328525543, 0.00561441108584404, 0.33999621868133545, -0.24789941310882568, -0.01996350660920143, -0.09825941920280457, -0.14253483712673187, 0.05764393508434296, -0.1041625589132309, 0.16194814443588257, 0.02479412406682968, 0.36095306277275085, 0.16974671185016632, 0.09981434047222137, -0.2993321120738983, -0.36940643191337585, -0.2035893201828003, 0.22960034012794495, -0.1744694709777832, 0.13629759848117828, 0.21810637414455414, -0.07150898873806, 0.006070137023925781, -0.22908584773540497, 0.4326948821544647, 0.31691035628318787, -0.46424856781959534, 0.08082909882068634, -0.21860049664974213, -0.04232962802052498, -0.13565859198570251, 0.38542085886001587, -0.12373219430446625, 0.011433752253651619, 0.16513989865779877, 0.11088469624519348, -0.13261333107948303, 0.08231541514396667, 0.20878443121910095, 0.5769429802894592, -0.37858355045318604, 0.3939446210861206, 0.09939992427825928, 0.22343280911445618, -0.16121140122413635, -0.08957577496767044, -0.19789856672286987, -0.18288777768611908, 0.7618507146835327, -0.22955113649368286, 0.11496230214834213, -0.10541248321533203, 0.08121176809072495, -0.10148130357265472, 0.3521382212638855, 0.2618844509124756, -0.08270474523305893, -0.13407592475414276, -0.08686453849077225, -0.49796363711357117, -0.14417237043380737, -0.17086535692214966, -0.02813803032040596, 0.11426914483308792, 0.08504969626665115, -0.07538307458162308, 0.1490374207496643, 0.2691996991634369, -0.07026583701372147, 0.10420447587966919, 0.1542256474494934, -0.35148054361343384, -0.10457912087440491, -0.26193201541900635, -0.2182701975107193, -0.047609515488147736, -0.3169190287590027, 0.13189931213855743, -0.19645650684833527, 0.08946651965379715, -0.08087077736854553, -0.5090777277946472, 0.2114279866218567, 0.4211351275444031, 0.2457612305879593, 0.25595152378082275, 0.07991635799407959, 0.08054288476705551, -0.06756512075662613, -0.07666200399398804, -0.2510448694229126, 0.07014785706996918, 0.023267891258001328, -0.07778079807758331, 0.12716491520404816, -0.1337229311466217, -0.36311790347099304, -0.19703297317028046, -0.039717160165309906, 0.06940768659114838, 0.17454774677753448, -0.08276999741792679, 0.11129940301179886, -0.1400832235813141, 0.17986875772476196, -0.04608279839158058, 0.2317180335521698, 0.12662474811077118, 0.1843593269586563, -0.2128477394580841, -0.3246556222438812, 0.6803194880485535, -0.4893963932991028, -0.35175827145576477, -0.14198726415634155, 0.16632433235645294, -0.03172920644283295, -0.3691181242465973, -0.22493362426757812, -0.4484475553035736, 0.3187989592552185, -0.14302697777748108, -0.14553818106651306, -0.16717255115509033, -0.028996188193559647, 0.0700099915266037, -0.22906745970249176, 0.30777648091316223, 0.02134649083018303, -0.008586347103118896, 0.19149945676326752, -0.12278134375810623 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
Hi ! Sorry for the late response. Was it happening after the first or the second filter ? It looks like an issue with the garbage collector (which makes it random). Maybe datasets created with `filter` are not always handled properly ? cc @mariosasko
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
44
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 Hi ! Sorry for the late response. Was it happening after the first or the second filter ? It looks like an issue with the garbage collector (which makes it random). Maybe datasets created with `filter` are not always handled properly ? cc @mariosasko
[ -0.29349902272224426, -0.003939241170883179, -0.07677927613258362, 0.18279317021369934, 0.3824129104614258, -0.21573865413665771, 0.05621715635061264, 0.00042396411299705505, 0.11997365951538086, 0.09813036024570465, 0.3035041391849518, 0.47646018862724304, -0.2690804600715637, -0.015266078524291515, -0.36075082421302795, 0.09072117507457733, -0.06899815052747726, -0.06376312673091888, 0.1230659931898117, 0.1145925223827362, -0.3112460970878601, 0.27589648962020874, -0.10712848603725433, 0.0748026892542839, -0.1897658109664917, -0.22555464506149292, 0.39658424258232117, -0.09409213811159134, 0.17285194993019104, -0.401495099067688, 0.1529674381017685, 0.0730927437543869, -0.15151983499526978, 0.8047163486480713, -0.00011928576714126393, -0.06833411008119583, 0.3206990361213684, 0.13554519414901733, -0.3955719470977783, -0.23554687201976776, -0.13798299431800842, 0.17448469996452332, 0.11170291900634766, 0.23624911904335022, 0.11362738162279129, 0.4246715009212494, -0.31073546409606934, -0.500739336013794, 0.13286460936069489, 0.26583629846572876, 0.15017111599445343, 0.14512917399406433, -0.23038610816001892, -0.06576225161552429, 0.15577614307403564, 0.3440520763397217, -0.19356581568717957, 0.08506686985492706, 0.41996288299560547, -0.17681311070919037, 0.05701163783669472, 0.4970601797103882, 0.00823051668703556, -0.21324534714221954, 0.07970724999904633, -0.23128800094127655, 0.48780128359794617, -0.5906651020050049, 0.3753695487976074, 0.13165950775146484, 0.24846255779266357, -0.09290394932031631, -0.20694077014923096, -0.2080964744091034, -0.01941775530576706, -0.4568491578102112, 0.21260961890220642, -0.16613583266735077, -0.39895525574684143, 0.0879315733909607, -0.054546184837818146, -0.22003550827503204, -0.05323211848735809, -0.0058565810322761536, -0.3806605935096741, -0.015073530375957489, -0.11292378604412079, 0.2642263174057007, -0.007352717220783234, -0.18552805483341217, 0.32547101378440857, -0.15888088941574097, 0.04833619296550751, 0.042143210768699646, -0.2497764676809311, 0.1410045623779297, 0.28191077709198, -0.061444707214832306, -0.17981436848640442, 0.10580234229564667, -0.1148989200592041, 0.11860740184783936, 0.04419601336121559, 0.18697476387023926, 0.24725916981697083, -0.3290741443634033, 0.15057897567749023, 0.2711840867996216, 0.6230237483978271, 0.016094086691737175, -0.19404956698417664, -0.0686584934592247, 0.23377788066864014, -0.059102077037096024, 0.23909695446491241, -0.16628685593605042, 0.010099504142999649, -0.17054790258407593, -0.3827485144138336, 0.443443238735199, -0.18821749091148376, 0.2455616146326065, 0.4519786834716797, 0.2792706787586212, 0.16199758648872375, 0.22140809893608093, 0.21807964146137238, -0.11951963603496552, 0.04512719810009003, 0.13187488913536072, -0.03944747522473335, -0.40144768357276917, 0.07110193371772766, -0.03515761345624924, 0.010218549519777298, -0.40029942989349365, -0.012817096896469593, -0.05765540897846222, 0.2625628113746643, -0.22664080560207367, 0.19232581555843353, -0.2489938735961914, 0.3230306804180145, 0.7720019817352295, -0.09140852093696594, 0.39383071660995483, -0.07885825634002686, -0.3295256495475769, -0.03388981148600578, 0.17477308213710785, 0.11609010398387909, -0.16746117174625397, 0.11148607730865479, 0.1549222618341446, 0.08308835327625275, 0.25916576385498047, 0.17907708883285522, -0.049055445939302444, 0.31682372093200684, -0.15427833795547485, 0.3310421407222748, -0.4275433421134949, -0.2973490059375763, -0.17388910055160522, 0.16731798648834229, 0.3603474497795105, -0.5011371970176697, 0.09320765733718872, -0.5982469320297241, 0.05648093670606613, 0.2308349907398224, 0.31214091181755066, 0.008510845713317394, 0.12874937057495117, -0.21575528383255005, 0.035481736063957214, 0.4940791130065918, 0.09378556907176971, -0.3119834065437317, 0.22966177761554718, -0.08752156794071198, 0.3540552258491516, -0.33490774035453796, -0.014301944524049759, 0.08701005578041077, -0.12422700971364975, 0.25504034757614136, 0.04133401811122894, -0.29054853320121765, -0.08989322185516357, -0.24183599650859833, 0.3909844756126404, 0.118858203291893, -0.03343948349356651, 0.09347276389598846, -0.3203813135623932, 0.005444273352622986, -0.30034011602401733, 0.03231169283390045, 0.2125643491744995, 0.026055296882987022, 0.23476660251617432, 0.8369140028953552, -0.06312419474124908, -0.0056157587096095085, -0.34382084012031555, 0.011395767331123352, 0.2831761837005615, -0.02614317461848259, -0.35892441868782043, -0.25466060638427734, -0.2058641016483307, -0.1311480700969696, 0.5179082155227661, -0.01854400709271431, -0.055058304220438004, 0.004261620342731476, -0.0970316231250763, 0.06049949303269386, 0.07954829931259155, -0.045065201818943024, 0.2584550976753235, -0.19021177291870117, 0.02802673913538456, 0.10084202885627747, 0.35321035981178284, 0.15981198847293854, -0.251891553401947, -0.34401804208755493, 0.0454547256231308, -0.00022208690643310547, 0.010862363502383232, -0.19508469104766846, 0.3254464566707611, 0.27059486508369446, -0.19132103025913239, -0.03283361345529556, -0.09618599712848663, 0.07419461011886597, 0.17476938664913177, -0.1280047446489334, 0.1191186010837555, 0.20159706473350525, -0.20183268189430237, 0.003282003104686737, 0.2289833128452301, -0.04419662430882454, 0.43617144227027893, -0.022879423573613167, 0.16789183020591736, 0.4554363191127777, 0.33858200907707214, -0.1819048821926117, -0.12902715802192688, 0.35430651903152466, -0.1331838220357895, 0.1704985797405243, 0.11234573274850845, -0.4327857494354248, 0.343705952167511, 0.3118147850036621, 0.0007010214030742645, -0.022310271859169006, 0.41351208090782166, 0.010552473366260529, 0.03702536225318909, 0.07445980608463287, 0.11049623787403107, 0.43960756063461304, 0.01754886284470558, 0.05781577527523041, -0.19220006465911865, -0.31639963388442993, -0.19894534349441528, 0.15351024270057678, 0.23645715415477753, 0.08347660303115845, 0.3614930212497711, 0.2607822120189667, 0.10077661275863647, -0.14901143312454224, -0.19009855389595032, 0.03400197625160217, 0.20628498494625092, -0.1252710223197937, 0.3302212655544281, -0.1610366851091385, -0.25457534193992615, 0.06907887011766434, -0.03273145481944084, -0.40518754720687866, -0.42985475063323975, 0.0076338667422533035, 0.24589426815509796, -0.16135646402835846, 0.14460259675979614, -0.03305872529745102, 0.5263203382492065, 0.2678101062774658, -0.08713509142398834, -0.5070956945419312, -0.26349136233329773, -0.26131874322891235, -0.08707573264837265, 0.3040621876716614, 0.05077654495835304, 0.41598576307296753, 0.28864896297454834, -0.07791454344987869, -0.1990731805562973, -0.4651942253112793, 0.1488049328327179, 0.0009821541607379913, 0.5904557108879089, 0.27801966667175293, 0.17957472801208496, -0.10919719934463501, 0.06054302304983139, 0.16764409840106964, -0.15313324332237244, -0.009264428168535233, 0.18366456031799316, 0.020376592874526978, 0.03169192373752594, -0.40257954597473145, 0.2119518220424652, -0.2545279562473297, -0.3908008337020874, 0.13727805018424988, -0.3516961634159088, -0.10308422148227692, 0.1539509892463684, 0.0867374986410141, -0.02042335644364357, -0.3217296600341797, -0.11515378952026367, -0.250481516122818, 0.015508223325014114, 0.15690834820270538, -0.08300158381462097, -0.14233247935771942, 0.10565271973609924, -0.06714929640293121, 0.02758615091443062, 0.1254999041557312, -0.6572791337966919, 0.04639801010489464, -0.22628505527973175, 0.15196646749973297, 0.0462646447122097, -0.19162091612815857, 0.11732953041791916, 0.0034612882882356644, 0.0387769490480423, -0.10574353486299515, -0.2828524708747864, 0.012190066277980804, 0.021095506846904755, 0.22211691737174988, -0.009545445442199707, 0.8577920198440552, 0.03243936970829964, 0.49488306045532227, 0.2899152338504791, -0.1261061280965805, -0.1269763708114624, 0.1850498914718628, 0.489149272441864, -0.0955861434340477, -0.24584533274173737, -0.08033360540866852, -0.0898708701133728, -0.43620210886001587, -0.10146988928318024, 0.10527052730321884, -0.23580752313137054, 0.06950658559799194, 0.19431914389133453, 0.11125894635915756, -0.4390801191329956, 0.10861051082611084, -0.1549423784017563, 0.3362944424152374, 0.08898518979549408, 0.04749155789613724, -0.18328581750392914, 0.05865510553121567, -0.016814403235912323, 0.3131188750267029, 0.38844311237335205, -0.18885472416877747, -0.18541093170642853, -0.22482767701148987, -0.361036479473114, 0.21217307448387146, 0.20892097055912018, 0.4620693027973175, -0.31305015087127686, -0.026334650814533234, 0.11710886657238007, -0.14598971605300903, 0.6808006167411804, -0.39160212874412537, -0.2533879280090332, 0.2509296238422394, -0.19857807457447052, -0.5877389907836914, 0.06116260215640068, -0.09901713579893112, 0.33792826533317566, 0.31265783309936523, 0.3559974730014801, -0.07762515544891357, -0.18649834394454956, -0.06198025494813919, 0.15506622195243835, -0.24631893634796143, -0.10718649625778198, -0.19555138051509857, -0.33616340160369873, -0.035683877766132355, 0.3463965654373169, 0.2230377197265625, -0.0044351560063660145, -0.17667147517204285, -0.33340704441070557, 0.05503595620393753, -0.4272998869419098, -0.030549272894859314, 0.20886088907718658, 0.09144836664199829, -0.11565570533275604, 0.45870479941368103, -0.02892936021089554, -0.2649860680103302, 0.07375328242778778, 0.2679036259651184, -0.39066314697265625, -0.24087566137313843, 0.2575153410434723, -0.047739263623952866, 0.31304043531417847, 0.5371204614639282, -0.2531130611896515, 0.3703947961330414, -0.26312458515167236, 0.22088100016117096, 0.06879200041294098, 0.06404625624418259, 0.09656153619289398, 0.28397616744041443, -0.23623178899288177, 0.04377073049545288, 0.1426292508840561, 0.244302436709404, -0.20439110696315765, 0.810901403427124, -0.22426985204219818, -0.13699108362197876, 0.26151740550994873, -0.027340508997440338, 0.7325701713562012, 0.09028691053390503, -0.11830708384513855, -0.006483510136604309, -0.21700435876846313, -0.09066098183393478, -0.033981963992118835, 0.08484898507595062, -0.027437932789325714, -0.46056777238845825, -0.0069510675966739655, -0.2579091191291809, 0.31728997826576233, -0.08146293461322784, -0.029621625319123268, 0.07626304030418396, -0.36412984132766724, 0.1985221803188324, 0.19170551002025604, -0.0444595143198967, -0.04741741716861725, -0.08795881271362305, -0.3032170534133911, 0.08085213601589203, 0.26412081718444824, -0.06820954382419586, -0.15925508737564087, 0.05152801424264908, 0.3017849624156952, -0.08258289843797684, -0.4147372841835022, -0.13549542427062988, -0.3712731599807739, -0.0591585636138916, 0.37218165397644043, -0.1750037670135498, 0.12931182980537415, -0.3130895495414734, -0.11866006255149841, 0.29734301567077637, 0.09817201644182205, 0.3657139539718628, 0.3228459656238556, 0.3915242850780487, 0.18793651461601257, -0.035624630749225616, 0.17524078488349915, 0.08387507498264313, 0.025773771107196808, 0.3310885429382324, -0.3494116961956024, -0.19820627570152283, 0.1050577163696289, 0.15208090841770172, -0.0369633212685585, -0.023207025602459908, 0.15658535063266754, -0.062238484621047974, -0.1917494833469391, -0.2731657922267914, 0.09736298024654388, 0.2613700032234192, 0.0027073819655925035, 0.4462429881095886, -0.16202740371227264, -0.25266680121421814, -0.14016234874725342, 0.09807252138853073, -0.3785727620124817, 0.20185726881027222, 0.09293902665376663, 0.12150198221206665, -0.4130028486251831, -0.29445990920066833, 0.10073920339345932, -0.23520922660827637, -0.3182987570762634, 0.4616250991821289, -0.19485817849636078, -0.09083916991949081, 0.3813873529434204, -0.1823742538690567, -0.002692103385925293, -0.4178139567375183, -0.5279545187950134, -0.4855005741119385, -0.07082424312829971, -0.15650980174541473, 0.2742369472980499, 0.12141168117523193, -0.2925633490085602, 0.05198247358202934, -0.19198964536190033, 0.008318429812788963, -0.2183658480644226, -0.1861914098262787, -0.13157492876052856, 0.17083607614040375, -0.12165825068950653, 0.028121037408709526, 0.09825139492750168, -0.22767476737499237, 0.015654267743229866, 0.3563270568847656, -0.14223632216453552, -0.14230898022651672, -0.053674861788749695, 0.18868394196033478, -0.07263701409101486, -0.1485958993434906, 0.0469428226351738, -0.210006982088089, 0.017659783363342285, -0.10916119813919067, 0.11041964590549469, -0.17326688766479492, -0.12798796594142914, -0.42223942279815674, 0.10141986608505249, 0.19601589441299438, 0.24382509291172028, 0.4487653970718384, -0.10616222023963928, 0.13724175095558167, 0.15721864998340607, 0.19837039709091187, 0.037661418318748474, -0.0848788395524025, -0.054335080087184906, -0.13353967666625977, -0.26439327001571655, -0.13274720311164856, 0.5757253766059875, -0.18845555186271667, -0.046203576028347015, 0.3163782060146332, 0.2654467821121216, 0.643389105796814, -0.24031181633472443, 0.014749577268958092, 0.19048801064491272, 0.121796615421772, -0.2700120210647583, 0.0037276134826242924, -0.19865955412387848, 0.4279177188873291, 0.1183672845363617, 0.2034725397825241, -0.04340391606092453, -0.093528613448143, 0.4453604221343994, 0.48517686128616333, 0.4853176772594452, -0.05430421978235245, -0.08713266253471375, 0.27642083168029785, 0.12043894827365875, 0.05433964356780052, 0.2827624976634979, -0.02644156664609909, 0.0590178444981575, 0.41840624809265137, 0.1005624532699585, 0.1348954737186432, 0.11094854772090912, 0.17524510622024536, 0.13258808851242065, -0.29962480068206787, -0.09182120859622955, 0.017245173454284668, -0.4369971752166748, 0.0741996094584465, 0.18934988975524902, -0.32991838455200195, -0.2915286719799042, -0.26124751567840576, 0.017122263088822365, 0.31473445892333984, -0.24456003308296204, -0.04099186882376671, -0.12014158070087433, -0.10778026282787323, 0.042306557297706604, -0.11932450532913208, 0.20324085652828217, 0.03307000547647476, 0.3190130591392517, 0.18980622291564941, 0.1008191853761673, -0.32245010137557983, -0.4012613594532013, -0.1895638406276703, 0.1933126449584961, -0.21189939975738525, 0.14691977202892303, 0.2294805943965912, -0.11470045149326324, 0.008213181048631668, -0.2583630084991455, 0.36800244450569153, 0.35666394233703613, -0.45457831025123596, 0.13889406621456146, -0.1755935102701187, -0.03896735981106758, -0.14116302132606506, 0.36354827880859375, -0.1266588568687439, 0.029520567506551743, 0.12318040430545807, 0.10170239955186844, -0.13130135834217072, 0.02680126763880253, 0.24275679886341095, 0.6431840062141418, -0.4012395441532135, 0.40202024579048157, 0.07959170639514923, 0.30706048011779785, -0.1310051828622818, -0.06231432408094406, -0.2006237804889679, -0.10615303367376328, 0.7518618106842041, -0.2277853637933731, 0.09252206236124039, -0.03311194106936455, 0.06795140355825424, -0.18514664471149445, 0.2916961908340454, 0.2426023930311203, -0.06083828955888748, -0.17586401104927063, -0.13458427786827087, -0.4442354738712311, -0.13152152299880981, -0.17101505398750305, -0.04385474696755409, 0.08431729674339294, 0.06386459618806839, -0.09573730081319809, 0.15698930621147156, 0.23378604650497437, -0.044659167528152466, 0.11343380063772202, 0.2055823802947998, -0.359639972448349, -0.15814487636089325, -0.25280386209487915, -0.21894453465938568, -0.05131343752145767, -0.29194512963294983, 0.1297905147075653, -0.16441293060779572, 0.08681181818246841, -0.04752819985151291, -0.5578330755233765, 0.22513458132743835, 0.47175270318984985, 0.19439750909805298, 0.2239600569009781, 0.054858092218637466, 0.07496508955955505, -0.038720645010471344, 0.01977141946554184, -0.22537514567375183, 0.10401813685894012, -0.03356412798166275, -0.05190260335803032, 0.13787801563739777, -0.1743907779455185, -0.315402626991272, -0.22742538154125214, -0.03590109571814537, 0.049196965992450714, 0.2060377150774002, -0.1383422613143921, 0.09713195264339447, -0.19397088885307312, 0.15226198732852936, -0.03828127309679985, 0.19698768854141235, 0.14592665433883667, 0.21345840394496918, -0.17381803691387177, -0.24545133113861084, 0.7392354011535645, -0.5112698674201965, -0.3161259591579437, -0.1646927148103714, 0.15118631720542908, -0.05211006850004196, -0.3860989511013031, -0.19176432490348816, -0.43039610981941223, 0.341467022895813, -0.17628797888755798, -0.1530052274465561, -0.20809127390384674, -0.0241364985704422, 0.1000092476606369, -0.24324920773506165, 0.32368695735931396, 0.014837756752967834, -0.008034616708755493, 0.1983320713043213, -0.14045792818069458 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
It was after the second filter (and combining the two filters into one seemingly resolved it). I obviously haven't tried all settings to know that these details are causal, but it did work for me.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
35
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 It was after the second filter (and combining the two filters into one seemingly resolved it). I obviously haven't tried all settings to know that these details are causal, but it did work for me.
[ -0.36033278703689575, 0.03689911961555481, -0.08372504264116287, 0.11418598890304565, 0.3722606897354126, -0.22955694794654846, 0.08928657323122025, 0.06284233927726746, 0.0738251656293869, 0.08880382776260376, 0.22277532517910004, 0.479506254196167, -0.24935601651668549, 0.04328338801860809, -0.3277439773082733, 0.12441585212945938, -0.09186875075101852, -0.04754142463207245, 0.09932606667280197, 0.14448775351047516, -0.3018452525138855, 0.29348912835121155, -0.09022621065378189, 0.06435152143239975, -0.1919284611940384, -0.21734848618507385, 0.41740328073501587, -0.08766353875398636, 0.19803018867969513, -0.4073522090911865, 0.12781772017478943, 0.10569746792316437, -0.16313402354717255, 0.7080458402633667, -0.00011644041660474613, -0.059271521866321564, 0.2770441174507141, 0.1526346504688263, -0.40813907980918884, -0.2401692122220993, -0.07499945908784866, 0.1317264884710312, 0.1940235197544098, 0.2825790345668793, 0.049637503921985626, 0.34849122166633606, -0.31753721833229065, -0.4248460531234741, 0.14910095930099487, 0.29993006587028503, 0.17875193059444427, 0.16969789564609528, -0.2270769476890564, -0.0713362991809845, 0.1449500173330307, 0.28380244970321655, -0.20673353970050812, 0.0879320353269577, 0.42306825518608093, -0.189772829413414, 0.03780682384967804, 0.513198971748352, -0.002017911523580551, -0.21299301087856293, 0.04528958350419998, -0.24779032170772552, 0.48557713627815247, -0.583039402961731, 0.35280928015708923, 0.1124938428401947, 0.25998276472091675, -0.07034800201654434, -0.23168335855007172, -0.247275710105896, 0.008098315447568893, -0.43874379992485046, 0.23557785153388977, -0.22952599823474884, -0.37851160764694214, 0.07385452836751938, -0.05519210547208786, -0.23329918086528778, -0.051046207547187805, -0.029566720128059387, -0.39548495411872864, 0.02689938247203827, -0.11573808640241623, 0.27901095151901245, -0.013757076114416122, -0.19753164052963257, 0.32899221777915955, -0.08373621851205826, 0.06123559921979904, 0.025667890906333923, -0.3106256425380707, 0.15397275984287262, 0.3032042384147644, -0.06897277384996414, -0.22140640020370483, 0.10948072373867035, -0.09031400829553604, 0.14983779191970825, 0.07198882102966309, 0.16752538084983826, 0.24309149384498596, -0.25833407044410706, 0.13109266757965088, 0.2347724735736847, 0.6136699318885803, 0.05955372750759125, -0.1793828308582306, -0.06029225140810013, 0.27546340227127075, -0.15642434358596802, 0.17538169026374817, -0.19474434852600098, 0.04513026028871536, -0.17916034162044525, -0.4204694330692291, 0.43394991755485535, -0.15325474739074707, 0.27696582674980164, 0.45744410157203674, 0.2920112609863281, 0.15918304026126862, 0.2542315721511841, 0.20642805099487305, -0.12295588850975037, -0.014150585979223251, 0.1757383644580841, -0.04950369521975517, -0.35049688816070557, 0.08909624814987183, -0.0551711842417717, 0.05706207826733589, -0.3554672300815582, -0.0010258816182613373, -0.04261108115315437, 0.31269532442092896, -0.14982378482818604, 0.12415452301502228, -0.15781821310520172, 0.2988039553165436, 0.8121373653411865, -0.08192681521177292, 0.4158490002155304, -0.08181113004684448, -0.343164324760437, -0.046635158360004425, 0.13980558514595032, 0.0979289785027504, -0.1477813571691513, 0.09411096572875977, 0.17453627288341522, 0.030908707529306412, 0.2386876344680786, 0.20057600736618042, -0.0021439380943775177, 0.3019101619720459, -0.16954265534877777, 0.31949272751808167, -0.4170932173728943, -0.26570093631744385, -0.16854090988636017, 0.1936241090297699, 0.3084983825683594, -0.5227857232093811, 0.10296787321567535, -0.5167675614356995, 0.04769130051136017, 0.15324769914150238, 0.27875614166259766, 0.0042030587792396545, 0.07165554910898209, -0.1452334076166153, 0.09017740190029144, 0.43767818808555603, 0.07026427984237671, -0.34408730268478394, 0.24890951812267303, -0.07508977502584457, 0.3431343734264374, -0.30789119005203247, -0.07563131302595139, 0.13455097377300262, -0.1275554746389389, 0.2791808843612671, 0.05112382769584656, -0.2944677770137787, -0.12135766446590424, -0.2725701630115509, 0.37690865993499756, 0.08584387600421906, 0.012244366109371185, 0.08797954767942429, -0.3613961637020111, 0.009697452187538147, -0.3137317895889282, 0.059748824685811996, 0.22589550912380219, 0.06392853707075119, 0.263042688369751, 0.792117178440094, -0.09318771958351135, -0.027857258915901184, -0.3424040973186493, -0.04967457801103592, 0.2915997803211212, -0.044285520911216736, -0.29826369881629944, -0.3183579444885254, -0.21635909378528595, -0.14039650559425354, 0.49882006645202637, -0.023569826036691666, -0.12508617341518402, 0.03174181282520294, -0.13161619007587433, 0.03389579430222511, 0.0870712548494339, -0.0839582160115242, 0.24024267494678497, -0.13268977403640747, 0.005954740568995476, 0.05519993230700493, 0.29548951983451843, 0.14128950238227844, -0.23821786046028137, -0.2923974394798279, 0.06776408106088638, 0.0019272379577159882, 0.016814956441521645, -0.1930837631225586, 0.37405750155448914, 0.19893878698349, -0.16329480707645416, -0.01747359335422516, -0.09400303661823273, 0.09548742324113846, 0.1711679995059967, -0.15326862037181854, 0.08040306717157364, 0.16336070001125336, -0.16307008266448975, -0.039507895708084106, 0.24502241611480713, -0.0922558456659317, 0.43382614850997925, -0.024875039234757423, 0.2011890858411789, 0.4787193238735199, 0.29038888216018677, -0.20790565013885498, -0.13303878903388977, 0.33499985933303833, -0.08424393832683563, 0.14511997997760773, 0.0827605128288269, -0.3935128152370453, 0.4312574863433838, 0.3345208466053009, 0.01571827009320259, -0.051720574498176575, 0.3648563623428345, -0.021348685026168823, -0.00217384472489357, 0.08208177983760834, 0.16795134544372559, 0.4082599878311157, 0.05094984918832779, 0.08207544684410095, -0.19029182195663452, -0.3755805194377899, -0.20735907554626465, 0.18223734200000763, 0.2296668440103531, 0.07857318222522736, 0.33012840151786804, 0.2622772455215454, 0.10011375695466995, -0.15072345733642578, -0.17669770121574402, 0.026500588282942772, 0.24746504426002502, -0.16773198544979095, 0.30198994278907776, -0.1949736624956131, -0.16622698307037354, 0.13597410917282104, -0.09380389750003815, -0.4021852910518646, -0.47805145382881165, 0.07262185215950012, 0.2778027057647705, -0.2007131278514862, 0.19437937438488007, -0.03213691711425781, 0.4581978917121887, 0.25711652636528015, -0.1297602653503418, -0.48481833934783936, -0.29586684703826904, -0.2389635443687439, -0.03982103615999222, 0.3056631088256836, 0.0821981206536293, 0.405669629573822, 0.3091343641281128, -0.09930376708507538, -0.19881674647331238, -0.49402034282684326, 0.10943663120269775, -0.03652951866388321, 0.6046316623687744, 0.2785520553588867, 0.22885286808013916, -0.15116003155708313, 0.05046848952770233, 0.2035982608795166, -0.1843985617160797, 0.01254105381667614, 0.18098530173301697, 0.0018924698233604431, 0.002552771707996726, -0.43716469407081604, 0.15329882502555847, -0.21636945009231567, -0.41950148344039917, 0.16169676184654236, -0.3369670808315277, -0.11554953455924988, 0.15440724790096283, 0.12288045883178711, -0.009519439190626144, -0.31616660952568054, -0.11871705949306488, -0.26909488439559937, 0.061838436871767044, 0.1651817262172699, -0.09517063200473785, -0.17785204946994781, 0.09170009195804596, -0.012439260259270668, 0.06098734959959984, 0.13489603996276855, -0.6288570761680603, 0.0009496519342064857, -0.2108033448457718, 0.16478852927684784, 0.07223154604434967, -0.1861167997121811, 0.17720770835876465, 0.05509786680340767, -0.020860515534877777, -0.10773347318172455, -0.25974899530410767, -0.001091599464416504, 0.02360415831208229, 0.1986432671546936, -0.07238434255123138, 0.8169848322868347, 0.06851114332675934, 0.45371925830841064, 0.23577401041984558, -0.08627429604530334, -0.12404468655586243, 0.17271289229393005, 0.5044930577278137, -0.09426281601190567, -0.24121952056884766, -0.06562566757202148, -0.13332262635231018, -0.3796793222427368, -0.06877297163009644, 0.11053770035505295, -0.22072140872478485, 0.04591856151819229, 0.1779673844575882, 0.0833062157034874, -0.4538952708244324, 0.14170873165130615, -0.19293217360973358, 0.3081883490085602, 0.12372258305549622, 0.0292273610830307, -0.17056316137313843, 0.05849835276603699, -0.03758099675178528, 0.2944806218147278, 0.31490716338157654, -0.1885511577129364, -0.1812715381383896, -0.18729199469089508, -0.39630573987960815, 0.2589070796966553, 0.19123575091362, 0.4483509361743927, -0.32258233428001404, -0.07259677350521088, 0.0968242734670639, -0.20257583260536194, 0.6149663925170898, -0.3574066460132599, -0.26132309436798096, 0.26082369685173035, -0.18510398268699646, -0.6531547904014587, 0.05223551765084267, -0.08428783714771271, 0.32511118054389954, 0.2945411205291748, 0.4243018925189972, -0.11078830808401108, -0.22942836582660675, -0.07328179478645325, 0.11802631616592407, -0.24097776412963867, -0.05370538681745529, -0.16960512101650238, -0.3888530135154724, -0.0882219597697258, 0.32678350806236267, 0.22510838508605957, -0.03376709297299385, -0.18690893054008484, -0.31299352645874023, 0.060694657266139984, -0.44650545716285706, -0.016314201056957245, 0.2636229693889618, 0.07578956335783005, -0.08955751359462738, 0.4539830982685089, -0.02137678489089012, -0.23248666524887085, 0.0675530880689621, 0.2883014678955078, -0.3635315001010895, -0.20127078890800476, 0.2654232680797577, -0.0010843956843018532, 0.3285060226917267, 0.5215348601341248, -0.2841271460056305, 0.3488493859767914, -0.257306843996048, 0.2293291985988617, 0.08867336809635162, 0.07701843976974487, 0.08183424174785614, 0.287153035402298, -0.2303837537765503, 0.04144545644521713, 0.1713196039199829, 0.20341326296329498, -0.20626530051231384, 0.7652550935745239, -0.21997754275798798, -0.1311548501253128, 0.2560153603553772, -0.020087063312530518, 0.6791151762008667, 0.11871842294931412, -0.08236868679523468, 0.05029350519180298, -0.17934276163578033, -0.05418911203742027, -0.025506969541311264, 0.06509150564670563, -0.031056813895702362, -0.4405592978000641, -0.011579284444451332, -0.19309327006340027, 0.2926028370857239, -0.06448227167129517, -0.01854531839489937, 0.06544272601604462, -0.2787356674671173, 0.21342353522777557, 0.20277799665927887, -0.05866888910531998, -0.04656146466732025, -0.13647101819515228, -0.352313756942749, 0.10506239533424377, 0.247822567820549, -0.12214668095111847, -0.14732328057289124, 0.0332014262676239, 0.2887131869792938, -0.10464923828840256, -0.376905620098114, -0.10933750867843628, -0.3898325264453888, -0.03486819565296173, 0.33540043234825134, -0.18617375195026398, 0.12967020273208618, -0.3048153817653656, -0.17512823641300201, 0.2385236769914627, 0.07170971482992172, 0.41285353899002075, 0.3031674325466156, 0.3622273802757263, 0.209540456533432, -0.04845178499817848, 0.22380925714969635, 0.05615806579589844, 0.021231286227703094, 0.27443650364875793, -0.31363826990127563, -0.1708286851644516, 0.16726899147033691, 0.19211962819099426, -0.05738870054483414, -0.061130791902542114, 0.16958852112293243, -0.06524403393268585, -0.1531735211610794, -0.33309340476989746, 0.12121126055717468, 0.21577976644039154, -0.005207718349993229, 0.45563575625419617, -0.14985278248786926, -0.23191626369953156, -0.1555097997188568, 0.12413204461336136, -0.36580437421798706, 0.2120664119720459, 0.10405474901199341, 0.14411604404449463, -0.4083099365234375, -0.3077068626880646, 0.06984651833772659, -0.18440081179141998, -0.3501254916191101, 0.4622783958911896, -0.15918126702308655, -0.11609773337841034, 0.3923811614513397, -0.17800338566303253, -0.011845327913761139, -0.4386060833930969, -0.5160688757896423, -0.4813975989818573, -0.12373189628124237, -0.15668229758739471, 0.24743489921092987, 0.13702252507209778, -0.2836516797542572, 0.08062434196472168, -0.21723034977912903, 0.01763347163796425, -0.2585233449935913, -0.1993347853422165, -0.11760367453098297, 0.19619902968406677, -0.1008533388376236, 0.011275988072156906, 0.2043273001909256, -0.23529887199401855, 0.05243411660194397, 0.3390098214149475, -0.12985269725322723, -0.18227723240852356, -0.06366031616926193, 0.17087258398532867, -0.07349492609500885, -0.17084583640098572, 0.0616513229906559, -0.17676983773708344, -0.012665271759033203, -0.10335560888051987, 0.1330057829618454, -0.1565600037574768, -0.14311321079730988, -0.4068983793258667, 0.06340055912733078, 0.19632872939109802, 0.30864089727401733, 0.42629337310791016, -0.14446499943733215, 0.1285974085330963, 0.17384615540504456, 0.18643569946289062, -0.03478438779711723, -0.07225329428911209, -0.08083274215459824, -0.11149903386831284, -0.26170265674591064, -0.12798792123794556, 0.5238775610923767, -0.1620432585477829, -0.11716583371162415, 0.2917672097682953, 0.3358023464679718, 0.6309360265731812, -0.20116131007671356, -0.03760991990566254, 0.1991831660270691, 0.14149360358715057, -0.3196486532688141, 0.05185163766145706, -0.19838760793209076, 0.40670469403266907, 0.15052530169487, 0.18353340029716492, 0.010643485933542252, -0.10035348683595657, 0.4738016724586487, 0.4839341640472412, 0.4454493820667267, -0.1020844578742981, -0.09288720786571503, 0.2944197952747345, 0.12004928290843964, 0.04696238040924072, 0.36327996850013733, -0.034698184579610825, 0.08677393198013306, 0.45559900999069214, 0.035458482801914215, 0.10764817893505096, 0.10402119159698486, 0.18380317091941833, 0.09462089091539383, -0.2889002859592438, -0.08485165238380432, -0.007270202040672302, -0.43534910678863525, 0.07790390402078629, 0.20703288912773132, -0.2741808593273163, -0.2628096044063568, -0.25323960185050964, 0.015540143474936485, 0.3926616609096527, -0.26877713203430176, -0.07329632341861725, -0.09590168297290802, -0.13940680027008057, 0.06308044493198395, -0.10698798298835754, 0.19124886393547058, 0.020876534283161163, 0.3908427953720093, 0.17575877904891968, 0.100370854139328, -0.32149991393089294, -0.4015684127807617, -0.21457746624946594, 0.21369194984436035, -0.16684463620185852, 0.14352771639823914, 0.26468271017074585, -0.11664380133152008, -0.006720464676618576, -0.25893518328666687, 0.41473570466041565, 0.29801633954048157, -0.4933645725250244, 0.12501564621925354, -0.20671992003917694, -0.031230496242642403, -0.15932288765907288, 0.350130170583725, -0.11349919438362122, 0.04358101636171341, 0.17413465678691864, 0.1286274790763855, -0.16156728565692902, 0.06387687474489212, 0.18336541950702667, 0.5887725949287415, -0.34333816170692444, 0.3694775700569153, 0.11324559897184372, 0.2750408947467804, -0.15840117633342743, -0.05763854831457138, -0.18866625428199768, -0.1747841089963913, 0.7438583374023438, -0.22592684626579285, 0.11773551255464554, -0.09540979564189911, 0.09118276834487915, -0.13083718717098236, 0.34265968203544617, 0.23151041567325592, -0.07026871293783188, -0.1500789374113083, -0.08228478580713272, -0.5135173201560974, -0.15190288424491882, -0.1587894707918167, -0.04923803359270096, 0.09751440584659576, 0.09023900330066681, -0.0636201873421669, 0.12764230370521545, 0.26626670360565186, -0.024501465260982513, 0.14844201505184174, 0.1444033831357956, -0.3500670790672302, -0.0767645388841629, -0.2751999497413635, -0.20136015117168427, -0.04129211977124214, -0.29745379090309143, 0.0928124487400055, -0.1678900271654129, 0.11684926599264145, -0.07094074785709381, -0.5134203433990479, 0.23172074556350708, 0.4434494972229004, 0.2211710512638092, 0.2547386884689331, 0.05113622546195984, 0.04630807787179947, -0.04367711395025253, -0.045559111982584, -0.2009567767381668, 0.060916732996702194, -0.01113661378622055, -0.045675840228796005, 0.14549341797828674, -0.14362357556819916, -0.32964786887168884, -0.20704154670238495, -0.06557029485702515, 0.06753332167863846, 0.16936935484409332, -0.11372437328100204, 0.13382069766521454, -0.12382358312606812, 0.17025822401046753, -0.05820344388484955, 0.2587643563747406, 0.14006954431533813, 0.19109110534191132, -0.22009971737861633, -0.33531415462493896, 0.7154435515403748, -0.48355546593666077, -0.34998446702957153, -0.11364346742630005, 0.1212150827050209, -0.04568296670913696, -0.3396393358707428, -0.23730966448783875, -0.41569703817367554, 0.29280713200569153, -0.15088945627212524, -0.19895519316196442, -0.17457115650177002, -0.040095005184412, 0.06376633048057556, -0.24808065593242645, 0.3165956735610962, 0.057052019983530045, -0.012185782194137573, 0.15627026557922363, -0.12558907270431519 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
Thanks, that's good to know. The stacktrace suggests an issue when `del self._indices` is called, which happens when a filtered dataset falls out of scope. The indices are a PyArrow table memory mapped from disk, so I'm not quite sure how calling `del` on it can cause this issue. We do `del self._indices` to make sure the file on disk is not used anymore by the current process and avoid e.g. permission errors. Hopefully we can find a way to reproduce this error, otherwise it will be quite hard to understand what happened
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
93
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 Thanks, that's good to know. The stacktrace suggests an issue when `del self._indices` is called, which happens when a filtered dataset falls out of scope. The indices are a PyArrow table memory mapped from disk, so I'm not quite sure how calling `del` on it can cause this issue. We do `del self._indices` to make sure the file on disk is not used anymore by the current process and avoid e.g. permission errors. Hopefully we can find a way to reproduce this error, otherwise it will be quite hard to understand what happened
[ -0.26999926567077637, 0.07587867975234985, -0.05574609711766243, 0.23851148784160614, 0.357414186000824, -0.1320774108171463, 0.14118102192878723, 0.05039848014712334, -0.03171519190073013, 0.16522692143917084, 0.18220821022987366, 0.45756515860557556, -0.271613746881485, -0.0980626717209816, -0.30251091718673706, 0.14925022423267365, -0.04996582120656967, -0.06755158305168152, 0.12841877341270447, 0.18478530645370483, -0.32540982961654663, 0.2547667622566223, -0.19111746549606323, 0.1400189995765686, -0.1640646606683731, -0.2338857352733612, 0.33269959688186646, -0.007318742573261261, 0.22129128873348236, -0.40987256169319153, 0.12824402749538422, 0.06797617673873901, -0.14118722081184387, 0.7162841558456421, -0.00012251976295374334, -0.012193016707897186, 0.2944590449333191, 0.12922446429729462, -0.4555732309818268, -0.20887057483196259, -0.15026772022247314, 0.20854072272777557, 0.1675293743610382, 0.20401647686958313, 0.16110759973526, 0.3161332309246063, -0.29246172308921814, -0.32748299837112427, 0.07786764204502106, 0.3532027304172516, 0.1134687215089798, 0.1631295382976532, -0.2423529326915741, 0.005791438277810812, 0.40144971013069153, 0.3037659227848053, -0.14309850335121155, 0.1485246866941452, 0.3794095516204834, -0.26131361722946167, 0.04311682656407356, 0.4125381112098694, -0.10346311330795288, -0.21785646677017212, 0.10653682053089142, -0.20800615847110748, 0.5618665218353271, -0.4784946143627167, 0.3424231708049774, 0.06270270049571991, 0.30233249068260193, -0.25396788120269775, -0.18402060866355896, -0.27101385593414307, 0.0234534852206707, -0.49410736560821533, 0.2822771668434143, -0.136898934841156, -0.38642528653144836, 0.14589938521385193, -0.05325637757778168, -0.1312432885169983, -0.16123825311660767, 0.0046851783990859985, -0.34408462047576904, -0.025144919753074646, -0.056839898228645325, 0.2704160511493683, 0.04255632311105728, -0.16268610954284668, 0.4114527702331543, -0.09546667337417603, 0.05305604636669159, 0.05797947198152542, -0.2973586618900299, 0.17372317612171173, 0.24426233768463135, -0.06555036455392838, -0.100090891122818, 0.11017359793186188, 0.010728614404797554, 0.128985196352005, 0.16129925847053528, 0.26541051268577576, 0.2928648293018341, -0.1755160689353943, 0.02351391687989235, 0.24980245530605316, 0.6221863627433777, 0.07270435988903046, -0.1842133104801178, -0.014518510550260544, 0.20583605766296387, -0.10607822239398956, 0.3086419999599457, -0.1875952184200287, 0.02174527943134308, -0.20159873366355896, -0.5230342149734497, 0.41047579050064087, -0.3063663840293884, 0.2387022078037262, 0.42917948961257935, 0.2987861931324005, 0.172773540019989, 0.11348631978034973, 0.1479487121105194, -0.032508186995983124, -0.08606351166963577, 0.23279933631420135, -0.050909437239170074, -0.3162992596626282, 0.040499407798051834, -0.12159041315317154, 0.0662989467382431, -0.3943077027797699, 0.039499372243881226, -0.05995911359786987, 0.28070080280303955, -0.17377854883670807, 0.0797046646475792, -0.17777717113494873, 0.31507906317710876, 0.8609366416931152, -0.16779035329818726, 0.3136836290359497, -0.09961353242397308, -0.48958081007003784, -0.0539240762591362, 0.28540682792663574, 0.09673506021499634, -0.2600145637989044, 0.10499110817909241, 0.09817323088645935, -0.01028853002935648, 0.23456710577011108, 0.16083043813705444, -0.016553368419408798, 0.3010655343532562, -0.24392196536064148, 0.2794775068759918, -0.46895062923431396, -0.1883833110332489, -0.23054812848567963, 0.18886849284172058, 0.3067682385444641, -0.5655333995819092, 0.03620721399784088, -0.5458141565322876, -0.05051170662045479, 0.24289968609809875, 0.3068130910396576, -0.008431632071733475, 0.18326348066329956, -0.22461837530136108, 0.13396111130714417, 0.3601093888282776, 0.09405145049095154, -0.4603884816169739, 0.1859453171491623, -0.05976385250687599, 0.3601915240287781, -0.2773176431655884, 0.03952933847904205, 0.15062753856182098, -0.129457026720047, 0.30479568243026733, 0.04790373891592026, -0.33289870619773865, -0.16281533241271973, -0.28609219193458557, 0.3674546480178833, 0.13662774860858917, 0.030442234128713608, 0.1260368525981903, -0.33620819449424744, 0.11213130503892899, -0.3243522644042969, 0.11230004578828812, 0.23217244446277618, 0.05381721258163452, 0.23111669719219208, 0.7842046618461609, -0.05433301627635956, 0.009805053472518921, -0.39438527822494507, -0.07408300787210464, 0.276167094707489, -0.025827769190073013, -0.2891324460506439, -0.38804876804351807, -0.2107411026954651, -0.18180105090141296, 0.5284474492073059, -0.02647964283823967, -0.09371760487556458, -0.03633676841855049, -0.14844682812690735, 0.011622779071331024, 0.09935252368450165, -0.13110579550266266, 0.1351400911808014, -0.23742732405662537, 0.04922749102115631, 0.05432005599141121, 0.30224665999412537, 0.11718782782554626, -0.3094301223754883, -0.35380151867866516, 0.064446359872818, 0.031073806807398796, 0.025836121290922165, -0.18859514594078064, 0.40597960352897644, 0.2898405194282532, -0.2185405045747757, -0.11339140683412552, 0.03766193985939026, 0.09877729415893555, 0.12893475592136383, -0.09433002024888992, 0.047552697360515594, 0.1382923275232315, -0.1446252167224884, -0.0018404126167297363, 0.22676753997802734, -0.18458274006843567, 0.40649229288101196, -0.0492791123688221, 0.07080315053462982, 0.44065648317337036, 0.3085392117500305, -0.15965916216373444, -0.1471376270055771, 0.29396116733551025, -0.07934413850307465, 0.11017552018165588, 0.10870636254549026, -0.39555642008781433, 0.32575881481170654, 0.30038073658943176, -0.1092614233493805, -0.03547593951225281, 0.38018181920051575, -0.04419126361608505, 0.019778400659561157, 0.16495350003242493, 0.11726173758506775, 0.4706149101257324, 0.054995834827423096, 0.026321474462747574, -0.1706877201795578, -0.34279918670654297, -0.17919859290122986, 0.19031110405921936, 0.2950739860534668, 0.0928131565451622, 0.358461856842041, 0.27504962682724, 0.11056125909090042, -0.18158599734306335, -0.19449184834957123, 0.026667354628443718, 0.29285478591918945, -0.20005355775356293, 0.3368418514728546, -0.22012558579444885, -0.27545416355133057, 0.1661600023508072, -0.09076747298240662, -0.42758774757385254, -0.4483470022678375, 0.15672168135643005, 0.31695836782455444, -0.27714723348617554, 0.20101186633110046, 0.005081184208393097, 0.4821024537086487, 0.17123329639434814, -0.17850030958652496, -0.4283866584300995, -0.3118826150894165, -0.27251729369163513, -0.08070851862430573, 0.372287780046463, 0.11277904361486435, 0.3628927171230316, 0.34911978244781494, -0.07886750251054764, -0.17904071509838104, -0.4917066693305969, 0.1287924349308014, -0.0913868248462677, 0.6678767204284668, 0.24790100753307343, 0.15479514002799988, -0.1549237072467804, 0.06936266273260117, 0.20917901396751404, -0.14301390945911407, -0.009613914415240288, 0.29368266463279724, 0.0889848843216896, 0.0761416032910347, -0.4261454641819, 0.2234843373298645, -0.23964710533618927, -0.3874692916870117, 0.144672691822052, -0.397137314081192, -0.003940194845199585, 0.19345152378082275, 0.12344461679458618, -0.0017216263804584742, -0.2456471025943756, -0.12308049201965332, -0.18524491786956787, 0.05170070007443428, 0.10548695176839828, -0.031965501606464386, -0.13535015285015106, 0.10565288364887238, -0.05027202516794205, 0.05189863592386246, 0.20942701399326324, -0.714607298374176, 0.09490165114402771, -0.1379047930240631, 0.17831650376319885, 0.08189176023006439, -0.164714053273201, 0.2259511649608612, 0.07653927803039551, 0.055912457406520844, -0.10701592266559601, -0.298772394657135, -0.08803357928991318, 0.022960703819990158, 0.1815364509820938, -0.00009878724813461304, 0.8461554050445557, 0.06482826173305511, 0.5699238777160645, 0.12948986887931824, -0.04186726734042168, -0.08347447216510773, 0.12544754147529602, 0.520350992679596, -0.03480740636587143, -0.19883869588375092, -0.12889212369918823, -0.07058362662792206, -0.561780571937561, -0.0009388327598571777, 0.06613382697105408, -0.3338087201118469, 0.051764942705631256, 0.03699449077248573, -0.0007484219968318939, -0.4604717493057251, 0.2047119140625, -0.11825257539749146, 0.29135817289352417, 0.1415122002363205, 0.01834193617105484, -0.13802938163280487, -0.014755156822502613, -0.0041287001222372055, 0.30417221784591675, 0.36136293411254883, -0.20118215680122375, -0.0768667533993721, -0.35553932189941406, -0.3631790578365326, 0.2289268672466278, 0.2180028259754181, 0.4630258083343506, -0.32901719212532043, -0.13687270879745483, 0.1288476288318634, -0.15370169281959534, 0.6674057245254517, -0.3527493476867676, -0.22060997784137726, 0.3062610328197479, -0.10095153003931046, -0.5995702147483826, 0.007061537355184555, -0.1365726888179779, 0.3235044479370117, 0.15810708701610565, 0.3840717077255249, -0.1198081374168396, -0.19992007315158844, 0.010590186342597008, 0.17155154049396515, -0.23800542950630188, -0.052724312990903854, -0.27359122037887573, -0.4267948567867279, -0.14202889800071716, 0.4162392318248749, 0.20233409106731415, -0.012858337722718716, -0.16617947816848755, -0.23319804668426514, 0.07373704016208649, -0.4403035342693329, -0.013535574078559875, 0.2500884532928467, 0.08196015655994415, -0.15753376483917236, 0.39431414008140564, -0.0896231085062027, -0.2600805461406708, 0.27167388796806335, 0.32349729537963867, -0.3505132496356964, -0.07142281532287598, 0.291876882314682, 0.05617976561188698, 0.4587300419807434, 0.5492870807647705, -0.24241729080677032, 0.35184431076049805, -0.21703141927719116, 0.1940436214208603, 0.03472379595041275, -0.07108644396066666, 0.07565426826477051, 0.22926777601242065, -0.25052890181541443, 0.07896891981363297, 0.151686429977417, 0.21684859693050385, -0.21654558181762695, 0.6964667439460754, -0.08277639746665955, -0.12890677154064178, 0.32242071628570557, 0.00656658411026001, 0.8744537234306335, 0.05255645513534546, -0.03931078687310219, 0.062313955277204514, -0.14200064539909363, -0.15303176641464233, -0.08732600510120392, 0.22331602871418, -0.045938823372125626, -0.5082119107246399, -0.013924388214945793, -0.24992512166500092, 0.2530611455440521, -0.04702793061733246, 0.04322865977883339, 0.016354773193597794, -0.305403470993042, 0.2909325957298279, 0.22909903526306152, -0.1048993319272995, -0.055223844945430756, -0.030393488705158234, -0.3694123923778534, 0.03684249520301819, 0.24500788748264313, -0.15590617060661316, -0.21146270632743835, 0.09150899946689606, 0.24547544121742249, -0.060214921832084656, -0.3489537239074707, -0.14751097559928894, -0.37996160984039307, -0.026706181466579437, 0.16803371906280518, -0.2161821573972702, 0.04736682400107384, -0.30337637662887573, -0.26668232679367065, 0.20688696205615997, 0.11777288466691971, 0.37234482169151306, 0.2973097264766693, 0.35339799523353577, 0.17749297618865967, -0.007653002627193928, 0.2845211923122406, 0.06812689453363419, -0.050375305116176605, 0.3169952929019928, -0.32029861211776733, -0.2817748785018921, 0.0894121378660202, 0.23132815957069397, -0.05711321532726288, -0.062038641422986984, 0.23852495849132538, -0.1714940369129181, -0.16426625847816467, -0.29251015186309814, 0.05837810039520264, 0.20967413485050201, -0.0015184433432295918, 0.4848953187465668, -0.25469809770584106, -0.26379841566085815, -0.1804666966199875, 0.12393181025981903, -0.32750967144966125, 0.29171884059906006, 0.1142946407198906, 0.11289173364639282, -0.36640262603759766, -0.24318790435791016, 0.0493042916059494, -0.17255091667175293, -0.2923300266265869, 0.46703988313674927, -0.23698261380195618, -0.09203867614269257, 0.36061373353004456, -0.15568755567073822, 0.06502417474985123, -0.4381030797958374, -0.59073406457901, -0.5323402881622314, -0.13523338735103607, -0.0035304203629493713, 0.3727525770664215, 0.17770695686340332, -0.24463117122650146, 0.029785996302962303, -0.26710718870162964, -0.03868287801742554, -0.19884437322616577, -0.2033858299255371, -0.15995846688747406, 0.2371916025876999, -0.15382926166057587, 0.09415622055530548, 0.21353794634342194, -0.2706409692764282, -0.006885431706905365, 0.3474828004837036, -0.0903506800532341, -0.12328862398862839, 0.010668132454156876, 0.22000715136528015, -0.03179793059825897, -0.11987722665071487, -0.014397232793271542, -0.2275933176279068, 0.026985131204128265, -0.12918002903461456, 0.2521402835845947, -0.11654359102249146, -0.12371812760829926, -0.3751722276210785, 0.22859156131744385, 0.18816134333610535, 0.29559463262557983, 0.4221247732639313, -0.09894253313541412, 0.20032036304473877, 0.16838732361793518, 0.12428764998912811, -0.09398569166660309, -0.08829642832279205, -0.094366155564785, -0.08711258322000504, -0.2112402766942978, -0.16106170415878296, 0.5296266078948975, -0.2023800164461136, -0.1697780042886734, 0.21591559052467346, 0.34242603182792664, 0.5523606538772583, -0.19399122893810272, -0.02977455034852028, 0.2850559651851654, 0.0823783129453659, -0.28256896138191223, 0.006778703536838293, -0.21380065381526947, 0.23375673592090607, 0.09578987956047058, 0.2581445872783661, 0.00732547789812088, -0.03219584748148918, 0.3963997960090637, 0.4009977877140045, 0.5386286973953247, -0.013243000954389572, -0.23940902948379517, 0.3139840066432953, 0.1150418072938919, 0.06281116604804993, 0.34981098771095276, -0.07741159200668335, 0.17813169956207275, 0.4494616985321045, 0.020513400435447693, 0.09775561094284058, 0.15724873542785645, 0.20634527504444122, 0.11076904833316803, -0.3543381690979004, -0.09753796458244324, 0.045190244913101196, -0.3760460317134857, 0.07507245987653732, 0.18242840468883514, -0.22632762789726257, -0.13822126388549805, -0.18939970433712006, 0.09403954446315765, 0.349273681640625, -0.2675168812274933, 0.028967954218387604, -0.1170005053281784, -0.2109300196170807, 0.06012335419654846, -0.14986300468444824, 0.14500077068805695, -0.029303543269634247, 0.3629296123981476, 0.14541839063167572, 0.04346460476517677, -0.2710225284099579, -0.3070116639137268, -0.11144181340932846, 0.2171936333179474, -0.21091464161872864, 0.12723968923091888, 0.24982136487960815, -0.18933257460594177, 0.010181805118918419, -0.24861951172351837, 0.48496735095977783, 0.3036019802093506, -0.4582786560058594, 0.022235574200749397, -0.1897209733724594, -0.05854344367980957, -0.14469057321548462, 0.3836938142776489, -0.10874691605567932, 0.09133930504322052, 0.07183188199996948, 0.06602629274129868, -0.1201585903763771, -0.0012766756117343903, 0.31801846623420715, 0.610953688621521, -0.39221543073654175, 0.26946765184402466, 0.0696895569562912, 0.15883693099021912, -0.08373522013425827, -0.09779370576143265, -0.22355327010154724, -0.0721767321228981, 0.6877096891403198, -0.19028520584106445, 0.1267518699169159, 0.011301153339445591, 0.05005995184183121, -0.16073060035705566, 0.33308127522468567, 0.3528055250644684, -0.04693666845560074, -0.20815026760101318, -0.07112974673509598, -0.5875020623207092, -0.04099581390619278, -0.25065678358078003, -0.08534436672925949, 0.28371962904930115, 0.10649071633815765, -0.07572739571332932, 0.1034572497010231, 0.29559940099716187, 0.01269199326634407, 0.12386351078748703, 0.21629031002521515, -0.37048569321632385, -0.14196273684501648, -0.3220665454864502, -0.29342132806777954, -0.03531259670853615, -0.35108575224876404, 0.11328446865081787, -0.2244471162557602, 0.033989958465099335, -0.08824263513088226, -0.427403062582016, 0.23243504762649536, 0.5142406225204468, 0.31170332431793213, 0.16870810091495514, 0.037119410932064056, 0.12968742847442627, -0.055214107036590576, -0.06004268303513527, -0.19768977165222168, -0.014598430134356022, -0.004995517432689667, -0.046027448028326035, 0.14583438634872437, -0.16652867197990417, -0.3904627561569214, -0.19462552666664124, 0.024841753765940666, 0.029184557497501373, 0.1859269142150879, -0.06901779770851135, 0.11609110981225967, -0.18984326720237732, 0.2269119769334793, -0.0710802674293518, 0.22221019864082336, 0.17712125182151794, 0.22284936904907227, -0.2936779856681824, -0.29510489106178284, 0.7114508748054504, -0.6022261381149292, -0.29741042852401733, -0.10826151818037033, 0.16575804352760315, -0.0242464616894722, -0.38971325755119324, -0.20725852251052856, -0.3598855137825012, 0.3516964316368103, -0.11239344626665115, -0.22029940783977509, -0.17961345613002777, -0.05199200287461281, 0.07975903153419495, -0.18508769571781158, 0.2547870874404907, 0.06624523550271988, -0.010011246427893639, 0.12386906147003174, -0.1401863843202591 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
Yeah, I have a reliable repro, but it is not even close to minimal and uses a dataset I can't share. Perhaps you could try getting close to my setting. (1) make a large (~20GB) jsonl with prompt/response pairs (2) load it on a linux machine (`dataset = load_dataset(...)`) (3) map a tokenizer to it, with multiprocessing (`tokenized_dataset = dataset.map(...)`) (4) filter it once based on something, with multiprocessing (`filtered_1 = tokenized_dataset.filter(...)`) (5) filter it again based on something, with multiprocessing (`filtered_2 = filtered_1.filter(...)`) I included the variable names just in case it is relevant that I was creating new datasets each time, not overwriting the same variable.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
108
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 Yeah, I have a reliable repro, but it is not even close to minimal and uses a dataset I can't share. Perhaps you could try getting close to my setting. (1) make a large (~20GB) jsonl with prompt/response pairs (2) load it on a linux machine (`dataset = load_dataset(...)`) (3) map a tokenizer to it, with multiprocessing (`tokenized_dataset = dataset.map(...)`) (4) filter it once based on something, with multiprocessing (`filtered_1 = tokenized_dataset.filter(...)`) (5) filter it again based on something, with multiprocessing (`filtered_2 = filtered_1.filter(...)`) I included the variable names just in case it is relevant that I was creating new datasets each time, not overwriting the same variable.
[ -0.39694416522979736, 0.12596963346004486, -0.05943920463323593, 0.17023588716983795, 0.27565717697143555, -0.2960375249385834, 0.040323302149772644, 0.13020679354667664, 0.09984584152698517, 0.041366130113601685, 0.27463382482528687, 0.5538310408592224, -0.282597154378891, -0.0014425404369831085, -0.32637134194374084, 0.13021597266197205, -0.07507670670747757, -0.08382239937782288, 0.18723659217357635, 0.18413685262203217, -0.2748906910419464, 0.2972404360771179, -0.10775433480739594, 0.039953071624040604, -0.13180536031723022, -0.24951383471488953, 0.4523112177848816, -0.04106936603784561, 0.13074013590812683, -0.41116610169410706, 0.06465043872594833, 0.18939410150051117, -0.18746140599250793, 0.7220236659049988, -0.00011881563841598108, -0.07575807720422745, 0.3526645302772522, 0.10400497913360596, -0.38570401072502136, -0.3184354901313782, -0.08975185453891754, 0.02803586609661579, 0.16885365545749664, 0.16473793983459473, 0.08734366297721863, 0.23818877339363098, -0.35454055666923523, -0.47367021441459656, 0.3177547752857208, 0.237884521484375, 0.13204526901245117, 0.17364251613616943, -0.1609015166759491, 0.11848760396242142, 0.05832205340266228, 0.36395061016082764, -0.08377476781606674, -0.015103485435247421, 0.46978047490119934, -0.12489961087703705, 0.024306587874889374, 0.502623438835144, -0.09068408608436584, -0.319879949092865, 0.020056959241628647, -0.31308770179748535, 0.2972240746021271, -0.5096780061721802, 0.341533899307251, 0.08522913604974747, 0.2538551092147827, -0.10811612755060196, -0.2361738383769989, -0.2647002041339874, -0.04271385446190834, -0.39066681265830994, 0.2625921070575714, -0.20229791104793549, -0.37362003326416016, 0.009362276643514633, -0.1883840560913086, -0.33812063932418823, -0.06542947888374329, 0.02961890771985054, -0.4093726575374603, 0.1622081995010376, -0.05369088426232338, 0.2890244722366333, -0.08827099204063416, -0.3396802544593811, 0.24395351111888885, -0.16501130163669586, 0.017121706157922745, 0.06096133217215538, -0.30524885654449463, 0.010168250650167465, 0.2900019586086273, -0.31819817423820496, -0.07096190005540848, 0.15366312861442566, -0.12364332377910614, 0.15854954719543457, 0.04146968945860863, 0.18461358547210693, 0.3372040092945099, -0.20597955584526062, 0.1727704405784607, 0.24245809018611908, 0.642621636390686, -0.0670122355222702, -0.20076392590999603, 0.03994501754641533, 0.15855203568935394, -0.02987048402428627, 0.07360577583312988, -0.12727516889572144, -0.03367618843913078, -0.16701331734657288, -0.3069520890712738, 0.44382524490356445, -0.41077470779418945, 0.25263169407844543, 0.4769991934299469, 0.2522592842578888, 0.08908099681138992, 0.25452375411987305, 0.18040022253990173, -0.12905284762382507, -0.01888345554471016, 0.04103283956646919, 0.02300266921520233, -0.32982349395751953, 0.13761000335216522, -0.1046195849776268, 0.055871520191431046, -0.1946721374988556, 0.0023274756968021393, -0.10567755997180939, 0.21719308197498322, -0.18725574016571045, 0.23025178909301758, -0.09797708690166473, 0.23195403814315796, 0.7628416419029236, -0.08409903198480606, 0.36197027564048767, -0.07286819815635681, -0.38624268770217896, -0.167234867811203, 0.16468584537506104, 0.07906238734722137, -0.15633843839168549, 0.16868290305137634, 0.12482091784477234, -0.05722876265645027, 0.21888835728168488, -0.029033832252025604, 0.08790464699268341, 0.20746412873268127, -0.12897196412086487, 0.22616040706634521, -0.36450934410095215, -0.19874003529548645, -0.12920115888118744, 0.1532185822725296, 0.2588416337966919, -0.5506570339202881, 0.003818497061729431, -0.4951000213623047, 0.06899434328079224, 0.20324766635894775, 0.2782784402370453, 0.006369085982441902, 0.170045405626297, -0.0966898500919342, 0.215961292386055, 0.4600895047187805, -0.04741882532835007, -0.38615819811820984, 0.3434358239173889, -0.10285523533821106, 0.3151407241821289, -0.2964780032634735, -0.06351743638515472, 0.25036853551864624, -0.08615685254335403, 0.32258766889572144, 0.18537111580371857, -0.2327185869216919, 0.010656008496880531, -0.2446872889995575, 0.23530727624893188, 0.0030065737664699554, 0.056550074368715286, 0.035543181002140045, -0.43291282653808594, 0.018373921513557434, -0.19198806583881378, 0.03856430575251579, 0.1883746087551117, 0.11318989843130112, 0.2774730324745178, 0.8046401739120483, -0.12615597248077393, -0.05106012523174286, -0.24125486612319946, -0.08673747628927231, 0.2271801233291626, 0.05179699510335922, -0.3133338987827301, -0.3682161569595337, -0.17738009989261627, -0.12385885417461395, 0.5292463302612305, 0.031436823308467865, -0.050182241946458817, 0.029698088765144348, -0.04155153036117554, 0.05660203471779823, 0.07901068031787872, -0.047398075461387634, 0.2258952558040619, 0.025348270311951637, 0.0344916507601738, -0.002284253016114235, 0.24359627068042755, 0.2165643721818924, -0.23708578944206238, -0.20655952394008636, 0.059033431112766266, 0.03332320600748062, -0.06444713473320007, -0.21846643090248108, 0.312311053276062, 0.30954015254974365, -0.1572125107049942, -0.036907970905303955, -0.006274700164794922, 0.11522448062896729, 0.2860009968280792, -0.18542562425136566, 0.17432373762130737, 0.152642160654068, -0.10414619743824005, -0.043161019682884216, 0.29662734270095825, -0.02338438108563423, 0.4897063374519348, -0.008123446255922318, 0.17041225731372833, 0.5087048411369324, 0.27276456356048584, -0.23727944493293762, -0.1361786276102066, 0.3289836347103119, -0.024642638862133026, 0.10890541970729828, 0.04633500799536705, -0.4105055630207062, 0.3732442557811737, 0.3545164167881012, -0.017089050263166428, -0.0427226722240448, 0.3670661449432373, 0.01896025985479355, 0.023183558136224747, 0.10560066252946854, 0.19233308732509613, 0.3301991820335388, 0.06204305589199066, -0.012724515050649643, -0.22721999883651733, -0.22913852334022522, -0.19259010255336761, 0.16603009402751923, 0.20105117559432983, 0.0137293366715312, 0.33862555027008057, 0.384550541639328, 0.04040146246552467, -0.1944844126701355, -0.3407972753047943, 0.09031495451927185, 0.2513417899608612, -0.09019692242145538, 0.282638281583786, -0.264244943857193, -0.09609870612621307, 0.22049905359745026, -0.045402929186820984, -0.3494521975517273, -0.4504786729812622, 0.12722787261009216, 0.3339843153953552, -0.2902736961841583, 0.1975799798965454, -0.03829659894108772, 0.5530599355697632, 0.25981995463371277, -0.2600962519645691, -0.5110328197479248, -0.3396371006965637, -0.34365376830101013, -0.07482858002185822, 0.39573320746421814, 0.03307550773024559, 0.4760918915271759, 0.3777954876422882, -0.06434611976146698, -0.1647479087114334, -0.5581006407737732, 0.1656431406736374, 0.035738177597522736, 0.6135492324829102, 0.231198251247406, 0.12263479083776474, -0.16486096382141113, 0.04880310595035553, 0.17614628374576569, -0.1093735471367836, -0.1324286162853241, 0.1803220808506012, 0.0732455924153328, 0.027938250452280045, -0.361115425825119, 0.1461404412984848, -0.1749749332666397, -0.4524044990539551, 0.16616134345531464, -0.392558753490448, -0.03455374389886856, 0.020522521808743477, 0.1130630299448967, -0.026152368634939194, -0.297816663980484, -0.09392286092042923, -0.19350138306617737, 0.004319194704294205, 0.15532109141349792, -0.08533975481987, -0.18684543669223785, 0.060060445219278336, -0.042471058666706085, 0.15264715254306793, 0.15430782735347748, -0.7245497107505798, -0.0085640549659729, -0.1621311753988266, 0.19835563004016876, -0.007035207003355026, -0.2560720145702362, 0.19283737242221832, 0.11798623949289322, 0.024812160059809685, -0.08495326340198517, -0.2726677656173706, -0.06527713686227798, -0.02674276754260063, 0.2506157159805298, 0.00027298927307128906, 0.9606229066848755, 0.1146136075258255, 0.4866533875465393, 0.22720664739608765, -0.0940965861082077, -0.15791156888008118, 0.2306288778781891, 0.34646889567375183, -0.10386712104082108, -0.17602220177650452, -0.08565440028905869, -0.04854536056518555, -0.3979054093360901, -0.0425136536359787, 0.1884801685810089, -0.2606313228607178, 0.05031108856201172, 0.14580108225345612, -0.02134590782225132, -0.49643275141716003, 0.15643078088760376, -0.17902395129203796, 0.30223649740219116, 0.10418640077114105, 0.048854805529117584, -0.1755024790763855, 0.05719039589166641, -0.03939425200223923, 0.2612737715244293, 0.33507585525512695, -0.2007351666688919, -0.3911234140396118, -0.24793390929698944, -0.44437533617019653, 0.2618734836578369, 0.11647727340459824, 0.5864201188087463, -0.29051658511161804, -0.006653262302279472, 0.07987050712108612, -0.2718794047832489, 0.7027766108512878, -0.3515019118785858, -0.21745125949382782, 0.2824976146221161, -0.2543492615222931, -0.5876206159591675, 0.15596145391464233, -0.08196508884429932, 0.31402504444122314, 0.4189234972000122, 0.545550525188446, -0.2396397888660431, -0.21138985455036163, -0.19310596585273743, 0.11854846775531769, -0.21259786188602448, -0.14185567200183868, -0.12087957561016083, -0.455661803483963, -0.23524026572704315, 0.3400440514087677, 0.1989126056432724, 0.07431577891111374, -0.05355621129274368, -0.3231028616428375, 0.04609125852584839, -0.5019515752792358, -0.05961751937866211, 0.25295335054397583, 0.022015348076820374, -0.11270179599523544, 0.4974026679992676, -0.06749386340379715, -0.21820589900016785, 0.15285877883434296, 0.1863316148519516, -0.1796070784330368, -0.1925620436668396, 0.2254754900932312, 0.081892229616642, 0.3352833390235901, 0.503335177898407, -0.2492138147354126, 0.3861960172653198, -0.2615199089050293, 0.28182876110076904, 0.0988323912024498, 0.16002561151981354, 0.017693696543574333, 0.2907278835773468, -0.24401770532131195, -0.01541481539607048, 0.10037089139223099, 0.2768304944038391, -0.17416560649871826, 0.6702758073806763, -0.31960248947143555, -0.18792197108268738, 0.29835283756256104, 0.02868065983057022, 0.7482528686523438, 0.11102138459682465, -0.12121352553367615, 0.05833422392606735, -0.2466876208782196, 0.13727980852127075, -0.36039870977401733, 0.10589492321014404, -0.01922532543540001, -0.17637670040130615, 0.031118428334593773, -0.2151695340871811, 0.21964317560195923, 0.03354857116937637, 0.01893225684762001, 0.026778502389788628, -0.16526903212070465, 0.1365511119365692, 0.14758339524269104, 0.1614254266023636, -0.05460798740386963, -0.1882612258195877, -0.4485214948654175, 0.09724552929401398, 0.13540910184383392, -0.13962556421756744, -0.10783492028713226, 0.0024283183738589287, 0.31022053956985474, -0.20939059555530548, -0.39509737491607666, -0.16387447714805603, -0.3238808512687683, 0.016372883692383766, 0.4138200283050537, -0.12967005372047424, 0.1321670264005661, -0.377627968788147, -0.22346796095371246, 0.4293583929538727, 0.11651556193828583, 0.3845857083797455, 0.17374595999717712, 0.4343035817146301, 0.2232179045677185, -0.08461491763591766, 0.16758407652378082, 0.005754183977842331, 0.07570037990808487, 0.26816457509994507, -0.3260580599308014, -0.26756441593170166, 0.09715847671031952, 0.20784538984298706, -0.045460499823093414, 0.031437963247299194, 0.18096263706684113, -0.013652190566062927, -0.19160886108875275, -0.31063568592071533, 0.07488693296909332, 0.2202148735523224, -0.03818995878100395, 0.44375547766685486, -0.1414061188697815, -0.21837010979652405, -0.17367063462734222, 0.1387254148721695, -0.33709463477134705, 0.11021465063095093, 0.13704216480255127, 0.18685275316238403, -0.32663071155548096, -0.32148444652557373, 0.20003357529640198, -0.13151343166828156, -0.20877501368522644, 0.4593973755836487, -0.2488916963338852, -0.2294965386390686, 0.3111029863357544, -0.1436598151922226, -0.0625065341591835, -0.3708142340183258, -0.3728916645050049, -0.5445604920387268, -0.12644660472869873, -0.02616732567548752, 0.2504090666770935, 0.06254074722528458, -0.18734583258628845, 0.12777768075466156, -0.4292505085468292, 0.08270695805549622, -0.2226238250732422, -0.2032071352005005, -0.23045475780963898, 0.2074500024318695, -0.14487625658512115, 0.05992690101265907, 0.1298450082540512, -0.16436098515987396, 0.010102728381752968, 0.2754020690917969, -0.15210503339767456, -0.13591548800468445, -0.12045612931251526, 0.1897778958082199, 0.03682047128677368, -0.15506653487682343, 0.046442221850156784, -0.21139851212501526, -0.0038347002118825912, -0.11152418702840805, 0.09373423457145691, -0.2208079993724823, -0.1682194322347641, -0.49987125396728516, 0.012302126735448837, 0.17370931804180145, 0.2842745780944824, 0.42885440587997437, -0.013197124004364014, 0.2196674942970276, 0.18749366700649261, 0.3071306645870209, 0.08221018314361572, -0.0770018920302391, -0.17207083106040955, -0.07266435772180557, -0.16113345324993134, -0.04732638597488403, 0.5523416996002197, -0.15055787563323975, -0.11011390388011932, 0.2907554805278778, 0.2542506754398346, 0.6250391006469727, -0.22288459539413452, -0.07786659151315689, 0.26750075817108154, 0.1167156994342804, -0.2087683081626892, -0.011776530183851719, -0.15008845925331116, 0.3364599943161011, 0.1965516209602356, 0.1205567717552185, -0.09085067361593246, -0.053942546248435974, 0.4138100743293762, 0.44313856959342957, 0.6018896102905273, 0.01768004521727562, -0.12033635377883911, 0.22969907522201538, -0.03655223548412323, 0.07669221609830856, 0.31355708837509155, -0.03680706396698952, 0.14552585780620575, 0.40589451789855957, 0.13823451101779938, 0.14971107244491577, 0.2672940790653229, 0.29818758368492126, 0.04884975031018257, -0.2707882225513458, -0.07446162402629852, 0.08296363800764084, -0.26882535219192505, 0.15776792168617249, 0.14401602745056152, -0.36283960938453674, -0.14346998929977417, -0.2029358148574829, 0.05647231638431549, 0.4188663065433502, -0.19962766766548157, -0.12741129100322723, -0.23194512724876404, -0.1552974432706833, 0.004764929413795471, -0.00968421995639801, 0.12225218117237091, 0.027489442378282547, 0.1663142442703247, 0.18569646775722504, 0.0971374437212944, -0.4687561094760895, -0.3689127266407013, -0.18701276183128357, 0.12090557813644409, -0.24241389334201813, 0.24463126063346863, 0.27629590034484863, -0.09605854749679565, -0.028919052332639694, -0.30046865344047546, 0.3999520242214203, 0.39028027653694153, -0.4316524863243103, 0.037148717790842056, -0.2942582964897156, 0.006849275901913643, -0.23323820531368256, 0.44702595472335815, -0.10361061990261078, -0.11436766386032104, 0.15124370157718658, 0.06941770017147064, -0.1320827454328537, 0.05981384590268135, 0.264920175075531, 0.43654242157936096, -0.253261536359787, 0.32733848690986633, 0.0723249763250351, 0.2846919000148773, -0.12648507952690125, -0.09725167602300644, -0.21080225706100464, -0.18406616151332855, 0.6381245851516724, -0.16347405314445496, 0.14109563827514648, -0.15725429356098175, 0.07760466635227203, -0.1900642067193985, 0.34353387355804443, 0.2863557040691376, -0.11204033344984055, -0.13245680928230286, -0.11298764497041702, -0.44334718585014343, -0.1440127193927765, -0.27850890159606934, -0.052574098110198975, 0.04951032996177673, 0.12339453399181366, 0.016038373112678528, 0.21413949131965637, 0.03145263344049454, 0.05334944650530815, 0.002939586527645588, 0.17301782965660095, -0.3652389347553253, -0.10100975632667542, -0.10972420871257782, -0.07231775671243668, -0.011981286108493805, -0.3226291835308075, 0.1710769683122635, -0.14007319509983063, 0.06198395788669586, -0.09796774387359619, -0.47454795241355896, 0.22128476202487946, 0.41179436445236206, 0.20765960216522217, 0.37305909395217896, 0.14230215549468994, 0.025210604071617126, -0.12210046499967575, -0.026718061417341232, -0.1888158768415451, -0.005663891322910786, -0.024229668080806732, 0.01366894319653511, 0.25046753883361816, -0.16581852734088898, -0.2307301014661789, -0.22778722643852234, -0.08002373576164246, -0.07802481949329376, -0.03900203853845596, -0.08839356899261475, 0.12032460421323776, -0.17373350262641907, 0.19564607739448547, -0.1603812426328659, 0.28031790256500244, 0.10281752049922943, 0.23453356325626373, -0.2629268765449524, -0.21952363848686218, 0.646101713180542, -0.5209585428237915, -0.38694480061531067, -0.10633200407028198, 0.11981536448001862, -0.037956222891807556, -0.3087077736854553, -0.08073326200246811, -0.3442075252532959, 0.3341519236564636, -0.15741395950317383, -0.19652338325977325, -0.11685065925121307, 0.10751436650753021, -0.03873293846845627, -0.23108653724193573, 0.2460831105709076, 0.11569616198539734, -0.028611406683921814, 0.19428983330726624, -0.08838766813278198 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
@lhoestq I have another version of the repro that seems fairly reliably. I have lots of jsonl files, and I iteratively load each one with `load_dataset('json', data_files='path/to/my/file.jsonl', streaming=False, split='train')` and then `dataset.map(..., num_proc=<int>)`. This iteration hangs in a random place each time. So seems like there is a bug that hits with _some_ frequency.
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
54
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 @lhoestq I have another version of the repro that seems fairly reliably. I have lots of jsonl files, and I iteratively load each one with `load_dataset('json', data_files='path/to/my/file.jsonl', streaming=False, split='train')` and then `dataset.map(..., num_proc=<int>)`. This iteration hangs in a random place each time. So seems like there is a bug that hits with _some_ frequency.
[ -0.2901538908481598, 0.15834417939186096, -0.03830927982926369, 0.17367559671401978, 0.28017163276672363, -0.19261595606803894, 0.07940609753131866, 0.11538508534431458, 0.08983364701271057, 0.029149629175662994, 0.2712341547012329, 0.48250529170036316, -0.1739613264799118, -0.12469781190156937, -0.26776865124702454, 0.07177440077066422, 0.009601689875125885, -0.06984065473079681, 0.23567113280296326, 0.10510183870792389, -0.38982588052749634, 0.2958323061466217, -0.04497230798006058, 0.001490481197834015, -0.05993958190083504, -0.18879100680351257, 0.40991416573524475, 0.08820705115795135, 0.11898913234472275, -0.371444433927536, 0.1604442447423935, 0.10862836241722107, -0.10878058522939682, 0.7615113854408264, -0.00012326549040153623, 0.06478676199913025, 0.36178410053253174, 0.09048917144536972, -0.45842036604881287, -0.32975059747695923, -0.16375455260276794, 0.16262245178222656, 0.10050837695598602, 0.2032177448272705, 0.14993035793304443, 0.2983158528804779, -0.2570047676563263, -0.5336483716964722, 0.23279014229774475, 0.2816566228866577, 0.09623623639345169, 0.17911913990974426, -0.2771196961402893, 0.0284548569470644, 0.34126511216163635, 0.4367043972015381, -0.15059858560562134, 0.160112202167511, 0.4238540530204773, -0.22206580638885498, 0.0018205568194389343, 0.44760313630104065, -0.03069356083869934, -0.19238746166229248, 0.014972396194934845, -0.2125246822834015, 0.42289334535598755, -0.4931747615337372, 0.2825169563293457, 0.1007855162024498, 0.22797685861587524, -0.16597327589988708, -0.30818843841552734, -0.22640100121498108, 0.0007197110680863261, -0.412140429019928, 0.2754560112953186, -0.13872437179088593, -0.30850788950920105, 0.003461170941591263, -0.2587703466415405, -0.21530742943286896, 0.017923027276992798, 0.052317578345537186, -0.3543321490287781, 0.044284749776124954, -0.05303674936294556, 0.31830325722694397, 0.04911254718899727, -0.20259779691696167, 0.20274262130260468, -0.18056592345237732, -0.053763363510370255, 0.0893724262714386, -0.225575789809227, 0.14373943209648132, 0.3038632571697235, -0.28921207785606384, -0.12075353413820267, 0.2083396017551422, -0.03261684998869896, 0.106716088950634, -0.027066953480243683, 0.23041990399360657, 0.37664347887039185, -0.1877700388431549, 0.13954678177833557, 0.27230629324913025, 0.6774600148200989, 0.017643684521317482, -0.12505722045898438, 0.05177830532193184, 0.1504795253276825, -0.00935666449368, 0.13655740022659302, -0.1907556653022766, 0.0036196112632751465, -0.18483930826187134, -0.4495352506637573, 0.5112669467926025, -0.5344160795211792, 0.13405883312225342, 0.36686956882476807, 0.2047370970249176, 0.1320950984954834, 0.2935578227043152, 0.2502252459526062, -0.09935282170772552, -0.009747042320668697, 0.19376657903194427, -0.01957324892282486, -0.3264699876308441, 0.00958866998553276, -0.06561987102031708, 0.032981108874082565, -0.3260383903980255, 0.03719475865364075, -0.11131519824266434, 0.2633887529373169, -0.28819388151168823, 0.10419944673776627, -0.18436281383037567, 0.2357402741909027, 0.7942277789115906, -0.16170243918895721, 0.4052276909351349, -0.1374894231557846, -0.3913354277610779, -0.14220771193504333, 0.2171579897403717, 0.012210663408041, -0.1258898675441742, 0.19399407505989075, 0.08332514762878418, -0.039869219064712524, 0.24217106401920319, -0.12454212456941605, 0.019830893725156784, 0.23847034573554993, -0.1799391210079193, 0.2526218593120575, -0.37897592782974243, -0.15614674985408783, -0.11901435256004333, 0.11847672611474991, 0.3508543074131012, -0.5674582123756409, -0.07473284006118774, -0.3558052182197571, 0.04070772975683212, 0.24209964275360107, 0.2818434536457062, -0.052081458270549774, 0.22334295511245728, -0.1546853482723236, 0.11733441054821014, 0.44442370533943176, -0.07808119058609009, -0.4233941435813904, 0.3663654625415802, -0.020191475749015808, 0.36885708570480347, -0.32234683632850647, -0.04612710326910019, 0.04913152754306793, -0.12319672107696533, 0.30789223313331604, 0.09914029389619827, -0.23889485001564026, 0.00670287199318409, -0.19614914059638977, 0.2728905975818634, -0.018940430134534836, 0.07599727809429169, 0.001852724701166153, -0.3127392530441284, -0.02447821944952011, -0.23675619065761566, 0.108380526304245, 0.19413438439369202, 0.07825026661157608, 0.3255273699760437, 0.7683818936347961, -0.1554739624261856, -0.03507557883858681, -0.26157453656196594, -0.212971031665802, 0.24666589498519897, 0.09598934650421143, -0.29590341448783875, -0.2599779963493347, -0.08507128059864044, -0.14031222462654114, 0.48591405153274536, -0.05398063734173775, -0.07365265488624573, -0.03529879450798035, 0.027364928275346756, -0.010030750185251236, 0.03800294175744057, -0.08285464346408844, 0.2864404618740082, -0.09777746349573135, 0.012016084976494312, -0.08548082411289215, 0.42700478434562683, 0.19720719754695892, -0.25408464670181274, -0.30434393882751465, 0.07606624066829681, -0.0075025856494903564, -0.15774953365325928, -0.1956087350845337, 0.3456289768218994, 0.3357846438884735, -0.08637876808643341, -0.018603384494781494, -0.12168757617473602, 0.1896999031305313, 0.31671959161758423, -0.20177926123142242, 0.08338060975074768, 0.14381657540798187, -0.16520677506923676, -0.06720713526010513, 0.1805686503648758, 0.002703692764043808, 0.5419008135795593, -0.023454882204532623, 0.06803678721189499, 0.4409137964248657, 0.3119034767150879, -0.2662675678730011, -0.10588739067316055, 0.34905096888542175, 0.14955924451351166, 0.1553022265434265, 0.08346578478813171, -0.4366294741630554, 0.29497623443603516, 0.43892934918403625, -0.07820652425289154, -0.12698045372962952, 0.38391298055648804, -0.026943467557430267, 0.030864879488945007, 0.06412778049707413, 0.36019167304039, 0.42622607946395874, -0.030462492257356644, 0.004602055996656418, -0.18772771954536438, -0.3258344233036041, -0.1926121711730957, 0.06517202407121658, 0.31826841831207275, 0.21175098419189453, 0.37240836024284363, 0.34276530146598816, 0.09667038917541504, -0.20961174368858337, -0.3411701023578644, 0.07435031235218048, 0.2841517925262451, -0.13946591317653656, 0.4016818702220917, -0.21041329205036163, 0.008198164403438568, 0.06537336856126785, -0.2094138115644455, -0.39282819628715515, -0.4921169877052307, 0.036986906081438065, 0.28676584362983704, -0.2834741473197937, 0.13379599153995514, -0.03682436794042587, 0.5101391673088074, 0.19847486913204193, -0.29056745767593384, -0.4943629801273346, -0.3069877028465271, -0.3413555920124054, -0.12180934846401215, 0.3947165608406067, -0.10026910156011581, 0.34066855907440186, 0.20355422794818878, -0.13923051953315735, -0.20851799845695496, -0.4999164938926697, 0.2259611040353775, -0.0443226620554924, 0.6256695985794067, 0.2308417558670044, 0.15667495131492615, -0.20478849112987518, 0.07184316217899323, 0.22883836925029755, -0.10802721232175827, -0.1550425887107849, 0.16079339385032654, 0.06501790136098862, 0.060639023780822754, -0.3933992385864258, 0.09282803535461426, -0.11648613959550858, -0.39310935139656067, 0.2734925150871277, -0.26633957028388977, -0.04177331179380417, 0.06607053428888321, 0.1124473586678505, -0.03829463571310043, -0.2214003950357437, -0.11446279287338257, -0.21756358444690704, -0.05048910528421402, 0.07356147468090057, -0.0693700835108757, -0.17162230610847473, 0.06689231097698212, -0.0074304137378931046, 0.08289586007595062, 0.2836455702781677, -0.7890416383743286, -0.12499701231718063, -0.12324917316436768, 0.14576242864131927, 0.03397766128182411, -0.20776446163654327, 0.1893165111541748, 0.1228732243180275, 0.05748005956411362, -0.1514548361301422, -0.38901177048683167, 0.06407424807548523, 0.10715426504611969, 0.18406769633293152, 0.015652775764465332, 0.9336770176887512, -0.043353091925382614, 0.5292837023735046, 0.2949747145175934, -0.1663694679737091, -0.07692044973373413, 0.1874805986881256, 0.4192967116832733, -0.11142753809690475, -0.07807066291570663, -0.13449913263320923, -0.12348705530166626, -0.4144914150238037, -0.06339621543884277, 0.17463457584381104, -0.355118989944458, 0.032705143094062805, 0.19973909854888916, 0.11318107694387436, -0.4520585834980011, 0.16274651885032654, -0.12193465232849121, 0.24653169512748718, 0.0770159512758255, 0.09561643749475479, -0.07844728976488113, 0.07665042579174042, -0.026211054995656013, 0.1871463805437088, 0.40296056866645813, -0.1574089229106903, -0.3331955075263977, -0.3354443907737732, -0.3706228733062744, 0.23932772874832153, 0.1898525208234787, 0.5882546305656433, -0.29702767729759216, -0.11322008818387985, 0.06852620095014572, -0.3192293643951416, 0.6904401183128357, -0.3709075450897217, -0.22179456055164337, 0.24187269806861877, -0.20211318135261536, -0.5423751473426819, 0.008139673620462418, -0.0840788185596466, 0.3957848846912384, 0.32146838307380676, 0.5867366194725037, -0.20509007573127747, -0.24344229698181152, -0.02991854026913643, 0.11872510612010956, -0.1502963900566101, -0.10145632922649384, -0.19260244071483612, -0.44557011127471924, -0.15977735817432404, 0.28276968002319336, 0.21762025356292725, -0.013613369315862656, -0.09549369663000107, -0.2451377660036087, 0.11446059495210648, -0.40792304277420044, -0.012651510536670685, 0.20932766795158386, 0.06798329204320908, -0.017562050372362137, 0.44271528720855713, 0.04563499614596367, -0.1456833779811859, 0.24629294872283936, 0.35150495171546936, -0.3513607084751129, -0.12753964960575104, 0.3304724395275116, 0.010909085161983967, 0.33331766724586487, 0.566819965839386, -0.1559179276227951, 0.2293347716331482, -0.20334793627262115, 0.1890793740749359, -0.038543734699487686, 0.0034839757718145847, 0.1537916660308838, 0.24039128422737122, -0.24831797182559967, -0.10584698617458344, 0.19365960359573364, 0.32590630650520325, -0.17892315983772278, 0.6605426669120789, -0.23904840648174286, -0.15545819699764252, 0.23334066569805145, 0.009756609797477722, 0.7971925735473633, 0.1454753279685974, -0.06146377697587013, 0.12029420584440231, -0.25326406955718994, -0.09170591086149216, -0.3347356915473938, 0.16650180518627167, -0.018035519868135452, -0.23733438551425934, -0.06500442326068878, -0.24299845099449158, 0.2176055610179901, -0.03234339505434036, 0.0496550090610981, 0.0713241845369339, -0.1770407110452652, 0.2492239624261856, 0.1479862481355667, -0.12277950346469879, -0.06901892274618149, -0.09575968980789185, -0.46021291613578796, 0.049102962017059326, 0.20132777094841003, -0.11271825432777405, -0.11436045169830322, -0.00753331184387207, 0.19993731379508972, -0.1371915638446808, -0.4049175977706909, -0.08586306124925613, -0.2608897387981415, -0.12130430340766907, 0.45861244201660156, -0.17512136697769165, 0.05599971488118172, -0.3356879949569702, -0.20575933158397675, 0.23106950521469116, 0.04807408154010773, 0.3875984251499176, 0.18235918879508972, 0.4134780764579773, 0.18882858753204346, -0.054904159158468246, 0.23967806994915009, 0.03771078586578369, 0.0032527372241020203, 0.25063517689704895, -0.400821328163147, -0.24024070799350739, 0.036424681544303894, 0.26767170429229736, -0.03582373261451721, -0.029915010556578636, 0.24035455286502838, 0.06285607069730759, -0.19049052894115448, -0.287861704826355, 0.04047437384724617, 0.20214693248271942, -0.013612611219286919, 0.38439780473709106, -0.18512479960918427, -0.2811446785926819, -0.1778285652399063, 0.20512625575065613, -0.30834123492240906, 0.21889612078666687, 0.18313734233379364, 0.12197424471378326, -0.31190139055252075, -0.265550434589386, 0.08656711131334305, -0.004450932145118713, -0.3378494679927826, 0.4381331503391266, -0.3030165433883667, -0.20728430151939392, 0.3410681188106537, -0.14074018597602844, -0.08502089977264404, -0.4115758240222931, -0.37911608815193176, -0.5986957550048828, -0.10754317790269852, -0.03381900489330292, 0.29209789633750916, 0.13508707284927368, -0.19347688555717468, -0.030784714967012405, -0.29342421889305115, -0.02848607487976551, -0.1679622083902359, -0.16246415674686432, -0.24295881390571594, 0.2323819398880005, -0.1758682131767273, 0.07939151674509048, 0.23136380314826965, -0.20872937142848969, -0.02978196181356907, 0.29626840353012085, -0.21425838768482208, -0.079776331782341, -0.05892792344093323, 0.22634881734848022, 0.020928872749209404, -0.17975904047489166, 0.09873226284980774, -0.13954877853393555, 0.05525829643011093, -0.15456964075565338, 0.11737489700317383, -0.2170458734035492, -0.12599793076515198, -0.39883121848106384, 0.1341291218996048, 0.1574873924255371, 0.3654235601425171, 0.4258962571620941, -0.03167305886745453, 0.2728268802165985, 0.16092942655086517, 0.22006268799304962, 0.012134118005633354, -0.0692535787820816, -0.23025910556316376, -0.06708651036024094, -0.19348548352718353, 0.056368835270404816, 0.5377503633499146, -0.24306218326091766, -0.008515473455190659, 0.24980847537517548, 0.3553808927536011, 0.6700408458709717, -0.31247732043266296, -0.04889731854200363, 0.21381956338882446, 0.07031849026679993, -0.19784340262413025, -0.10080647468566895, 0.012808229774236679, 0.3641432821750641, 0.14836573600769043, 0.21999621391296387, -0.03246002271771431, -0.10340522229671478, 0.3670639395713806, 0.4765492379665375, 0.5765456557273865, -0.06833412498235703, -0.0911356657743454, 0.35298970341682434, 0.05037340894341469, 0.14450041949748993, 0.2584276795387268, -0.0738491415977478, 0.11382801085710526, 0.38104677200317383, 0.08167298138141632, 0.1314631849527359, 0.2836678624153137, 0.1962554156780243, 0.11997167766094208, -0.3155924677848816, -0.030087482184171677, 0.21749357879161835, -0.2550855278968811, 0.16335704922676086, 0.2428637146949768, -0.19135284423828125, -0.19482870399951935, -0.1883363574743271, -0.05331166088581085, 0.3871379494667053, -0.18466529250144958, -0.14822976291179657, -0.2166673094034195, -0.1886288821697235, -0.00039252638816833496, -0.0011786408722400665, 0.07427173852920532, 0.010657835751771927, 0.3553316295146942, 0.14356622099876404, 0.09039030969142914, -0.47955623269081116, -0.3459598124027252, -0.3084806501865387, 0.17142698168754578, -0.21383708715438843, 0.2982182204723358, 0.21617209911346436, -0.16595827043056488, 0.022788768634200096, -0.2639846205711365, 0.3714871108531952, 0.37850421667099, -0.3564557433128357, 0.08844074606895447, -0.16923999786376953, -0.03323082625865936, -0.19214321672916412, 0.48033130168914795, -0.1317775398492813, -0.11135697364807129, 0.09614767134189606, 0.06541652232408524, -0.055944427847862244, 0.1516227126121521, 0.245872363448143, 0.5518258810043335, -0.28532692790031433, 0.42174971103668213, 0.00532929040491581, 0.22797536849975586, -0.05914025008678436, -0.12266122549772263, -0.12189815938472748, -0.16547784209251404, 0.6483591794967651, -0.16332727670669556, 0.19191747903823853, -0.08371344953775406, 0.05465974658727646, -0.19346393644809723, 0.3874239921569824, 0.2896929383277893, -0.16823884844779968, -0.10942313820123672, -0.09950350224971771, -0.3885812759399414, -0.15694373846054077, -0.25071975588798523, -0.05351487919688225, 0.1170123890042305, 0.11395508050918579, 0.00845550000667572, 0.16010618209838867, 0.15779589116573334, -0.08362798392772675, 0.02362293004989624, 0.200670063495636, -0.43511053919792175, -0.22763140499591827, -0.1293053925037384, -0.06637557595968246, -0.00596265122294426, -0.36056584119796753, 0.13142766058444977, -0.09088125824928284, 0.017988912761211395, -0.15056480467319489, -0.5117999315261841, 0.16551914811134338, 0.5004175305366516, 0.2702721357345581, 0.26574134826660156, -0.006824880838394165, 0.04593069851398468, -0.19507868587970734, -0.17663738131523132, -0.260172963142395, 0.0732785165309906, -0.0455542653799057, -0.1480838507413864, 0.22726714611053467, -0.26239490509033203, -0.09485043585300446, -0.2715798318386078, -0.1277390718460083, 0.004813425242900848, 0.12913203239440918, -0.15757738053798676, 0.10434500873088837, -0.22479036450386047, 0.14749783277511597, -0.08301857113838196, 0.2582511007785797, 0.1367276906967163, 0.16911610960960388, -0.2624518871307373, -0.19915606081485748, 0.7094096541404724, -0.6168503165245056, -0.3142150342464447, -0.004561930894851685, 0.014003731310367584, -0.050938405096530914, -0.3712548613548279, -0.2580833435058594, -0.272065132856369, 0.35935041308403015, -0.11040358990430832, -0.3011853098869324, -0.141624316573143, 0.013390257023274899, 0.0051851533353328705, -0.19372284412384033, 0.2846371531486511, 0.0759696289896965, -0.13692697882652283, 0.27737316489219666, -0.1839974820613861 ]
https://github.com/huggingface/datasets/issues/6393
Filter occasionally hangs
I am also having similar issue to #3172 when trying to tokenize the data. My dataset contains 10M samples. Is there anything that could be done without having to split up the processing into multiple datasets?
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
36
Filter occasionally hangs ### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 I am also having similar issue to #3172 when trying to tokenize the data. My dataset contains 10M samples. Is there anything that could be done without having to split up the processing into multiple datasets?
[ -0.30296942591667175, 0.07233251631259918, -0.06281731277704239, 0.2283802330493927, 0.37363892793655396, -0.21817493438720703, 0.08610700815916061, 0.10473813116550446, 0.09099218249320984, 0.02097746729850769, 0.28763991594314575, 0.38262826204299927, -0.2632485330104828, 0.02613602764904499, -0.32587045431137085, 0.12572044134140015, -0.037335239350795746, -0.07186885178089142, 0.15687492489814758, 0.1725267618894577, -0.22138099372386932, 0.21474547684192657, -0.04543529078364372, 0.09589742869138718, -0.27290818095207214, -0.3056275546550751, 0.4399125576019287, -0.10650113970041275, 0.1506863683462143, -0.4286324977874756, 0.04840966314077377, 0.10759712755680084, -0.1599176675081253, 0.7734779715538025, -0.0001240155252162367, -0.10411585867404938, 0.2602584958076477, 0.11147375404834747, -0.39185434579849243, -0.21310724318027496, -0.09626516699790955, 0.154754176735878, 0.14856824278831482, 0.24899950623512268, 0.16167566180229187, 0.347311794757843, -0.28868043422698975, -0.45997142791748047, 0.19210471212863922, 0.265171617269516, 0.11129067838191986, 0.19712886214256287, -0.2646881937980652, -0.020198415964841843, 0.14800405502319336, 0.36946189403533936, -0.1320236325263977, 0.022085361182689667, 0.4737097918987274, -0.24265635013580322, 0.07252640277147293, 0.5126377940177917, -0.0720396563410759, -0.18564389646053314, 0.03801421821117401, -0.23027366399765015, 0.4379543960094452, -0.6145344972610474, 0.38421398401260376, 0.06951803714036942, 0.18717283010482788, -0.10349535197019577, -0.271194189786911, -0.29265493154525757, -0.0031796814873814583, -0.45654845237731934, 0.26010096073150635, -0.1755363643169403, -0.3848126530647278, 0.04502633959054947, -0.12062831968069077, -0.30718138813972473, -0.09676948189735413, 0.02582346647977829, -0.4632169306278229, 0.05556187778711319, -0.10685450583696365, 0.2543780505657196, -0.035486940294504166, -0.1991959661245346, 0.2852154076099396, -0.10422033071517944, 0.09809359908103943, 0.017384028062224388, -0.3182300925254822, 0.17653107643127441, 0.19081121683120728, -0.15627485513687134, -0.13117752969264984, 0.10488399863243103, -0.09697803854942322, 0.17817074060440063, 0.09749485552310944, 0.16856959462165833, 0.23616887629032135, -0.2392185628414154, 0.10941973328590393, 0.32741788029670715, 0.6600932478904724, 0.0029498175717890263, -0.23844441771507263, -0.06409487873315811, 0.09921848028898239, -0.05117630213499069, 0.1320464313030243, -0.10945381969213486, -0.0019156206399202347, -0.14324069023132324, -0.40970781445503235, 0.48704683780670166, -0.19545626640319824, 0.31241655349731445, 0.4790991246700287, 0.28275975584983826, 0.13211847841739655, 0.16359364986419678, 0.1317775547504425, -0.06290467083454132, -0.03634064644575119, 0.06104559078812599, 0.02795528993010521, -0.34631362557411194, 0.08436271548271179, -0.03028748370707035, 0.029447045177221298, -0.2793065011501312, -0.005395307205617428, -0.022370081394910812, 0.27849966287612915, -0.265960156917572, 0.214243084192276, -0.2230524867773056, 0.3698951005935669, 0.7640815377235413, -0.09078366309404373, 0.4807072579860687, 0.0006211437284946442, -0.3993099331855774, -0.04834597185254097, 0.10810357332229614, 0.05053780600428581, -0.18085519969463348, 0.0956607237458229, 0.08223497122526169, -0.00545886904001236, 0.30378690361976624, 0.16452546417713165, -0.017733212560415268, 0.34941211342811584, -0.14011690020561218, 0.26038116216659546, -0.3785831928253174, -0.25380319356918335, -0.1544860154390335, 0.2155040055513382, 0.35069143772125244, -0.5204188823699951, 0.04738623648881912, -0.4915117621421814, 0.06898669898509979, 0.29405471682548523, 0.3881298899650574, 0.07994960993528366, 0.20377406477928162, -0.1996506303548813, 0.17034070193767548, 0.47185787558555603, -0.021321004256606102, -0.33887824416160583, 0.2642424702644348, -0.10774557292461395, 0.2774869501590729, -0.2582227885723114, -0.0735071524977684, 0.22719493508338928, -0.11278658360242844, 0.2755213975906372, 0.10071338713169098, -0.34292173385620117, -0.1081930547952652, -0.2733193337917328, 0.31078407168388367, 0.10254208743572235, 0.01592813804745674, 0.13705067336559296, -0.37589940428733826, -0.018283940851688385, -0.27448782324790955, -0.02620360255241394, 0.18386562168598175, 0.10214406996965408, 0.18085546791553497, 0.8036261200904846, -0.04781174659729004, -0.10225677490234375, -0.2719530761241913, 0.02404051274061203, 0.19750550389289856, -0.057764194905757904, -0.35164517164230347, -0.41307759284973145, -0.26717787981033325, -0.17413854598999023, 0.4524291157722473, -0.04287688061594963, -0.03134751692414284, -0.021581806242465973, -0.04659175127744675, 0.0035868175327777863, 0.04180578514933586, -0.09357628226280212, 0.21792592108249664, -0.16381767392158508, 0.05867762118577957, 0.1532568782567978, 0.3184395134449005, 0.1913909912109375, -0.2854069769382477, -0.29460838437080383, 0.11988905072212219, 0.04797830805182457, -0.034871891140937805, -0.17621496319770813, 0.3573276996612549, 0.23650288581848145, -0.16951556503772736, -0.0015079379081726074, 0.012184828519821167, 0.13840630650520325, 0.248822420835495, -0.2029743790626526, 0.08262361586093903, 0.16055288910865784, -0.12165432423353195, 0.018975432962179184, 0.25025200843811035, -0.030508559197187424, 0.4736374020576477, 0.010389905422925949, 0.2526243329048157, 0.46029993891716003, 0.28873348236083984, -0.15027286112308502, -0.183072030544281, 0.38029512763023376, -0.15554003417491913, 0.21419383585453033, 0.06864292919635773, -0.42579081654548645, 0.3838820457458496, 0.29309818148612976, 0.016855157911777496, 0.027808822691440582, 0.30959945917129517, -0.026456207036972046, 0.04365435242652893, 0.055387891829013824, 0.20769532024860382, 0.343575119972229, 0.0326625220477581, 0.07121765613555908, -0.18446342647075653, -0.23792526125907898, -0.18077687919139862, 0.11862102150917053, 0.26396438479423523, 0.04494628682732582, 0.4092999994754791, 0.24010902643203735, 0.07698991149663925, -0.07088368386030197, -0.2041081339120865, 0.14193077385425568, 0.21487322449684143, -0.23192378878593445, 0.3332620859146118, -0.3292100131511688, -0.2988666594028473, 0.0415160097181797, -0.0102918716147542, -0.45864540338516235, -0.4575005769729614, 0.09515510499477386, 0.20556782186031342, -0.20315086841583252, 0.2154625654220581, -0.007041778415441513, 0.5577269792556763, 0.18595638871192932, -0.11248861998319626, -0.41473588347435, -0.2768881022930145, -0.2743228077888489, -0.12682758271694183, 0.4117285907268524, 0.09505124390125275, 0.4846787750720978, 0.2878546416759491, -0.0627593994140625, -0.24068951606750488, -0.547020435333252, 0.1729162633419037, 0.04855841025710106, 0.5899184346199036, 0.24519163370132446, 0.1584993302822113, -0.2248470038175583, 0.006290166638791561, 0.16609331965446472, -0.1575043499469757, -0.020934950560331345, 0.1357828676700592, 0.04105031117796898, 0.0017276373691856861, -0.3521665036678314, 0.24544933438301086, -0.28108251094818115, -0.4101729989051819, 0.10656319558620453, -0.45589205622673035, -0.004688337445259094, 0.06689006090164185, -0.03375687077641487, -0.03034709393978119, -0.3973321318626404, -0.11903201043605804, -0.2062058448791504, 0.03970564529299736, 0.172715425491333, -0.14318697154521942, -0.1283465027809143, 0.10957945883274078, 0.016230255365371704, 0.1331016719341278, 0.23440268635749817, -0.6008527278900146, 0.06860115379095078, -0.20117856562137604, 0.13347217440605164, 0.017457395792007446, -0.2034444361925125, 0.18727748095989227, 0.004992987960577011, 0.08075020462274551, -0.10119114816188812, -0.2318757027387619, 0.00035069137811660767, -0.07189952582120895, 0.24165821075439453, -0.057047173380851746, 0.8696225881576538, 0.1298745572566986, 0.5887224674224854, 0.29412949085235596, -0.04206107184290886, -0.131720632314682, 0.15704958140850067, 0.44847503304481506, -0.07253142446279526, -0.23547245562076569, -0.0910099595785141, -0.07375432550907135, -0.44422459602355957, 0.01625104993581772, 0.08128955960273743, -0.13000638782978058, 0.10581676661968231, 0.11791771650314331, 0.0401383638381958, -0.49022355675697327, 0.15006086230278015, -0.2236541509628296, 0.4299735426902771, 0.03398421034216881, 0.04958992451429367, -0.18432000279426575, 0.07096496224403381, -0.06604930758476257, 0.3185136318206787, 0.3596750795841217, -0.1653868407011032, -0.28255894780158997, -0.24492257833480835, -0.4070914089679718, 0.271833598613739, 0.20864176750183105, 0.6490628123283386, -0.36508360505104065, -0.051518283784389496, 0.15541031956672668, -0.11827769875526428, 0.6872672438621521, -0.36505427956581116, -0.32051050662994385, 0.17347502708435059, -0.23746073246002197, -0.5629181861877441, -0.003748871386051178, -0.06868913024663925, 0.4195616543292999, 0.3418220281600952, 0.3900361955165863, -0.17150910198688507, -0.20591385662555695, -0.1286260187625885, 0.1811252385377884, -0.20134228467941284, -0.012632561847567558, -0.13357847929000854, -0.34962818026542664, -0.1660870760679245, 0.3981916010379791, 0.27576082944869995, -0.04254200682044029, -0.03803543001413345, -0.2921115756034851, 0.0026722848415374756, -0.4167538583278656, 0.07474233955144882, 0.2049507051706314, 0.09553134441375732, -0.1152830421924591, 0.4374220073223114, -0.027605600655078888, -0.24378585815429688, 0.15716180205345154, 0.2030756175518036, -0.297149121761322, -0.31901612877845764, 0.269224613904953, -0.053191352635622025, 0.4508872628211975, 0.5908466577529907, -0.2174634486436844, 0.4600933790206909, -0.3152121901512146, 0.2266242802143097, 0.04398775473237038, 0.129129558801651, 0.03962860256433487, 0.2531462609767914, -0.3305380344390869, 0.11524717509746552, 0.02660946175456047, 0.3019269108772278, -0.19706256687641144, 0.7470842003822327, -0.29083961248397827, -0.20321118831634521, 0.30440932512283325, -0.0013579130172729492, 0.7934040427207947, 0.04794472083449364, -0.06845000386238098, -0.07910987734794617, -0.15346819162368774, -0.004587847739458084, -0.09196774661540985, 0.0859222561120987, -0.04666530340909958, -0.44154566526412964, -0.020328406244516373, -0.20543056726455688, 0.27376917004585266, -0.03546014428138733, 0.040600936859846115, 0.10542426258325577, -0.36901789903640747, 0.26843592524528503, 0.11834493279457092, 0.019532673060894012, -0.058850690722465515, -0.19296914339065552, -0.3691394627094269, 0.028058167546987534, 0.20624594390392303, -0.08046670258045197, -0.18469712138175964, 0.05518430098891258, 0.29157108068466187, -0.09485606849193573, -0.40290695428848267, -0.21058127284049988, -0.3804667890071869, -0.04133860394358635, 0.34513577818870544, -0.17180529236793518, 0.1930072158575058, -0.39342886209487915, -0.042041413486003876, 0.37530091404914856, 0.08403534442186356, 0.3662062883377075, 0.24658504128456116, 0.3120671510696411, 0.21859203279018402, -0.11432313174009323, 0.14960752427577972, 0.0875706896185875, 0.12604615092277527, 0.2128390073776245, -0.23629458248615265, -0.16497516632080078, 0.034582287073135376, 0.1743500828742981, 0.026269927620887756, -0.009294494986534119, 0.2045830339193344, -0.13198260962963104, -0.13916482031345367, -0.2996779978275299, 0.05227746441960335, 0.1700585037469864, -0.04005073755979538, 0.48107972741127014, -0.17668311297893524, -0.22494404017925262, -0.09518441557884216, 0.05290408805012703, -0.39096909761428833, 0.10285583138465881, 0.15938371419906616, 0.12940582633018494, -0.3699508309364319, -0.2909422516822815, 0.12728473544120789, -0.13736160099506378, -0.32592636346817017, 0.4770154654979706, -0.22353379428386688, -0.14527751505374908, 0.32845932245254517, -0.16076575219631195, 0.040521614253520966, -0.4442545771598816, -0.5381356477737427, -0.5232201814651489, -0.10030482709407806, -0.10409954190254211, 0.2841245234012604, 0.1288159191608429, -0.2971073389053345, 0.14718149602413177, -0.3411083221435547, 0.07570654898881912, -0.17313027381896973, -0.1610911786556244, -0.1709161400794983, 0.2337481528520584, -0.1339922547340393, 0.026559608057141304, 0.07994113862514496, -0.24244406819343567, -0.05820878595113754, 0.3190973401069641, -0.028823181986808777, -0.103561632335186, 0.0014091655611991882, 0.23285475373268127, 0.0027347691357135773, -0.17211724817752838, 0.13185632228851318, -0.1753024458885193, -0.010996855795383453, -0.18923965096473694, 0.13303907215595245, -0.11038424074649811, -0.11607326567173004, -0.46934282779693604, 0.08804455399513245, 0.25002962350845337, 0.23079247772693634, 0.4407772719860077, -0.06799346208572388, 0.1816462278366089, 0.14190958440303802, 0.1975937783718109, 0.040732115507125854, -0.0781760886311531, -0.051172468811273575, -0.041568830609321594, -0.15106776356697083, -0.12744343280792236, 0.4983494281768799, -0.1834816038608551, -0.08122432231903076, 0.3898981213569641, 0.23473337292671204, 0.6670910716056824, -0.22135980427265167, -0.04073713719844818, 0.33960461616516113, 0.07304780930280685, -0.22341251373291016, 0.015274855308234692, -0.17422622442245483, 0.28932952880859375, 0.0893215537071228, 0.24019721150398254, 0.08578313887119293, -0.06929698586463928, 0.38282155990600586, 0.4650992751121521, 0.49403703212738037, -0.07784150540828705, -0.03444299101829529, 0.2604542374610901, 0.1379854828119278, 0.058487627655267715, 0.3120250403881073, -0.06492114067077637, 0.0400821715593338, 0.39165133237838745, 0.026806984096765518, 0.1333325058221817, 0.1742820143699646, 0.12775054574012756, 0.14664828777313232, -0.26381105184555054, -0.1612909734249115, -0.03520829975605011, -0.31345027685165405, 0.11458545923233032, 0.1312296986579895, -0.23757317662239075, -0.23315192759037018, -0.26965704560279846, -0.012034264393150806, 0.4145660698413849, -0.20861390233039856, -0.022271856665611267, -0.21266838908195496, -0.0940655916929245, -0.0012556537985801697, -0.11109146475791931, 0.14657731354236603, 0.04937807843089104, 0.2668037414550781, 0.20662373304367065, 0.10265068709850311, -0.34887024760246277, -0.3900430500507355, -0.11380723863840103, 0.22704797983169556, -0.23462370038032532, 0.18634450435638428, 0.17419520020484924, -0.06394441425800323, 0.04458599165081978, -0.2282649129629135, 0.4739919602870941, 0.39717328548431396, -0.48158717155456543, 0.05313265323638916, -0.2587224841117859, -0.0021266229450702667, -0.1392812281847, 0.41767576336860657, -0.16586488485336304, -0.030817236751317978, 0.11973384022712708, 0.024364015087485313, -0.09230601787567139, -0.02955109253525734, 0.2101878821849823, 0.4849408268928528, -0.29145461320877075, 0.3576728403568268, 0.05796483904123306, 0.29708945751190186, -0.15639203786849976, -0.08696679025888443, -0.24749481678009033, -0.136801615357399, 0.8093158602714539, -0.2547067105770111, 0.15016233921051025, -0.037289634346961975, 0.049197904765605927, -0.18390648066997528, 0.3463408648967743, 0.2971346080303192, -0.05747609585523605, -0.24629271030426025, -0.15037038922309875, -0.5363047122955322, -0.13579845428466797, -0.22495761513710022, -0.09381098300218582, 0.0839230865240097, 0.06491447985172272, -0.0736771747469902, 0.10421556234359741, 0.2103116512298584, -0.0726780965924263, 0.07790528982877731, 0.17117920517921448, -0.3332500755786896, -0.09054222702980042, -0.2872470021247864, -0.1946749985218048, -0.034635186195373535, -0.307563453912735, 0.2025897204875946, -0.08042549341917038, 0.006917733699083328, -0.04446077346801758, -0.5012185573577881, 0.18288972973823547, 0.3516503870487213, 0.16853132843971252, 0.33803048729896545, 0.1745954006910324, 0.07947665452957153, 0.01994205452501774, -0.0330178402364254, -0.25338292121887207, -0.01992301270365715, 0.1224815845489502, -0.04978947713971138, 0.11777973175048828, -0.17104795575141907, -0.2975553572177887, -0.26841410994529724, -0.054980989545583725, 0.0038815438747406006, 0.18347373604774475, -0.10120850801467896, 0.12196043878793716, -0.1772514134645462, 0.2118474245071411, -0.01952260360121727, 0.22120773792266846, 0.12108214199542999, 0.2346513718366623, -0.23947030305862427, -0.3126155734062195, 0.6490420699119568, -0.5173971056938171, -0.3695775866508484, -0.17631705105304718, 0.24208836257457733, 0.04795604944229126, -0.32252752780914307, -0.23580500483512878, -0.4832451343536377, 0.3280808925628662, -0.1267242431640625, -0.20731346309185028, -0.1310489922761917, 0.03750240057706833, 0.045856837183237076, -0.2393309473991394, 0.3887953758239746, 0.0023689493536949158, -0.0341571606695652, 0.20385584235191345, -0.12305836379528046 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
Hi! We made some improvements to `push_to_hub` to make it more robust a couple of weeks ago but haven't published a release in the meantime, so it would help if you could install `datasets` from `main` (`pip install https://github.com/huggingface/datasets`) and let us know if this improved version of `push_to_hub` resolves the issue (in case the `ConnectionError` happens, re-running `push_to_hub` should be faster now). Also, note that the previous implementation retries the upload, but sometimes this is not enough, so re-running the op is the only option.
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
86
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 Hi! We made some improvements to `push_to_hub` to make it more robust a couple of weeks ago but haven't published a release in the meantime, so it would help if you could install `datasets` from `main` (`pip install https://github.com/huggingface/datasets`) and let us know if this improved version of `push_to_hub` resolves the issue (in case the `ConnectionError` happens, re-running `push_to_hub` should be faster now). Also, note that the previous implementation retries the upload, but sometimes this is not enough, so re-running the op is the only option.
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
The update helped push more data. However it still crashed a little later: ``` Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 376, in _upload_parts_iteratively hf_raise_for_status(part_upload_res) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1699, in push_to_hub split_additions, uploaded_size, dataset_nbytes = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5215, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3665, in preupload_lfs_files _upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 401, in _upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_20/train-00206-of-00261.parquet' to the Hub. ```
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
223
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 The update helped push more data. However it still crashed a little later: ``` Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 376, in _upload_parts_iteratively hf_raise_for_status(part_upload_res) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1699, in push_to_hub split_additions, uploaded_size, dataset_nbytes = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5215, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3665, in preupload_lfs_files _upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 401, in _upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_20/train-00206-of-00261.parquet' to the Hub. ```
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
I think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed. The implementation in `main` pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time. Below is the another error log from another run with `main`. I've reverting back to the current release as it does the job for me. ``` Uploading the dataset shards: 86%|████████▌ | 224/261 [21:46<03:35, 5.83s/it]s] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 376, in _upload_parts_iteratively hf_raise_for_status(part_upload_res) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1699, in push_to_hub p, glob_pattern_to_regex(PUSH_TO_HUB_WITHOUT_METADATA_CONFIGS_SPLIT_PATTERN_SHARDED) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5215, in _push_parquet_shards_to_hub token = token if token is not None else HfFolder.get_token() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3665, in preupload_lfs_files _upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 401, in _upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_20/train-00224-of-00261.parquet' to the Hub. ```
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
312
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 I think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed. The implementation in `main` pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time. Below is the another error log from another run with `main`. I've reverting back to the current release as it does the job for me. ``` Uploading the dataset shards: 86%|████████▌ | 224/261 [21:46<03:35, 5.83s/it]s] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 376, in _upload_parts_iteratively hf_raise_for_status(part_upload_res) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1699, in push_to_hub p, glob_pattern_to_regex(PUSH_TO_HUB_WITHOUT_METADATA_CONFIGS_SPLIT_PATTERN_SHARDED) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5215, in _push_parquet_shards_to_hub token = token if token is not None else HfFolder.get_token() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3665, in preupload_lfs_files _upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 401, in _upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_20/train-00224-of-00261.parquet' to the Hub. ```
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
There's a new error from the hub now: ``` Pushing dataset shards to the dataset hub: 49%|████▉ | 128/261 [11:38<12:05, 5.45s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 293, in _retry raise err File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 1045, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3850, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 1045, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3237, in create_commit hf_raise_for_status(commit_resp, endpoint_name="commit") File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main (Request ID: Root=1-654e48e6-598511b14413bb293fa67084;783522b4-66f9-4f8a-8a74-2accf7cabd17) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` At least this is more explicit from the server side.
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
225
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 There's a new error from the hub now: ``` Pushing dataset shards to the dataset hub: 49%|████▉ | 128/261 [11:38<12:05, 5.45s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 270, in hf_raise_for_status response.raise_for_status() File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 121, in <module> main() File "convert_to_hf.py", line 109, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 293, in _retry raise err File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 1045, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3850, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 1045, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3237, in create_commit hf_raise_for_status(commit_resp, endpoint_name="commit") File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 330, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main (Request ID: Root=1-654e48e6-598511b14413bb293fa67084;783522b4-66f9-4f8a-8a74-2accf7cabd17) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` At least this is more explicit from the server side.
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
> think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed. > >The implementation in main pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time. > >Below is the another error log from another run with main. I've reverting back to the current release as it does the job for me. The `preupload` step is instant for the already uploaded shards, so only the Parquet conversion is repeated without uploading the actual Parquet data (only to check the SHAs). The previous implementation manually checks the Parquet shard's fingerprint to resume uploading, so the current implementation is cleaner. > You have exceeded our hourly quotas for action: commit. We invite you to retry later. This is the problem with the previous implementation. If the number of shards is large, it creates too many commits for the Hub in a short period.
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
178
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 > think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed. > >The implementation in main pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time. > >Below is the another error log from another run with main. I've reverting back to the current release as it does the job for me. The `preupload` step is instant for the already uploaded shards, so only the Parquet conversion is repeated without uploading the actual Parquet data (only to check the SHAs). The previous implementation manually checks the Parquet shard's fingerprint to resume uploading, so the current implementation is cleaner. > You have exceeded our hourly quotas for action: commit. We invite you to retry later. This is the problem with the previous implementation. If the number of shards is large, it creates too many commits for the Hub in a short period.
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
But I agree that the `500 Server Error` returned by the Hub is annoying. Earlier today, I also got it on a small 5GB dataset (with 500 MB shards). @Wauplin @julien-c Is there something we can do about this?
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
39
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 But I agree that the `500 Server Error` returned by the Hub is annoying. Earlier today, I also got it on a small 5GB dataset (with 500 MB shards). @Wauplin @julien-c Is there something we can do about this?
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
@mariosasko can't do much if AWS raises a HTTP 500 unfortunately (we are simply pushing data to a S3 bucket). What we can do is to add a retry mechanism in the multi-part upload logic here: https://github.com/huggingface/huggingface_hub/blob/c972cba1fecb456a7b3325cdd1fdbcc425f21f94/src/huggingface_hub/lfs.py#L370 :confused:
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
38
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 @mariosasko can't do much if AWS raises a HTTP 500 unfortunately (we are simply pushing data to a S3 bucket). What we can do is to add a retry mechanism in the multi-part upload logic here: https://github.com/huggingface/huggingface_hub/blob/c972cba1fecb456a7b3325cdd1fdbcc425f21f94/src/huggingface_hub/lfs.py#L370 :confused:
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]
https://github.com/huggingface/datasets/issues/6392
`push_to_hub` is not robust to hub closing connection
> That code already retries the request using http_backoff, no? Currently only on HTTP 503 by default. We should add 500 as well (and hope it is a transient error from AWS)
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
32
`push_to_hub` is not robust to hub closing connection ### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 > That code already retries the request using http_backoff, no? Currently only on HTTP 503 by default. We should add 500 as well (and hope it is a transient error from AWS)
[ -0.528481662273407, -0.36381134390830994, -0.0648718848824501, 0.1819303035736084, 0.3242589235305786, -0.20704445242881775, 0.17081214487552643, 0.30811524391174316, -0.03854181617498398, -0.02296958863735199, -0.19621892273426056, 0.1802101880311966, 0.17350462079048157, 0.04469935595989227, 0.06687537580728531, 0.036477230489254, 0.14159126579761505, 0.05757877603173256, -0.00749070942401886, -0.15354984998703003, -0.22179248929023743, 0.037004753947257996, -0.13432244956493378, 0.13027779757976532, -0.16990914940834045, -0.25265270471572876, 0.2624889314174652, 0.3343152701854706, -0.055671319365501404, -0.44492533802986145, 0.22087830305099487, 0.20424436032772064, -0.1798638254404068, 0.26940491795539856, -0.00011312132119201124, 0.09079407155513763, 0.25773170590400696, 0.06974117457866669, -0.2290952354669571, 0.0028390735387802124, -0.5200387835502625, -0.36414480209350586, -0.0908079594373703, -0.16243918240070343, 0.14515182375907898, 0.20871038734912872, -0.3388904929161072, 0.1936165690422058, 0.4470994472503662, 0.012405726127326488, 0.2051922231912613, 0.41037875413894653, 0.5811352133750916, -0.1925916075706482, 0.21170362830162048, -0.1271490901708603, -0.2800542712211609, 0.1825995296239853, 0.33075451850891113, 0.060192644596099854, -0.2460556924343109, -0.028496839106082916, 0.004077276214957237, -0.19606150686740875, -0.1110646203160286, -0.20254619419574738, -0.1438719928264618, -0.11469091475009918, -0.04216846823692322, 0.1616497039794922, -0.060242362320423126, -0.26355963945388794, -0.17657150328159332, -0.0916089341044426, -0.4114370346069336, -0.03760862350463867, 0.14648157358169556, -0.005322698503732681, -0.1069917380809784, 0.019071249291300774, -0.21786752343177795, -0.35013556480407715, -0.4473637640476227, 0.07534051686525345, 0.05242575705051422, 0.3607250452041626, 0.15071895718574524, 0.21767288446426392, -0.057595301419496536, -0.13654932379722595, 0.40549716353416443, -0.0013173073530197144, -0.12222498655319214, -0.31562796235084534, -0.27014651894569397, -0.31794390082359314, -0.08876942843198776, 0.27679023146629333, 0.26309460401535034, -0.010884378105401993, -0.24020947515964508, 0.23557427525520325, -0.14977721869945526, 0.0474599152803421, 0.3204139173030853, -0.03722286596894264, 0.13277581334114075, 0.21899013221263885, 0.3336617946624756, 0.40625375509262085, 0.04586036875844002, 0.16240113973617554, 0.31295377016067505, -0.24722754955291748, 0.28344807028770447, 0.23525464534759521, 0.41178470849990845, -0.05655178800225258, -0.25112608075141907, 0.2026958167552948, -0.14244559407234192, 0.28136056661605835, 0.16697503626346588, 0.2531502842903137, -0.10851798206567764, 0.278268426656723, -0.17488330602645874, -0.08216137439012527, -0.23290570080280304, 0.12418671697378159, -0.23586459457874298, 0.07622732222080231, 0.0844557136297226, -0.14305290579795837, 0.04444554075598717, -0.3138037919998169, 0.11527132987976074, 0.06759390980005264, -0.14542289078235626, -0.06632885336875916, -0.17613999545574188, -0.19454166293144226, 0.1692880541086197, 0.19967447221279144, 0.061756815761327744, 0.11178576201200485, -0.09917716681957245, -0.11202999949455261, 0.01052941381931305, -0.07000987976789474, -0.2471415102481842, -0.23404116928577423, -0.09466990828514099, 0.2755448818206787, -0.2959650158882141, -0.04244021326303482, -0.06385176628828049, -0.3337416350841522, -0.09965463727712631, 0.038190808147192, 0.22300225496292114, 0.09287574887275696, -0.2883155941963196, -0.19083935022354126, 0.1732926070690155, 0.4544134736061096, -0.06635837256908417, 0.25210121273994446, 0.5756645202636719, -0.10052068531513214, -0.18640181422233582, 0.21700458228588104, -0.0670560896396637, 0.08815820515155792, -0.14609017968177795, 0.09459938108921051, 0.06768618524074554, -0.5594079494476318, -0.6116234660148621, 0.07956309616565704, -0.09101570397615433, -0.0723377987742424, -0.2778012454509735, 0.04108129069209099, 0.33538299798965454, -0.20139272511005402, 0.16270285844802856, 0.14689956605434418, -0.12249958515167236, 0.09595467895269394, -0.42961618304252625, -0.2177642583847046, -0.062301166355609894, 0.06456564366817474, 0.2512776553630829, -0.23762977123260498, 0.3139607608318329, 0.3702259957790375, 0.3068266808986664, 0.3327186107635498, 0.24157458543777466, -0.029794879257678986, 0.761249840259552, -0.49083787202835083, 0.12300829589366913, -0.1720123291015625, -0.31675586104393005, 0.3562568426132202, 0.09405477344989777, 0.020950809121131897, -0.2331302911043167, -0.03730902820825577, -0.44377464056015015, 0.21274611353874207, -0.29106849431991577, 0.2547070384025574, 0.1914948970079422, -0.3782634139060974, -0.23941299319267273, 0.12919291853904724, 0.03755232319235802, 0.25974923372268677, -0.28753072023391724, 0.11948676407337189, -0.11245359480381012, 0.37269702553749084, -0.014083212241530418, -0.05159195140004158, -0.11481894552707672, 0.17815524339675903, 0.4325456917285919, -0.2639259994029999, -0.17749080061912537, 0.35142192244529724, 0.2647264301776886, 0.5595268607139587, 0.02797827497124672, -0.048180848360061646, 0.4132259488105774, 0.13488809764385223, 0.05590536445379257, 0.1453557312488556, 0.17661802470684052, -0.10312290489673615, 0.028874248266220093, 0.1891428828239441, 0.010528363287448883, 0.09417847543954849, 0.14678870141506195, 0.23189759254455566, 0.051684580743312836, -0.003278084099292755, 0.15436530113220215, -0.018236886709928513, -0.026811350136995316, 0.13306838274002075, -0.030921246856451035, -0.25578024983406067, 0.07531984150409698, 0.22665375471115112, 0.4046325981616974, -0.04230833798646927, 0.18770259618759155, 0.09728534519672394, 0.005704276263713837, -0.16288623213768005, 0.5374510288238525, 0.34231022000312805, 0.18167448043823242, -0.12198769301176071, -0.06255696713924408, 0.2495613396167755, -0.0352727435529232, -0.26275956630706787, 0.22255095839500427, 0.17581427097320557, 0.16026736795902252, 0.2398604154586792, 0.1359379142522812, -0.05890696123242378, -0.16813598573207855, -0.09647345542907715, -0.015119935385882854, 0.2090543657541275, -0.24365922808647156, -0.19879589974880219, -0.11176479607820511, 0.24134492874145508, 0.07122473418712616, -0.30600714683532715, -0.15859061479568481, -0.4963490962982178, 0.03930781036615372, 0.3852550983428955, -0.04042323678731918, 0.23162685334682465, 0.15346920490264893, -0.07658930122852325, 0.23951561748981476, -0.01838248409330845, -0.12387415766716003, -0.10206593573093414, -0.03221824765205383, 0.061258409172296524, 0.1528642624616623, -0.012858923524618149, 0.3206233084201813, 0.08374092727899551, -0.1501460075378418, -0.37667813897132874, -0.04614663124084473, 0.10696303844451904, -0.0015542656183242798, 0.08456103503704071, 0.3149935007095337, 0.15179100632667542, 0.07912784069776535, -0.08228433132171631, 0.2515711486339569, -0.20877428352832794, -0.20279183983802795, 0.043150048702955246, -0.24940113723278046, -0.052509140223264694, 0.1533847153186798, -0.2042156457901001, -0.3127768933773041, -0.4688297510147095, 0.1986444741487503, -0.017671646550297737, 0.16634678840637207, 0.27965298295021057, 0.018320363014936447, -0.09549175202846527, 0.11568006128072739, -0.4859437644481659, -0.04564892500638962, -0.22048813104629517, 0.08353297412395477, -0.039118047803640366, -0.15864618122577667, 0.143246591091156, 0.09026230126619339, 0.389743834733963, 0.15323080122470856, -0.2842993140220642, -0.3886454999446869, 0.05775009095668793, 0.4125409722328186, -0.22374039888381958, -0.06655274331569672, 0.2963465452194214, 0.09480009227991104, -0.0234859436750412, 0.10128317028284073, 0.0752914696931839, 0.1893720179796219, 0.33697423338890076, -0.059863217175006866, -0.17415902018547058, 0.4545764923095703, 0.18910349905490875, 0.468547523021698, 0.09559781849384308, -0.03640080615878105, 0.373690664768219, 0.14594289660453796, 0.03774309903383255, -0.12048453837633133, -0.23412398993968964, 0.08729150146245956, 0.03683429956436157, -0.04916427284479141, -0.11511670053005219, -0.008907010778784752, 0.0681428462266922, -0.17651444673538208, -0.8343185186386108, -0.0162621159106493, -0.40259450674057007, -0.060729533433914185, -0.1268899142742157, -0.03597359359264374, -0.260073721408844, 0.1556001901626587, -0.03518437594175339, -0.25066304206848145, 0.1890832483768463, 0.11861702054738998, 0.1493770331144333, -0.18214762210845947, -0.108685202896595, 0.01064850203692913, -0.475269615650177, 0.15006643533706665, -0.09874320030212402, 0.6153148412704468, 0.10602058470249176, 0.15799206495285034, -0.10538090765476227, -0.08348145335912704, 0.5064742565155029, -0.39414212107658386, 0.41831469535827637, -0.02448776550590992, -0.017408525571227074, -0.3797093629837036, -0.08534511923789978, 0.023724842816591263, 0.4133560061454773, 0.059525758028030396, 0.5642826557159424, -0.018063314259052277, -0.16323783993721008, 0.13608063757419586, -0.13477440178394318, -0.15753977000713348, -0.09861224889755249, 0.1278344690799713, -0.2673530876636505, -0.2064170390367508, 0.19261698424816132, 0.16030213236808777, -0.04623071104288101, -0.19220396876335144, -0.5829970836639404, 0.13898704946041107, -0.2578135132789612, -0.1253766417503357, 0.08267220854759216, -0.105892114341259, -0.3119417130947113, 0.3866189122200012, -0.16871795058250427, 0.18906846642494202, 0.21113409101963043, 0.048285868018865585, 0.015875980257987976, -0.14785116910934448, -0.13283106684684753, 0.11689835786819458, -0.010582096874713898, 0.44198325276374817, -0.17486843466758728, 0.5048894882202148, -0.29268065094947815, 0.29795026779174805, -0.19335535168647766, -0.269911527633667, 0.1175379827618599, 0.008113867603242397, -0.2920054793357849, 0.22871990501880646, 0.2640911936759949, -0.5037325024604797, -0.1823035180568695, 0.09574046730995178, 0.10928214341402054, -0.33483293652534485, 0.364967405796051, 0.1396094411611557, 0.809049665927887, 0.19690170884132385, -0.008485455065965652, 0.17121464014053345, -0.228065624833107, 0.27341228723526, -0.40121668577194214, -0.06029342859983444, -0.27821922302246094, 0.08096231520175934, -0.1274983286857605, 0.14412321150302887, -0.042506180703639984, -0.21513225138187408, -0.26546022295951843, 0.3971923887729645, -0.24349838495254517, 0.41456377506256104, -0.17483170330524445, 0.19973808526992798, -0.4170941710472107, -0.14634092152118683, -0.226215660572052, 0.19976337254047394, -0.07041946053504944, -0.06633056700229645, -0.15916267037391663, -0.21744705736637115, 0.049788739532232285, -0.060299716889858246, -0.20651882886886597, 0.1477663815021515, -0.12236778438091278, 0.2865954041481018, -0.07671213150024414, -0.23023468255996704, 0.12250836193561554, -0.1738305389881134, 0.504365086555481, 0.23136593401432037, -0.22027577459812164, 0.36879783868789673, -0.277092844247818, 0.04096419736742973, 0.1669892519712448, 0.0369514562189579, 0.15650150179862976, -0.06062780320644379, -0.4886523485183716, 0.016318514943122864, -0.0004289187490940094, -0.34163612127304077, -0.000696137547492981, -0.00010641664266586304, 0.22191859781742096, -0.3160945773124695, -0.01385844312608242, -0.21945780515670776, -0.4164386987686157, -0.31517094373703003, 0.1106070876121521, 0.027898292988538742, -0.10051248222589493, 0.44923874735832214, -0.07020449638366699, 0.04701392352581024, 0.04768437147140503, 0.5157437324523926, -0.03002048283815384, 0.03009941428899765, -0.0170612670481205, -0.06086637079715729, -0.22152894735336304, -0.30964961647987366, 0.1815682053565979, -0.005323980934917927, -0.22804194688796997, -0.033951081335544586, -0.23435990512371063, 0.07724043726921082, -0.032346438616514206, 0.19815553724765778, 0.18437786400318146, 0.29302799701690674, -0.10042635351419449, -0.39953306317329407, -0.17611728608608246, 0.014145821332931519, 0.2809900641441345, 0.1706993281841278, -0.17915499210357666, 0.09123019874095917, -0.013999403454363346, 0.16560180485248566, -0.32662999629974365, 0.2864396572113037, -0.2944996953010559, 0.006939122453331947, -0.738964319229126, -0.4197002351284027, 0.022332899272441864, -0.35489726066589355, 0.09718344360589981, 0.19590546190738678, -0.31896719336509705, -0.16169977188110352, -0.06185026094317436, 0.1339893341064453, 0.11479543149471283, -0.1937260925769806, -0.27456456422805786, -0.18928949534893036, 0.0020797327160835266, -0.015331612899899483, 0.3019901216030121, 0.2801002264022827, -0.08755002915859222, -0.16328153014183044, 0.5567863583564758, 0.15236303210258484, -0.20119784772396088, 0.22735528647899628, 0.04309842735528946, 0.3020722270011902, -0.11723267287015915, 0.09708785265684128, -0.03426612913608551, -0.16776275634765625, -0.02300201542675495, 0.31916362047195435, 0.27894437313079834, -0.007005669176578522, 0.6108006238937378, 0.037985678762197495, -0.44613683223724365, -0.03129874914884567, 0.35780030488967896, 0.2883886694908142, -0.21655906736850739, -0.14225009083747864, 0.02527627721428871, 0.2909022569656372, -0.00682801753282547, -0.30229100584983826, 0.3986339569091797, 0.05758403614163399, 0.16194404661655426, 0.06980748474597931, 0.4158879816532135, -0.43422046303749084, 0.1051742285490036, 0.20882487297058105, 0.7384705543518066, -0.3527730703353882, -0.04287531226873398, 0.049936484545469284, -0.06676021963357925, -0.022935371845960617, 0.014790952205657959, -0.1916702389717102, 0.422384649515152, 0.37998872995376587, -0.06635963171720505, 0.5152060389518738, 0.19689702987670898, 0.1681148111820221, 0.4001193344593048, -0.01824016124010086, -0.16329357028007507, -0.08139532804489136, -0.3458486497402191, -0.13393333554267883, 0.01605553925037384, 0.417539119720459, -0.2661278545856476, -0.09887217730283737, -0.2663508653640747, -0.039603110402822495, -0.20911741256713867, 0.1116117388010025, -0.23773233592510223, -0.24354234337806702, -0.24763482809066772, -0.06988638639450073, -0.07576984167098999, -0.2271924763917923, 0.11744564026594162, 0.09998559206724167, 0.02889387309551239, 0.4099730849266052, -0.10292660444974899, 0.1622997224330902, 0.35798484086990356, -0.22485697269439697, 0.2395046353340149, 0.3694722056388855, -0.005227804183959961, -0.5162065029144287, 0.2525750696659088, 0.3281417489051819, 0.1936667114496231, -0.23428508639335632, 0.4357721209526062, 0.7115525007247925, -0.02634718269109726, 0.07589754462242126, -0.07572899013757706, -0.08072967827320099, 0.20500798523426056, 0.21212710440158844, 0.19453734159469604, -0.09019706398248672, 0.09739178419113159, 0.13536284863948822, 0.010042045265436172, 0.1470256745815277, 0.1455032229423523, 0.055215779691934586, -0.4638769328594208, -0.18221403658390045, -0.05680830031633377, -0.03730921447277069, -0.011216838844120502, 0.2888385057449341, -0.2553592920303345, 0.4174145460128784, -0.09481142461299896, 0.09247022867202759, -0.2598995566368103, 0.3601951003074646, -0.011398281902074814, -0.1180419996380806, -0.40066519379615784, -0.2909895181655884, 0.07606187462806702, 0.2639942765235901, -0.13341067731380463, 0.08313880115747452, 0.0836578831076622, -0.083927683532238, -0.08996834605932236, 0.04305839166045189, -0.241982564330101, 0.1719885617494583, -0.2481640875339508, 0.1728663444519043, -0.40557044744491577, 0.07584849745035172, 0.41699135303497314, -0.20052626729011536, 0.007819581776857376, -0.32532861828804016, 0.4434134066104889, 0.13980992138385773, 0.03636839985847473, -0.07615652680397034, 0.18045346438884735, 0.31853535771369934, -0.29711949825286865, 0.2554425001144409, 0.044510237872600555, 0.11713014543056488, -0.20331242680549622, 0.06904184073209763, -0.1291133165359497, -0.4549543559551239, -0.022085141390562057, -0.3199598491191864, 0.04219859093427658, 0.13994619250297546, 0.33565253019332886, -0.2544044852256775, 0.0170560535043478, 0.2946918308734894, -0.23121964931488037, 0.3753139078617096, -0.048730961978435516, 0.10418156534433365, 0.021081998944282532, 0.1646931916475296, -0.09379348158836365, -0.022845156490802765, 0.014334302395582199, 0.14707805216312408, -0.3922528624534607, -0.46796801686286926, 0.45300257205963135, 0.19951403141021729, -0.06198843941092491, -0.2109808623790741, 0.4232173264026642, -0.2113935649394989, 0.15125854313373566, -0.3278174102306366, -0.21623660624027252, 0.3737124800682068, -0.08245849609375, -0.2542964518070221, 0.3176953196525574, 0.14912836253643036, -0.03891485184431076, 0.010235294699668884, 0.12204530090093613, 0.051973868161439896, -0.1723736971616745, 0.19821041822433472, -0.2277938574552536 ]