html_url
stringlengths
51
51
comments
stringlengths
67
24.7k
title
stringlengths
6
280
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/6008
By default, we write data to disk (so it can be memory-mapped) every 1000 rows/samples. You can control this with the `writer_batch_size` parameter. Also, when working with fixed-size arrays, the `ArrayXD` feature types yield better performance (e.g., in your case, `features=datasets.Features({"i": datasets.Array3D(shape=(512,512,3), dtype="float32")})` should be faster). Our support for multi-dim arrays could be better, and we plan to improve it as part of https://github.com/huggingface/datasets/issues/5272.
Dataset.from_generator consistently freezes at ~1000 rows
### Describe the bug Whenever I try to create a dataset which contains images using `Dataset.from_generator`, it freezes around 996 rows. I suppose it has something to do with memory consumption, but there's more memory available. I Somehow it worked a few times but mostly this makes the datasets library much more cumbersome to work with because generators are the easiest way to turn an existing dataset into a Hugging Face dataset. I've let it run in the frozen state for way longer than it can possibly take to load the actual dataset. Let me know if you have ideas how to resolve it! ### Steps to reproduce the bug ```python from datasets import Dataset import numpy as np def gen(): for row in range(10000): yield {"i": np.random.rand(512, 512, 3)} Dataset.from_generator(gen) # -> 90% of the time gets stuck around 1000 rows ``` ### Expected behavior Should continue and go through all the examples yielded by the generator, or at least throw an error or somehow communicate what's going on. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 12.0.1 - Pandas version: 1.5.1
64
Dataset.from_generator consistently freezes at ~1000 rows ### Describe the bug Whenever I try to create a dataset which contains images using `Dataset.from_generator`, it freezes around 996 rows. I suppose it has something to do with memory consumption, but there's more memory available. I Somehow it worked a few times but mostly this makes the datasets library much more cumbersome to work with because generators are the easiest way to turn an existing dataset into a Hugging Face dataset. I've let it run in the frozen state for way longer than it can possibly take to load the actual dataset. Let me know if you have ideas how to resolve it! ### Steps to reproduce the bug ```python from datasets import Dataset import numpy as np def gen(): for row in range(10000): yield {"i": np.random.rand(512, 512, 3)} Dataset.from_generator(gen) # -> 90% of the time gets stuck around 1000 rows ``` ### Expected behavior Should continue and go through all the examples yielded by the generator, or at least throw an error or somehow communicate what's going on. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 12.0.1 - Pandas version: 1.5.1 By default, we write data to disk (so it can be memory-mapped) every 1000 rows/samples. You can control this with the `writer_batch_size` parameter. Also, when working with fixed-size arrays, the `ArrayXD` feature types yield better performance (e.g., in your case, `features=datasets.Features({"i": datasets.Array3D(shape=(512,512,3), dtype="float32")})` should be faster). Our support for multi-dim arrays could be better, and we plan to improve it as part of https://github.com/huggingface/datasets/issues/5272.
[ -0.23392441868782043, 0.08639460802078247, -0.021676111966371536, 0.5308259129524231, 0.25551488995552063, 0.06502610445022583, 0.18270829319953918, 0.12610292434692383, 0.018689557909965515, 0.13800251483917236, 0.3685626983642578, 0.0700070858001709, -0.11341309547424316, -0.04352249577641487, 0.21163655817508698, -0.162801131606102, 0.18643930554389954, 0.033358220010995865, -0.15204761922359467, 0.11200609803199768, -0.19376808404922485, 0.22954677045345306, -0.08766490966081619, -0.1375642865896225, -0.504357635974884, 0.02291911281645298, 0.07868795841932297, 0.07606570422649384, -0.09356105327606201, -0.3485184609889984, 0.05156245082616806, 0.0006254678592085838, -0.1145317405462265, 0.56371009349823, -0.0001165739813586697, -0.22443699836730957, 0.3946678340435028, 0.16028809547424316, -0.25656425952911377, 0.06415907293558121, 0.11963288486003876, -0.19873058795928955, -0.17921066284179688, 0.13567262887954712, 0.07975443452596664, -0.17916232347488403, -0.0719757005572319, -0.3464815020561218, 0.12234586477279663, -0.05246547609567642, 0.08364647626876831, 0.32239365577697754, 0.2965673804283142, -0.039050742983818054, 0.10245595872402191, 0.13681823015213013, -0.20453232526779175, 0.11878228187561035, 0.10920648276805878, -0.38344332575798035, 0.16552290320396423, 0.21299201250076294, -0.1312476247549057, -0.09944610297679901, 0.6180312633514404, 0.039833877235651016, -0.4363197386264801, -0.4537254571914673, 0.14489153027534485, 0.513300359249115, 0.11524365842342377, -0.1417311429977417, -0.05501889809966087, -0.40547722578048706, 0.013362724334001541, -0.15448790788650513, 0.1296038031578064, 0.15959209203720093, -0.5288105607032776, -0.11928961426019669, -0.4460153877735138, -0.30943530797958374, -0.1382605880498886, 0.052703335881233215, -0.09192134439945221, -0.4760782718658447, 0.01987529918551445, 0.1526963710784912, 0.6393077373504639, 0.05576654151082039, 0.14567744731903076, -0.3242189288139343, -0.08046385645866394, -0.026995856314897537, -0.5286962985992432, 0.11996708810329437, 0.08159881830215454, 0.13800600171089172, 0.3292006254196167, -0.17087283730506897, 0.031215880066156387, -0.05156968906521797, 0.16848842799663544, 0.019430862739682198, 0.18005329370498657, -0.02663339301943779, -0.20193280279636383, -0.001153796911239624, 0.3610374331474304, 0.22731584310531616, -0.19872494041919708, 0.01268671452999115, -0.04656801000237465, -0.41565948724746704, 0.3721012473106384, -0.5013092756271362, -0.06593096256256104, 0.002784334123134613, -0.08749771118164062, 0.34681782126426697, -0.20416899025440216, 0.07764476537704468, 0.16241934895515442, 0.14718148112297058, -0.048842694610357285, 0.22698944807052612, 0.0643187016248703, -0.057846549898386, -0.254560649394989, -0.3987879753112793, -0.2012033462524414, -0.1562642604112625, -0.18685294687747955, 0.16271406412124634, 0.11031922698020935, -0.3484412729740143, -0.1184908002614975, 0.0446745865046978, 0.13505057990550995, -0.03561913222074509, 0.18020404875278473, -0.24428194761276245, 0.09055526554584503, 0.28259003162384033, -0.12830854952335358, 0.05915533006191254, -0.011513404548168182, 0.005954094231128693, -0.01767633855342865, 0.2485702782869339, 0.22160999476909637, -0.06542208045721054, 0.08365190774202347, 0.03248823806643486, -0.19016104936599731, 0.47275057435035706, -0.3420098125934601, 0.11639825254678726, 0.3018113374710083, 0.12161306291818619, 0.0646454319357872, -0.22288158535957336, -0.12663544714450836, -0.17059670388698578, 0.33967286348342896, 0.7386091351509094, -0.417077898979187, 0.4211229681968689, -0.17905764281749725, -0.15526801347732544, 0.02246152237057686, 0.3191035985946655, -0.048726703971624374, 0.13422709703445435, -0.2352975755929947, -0.3763853907585144, -0.1554940640926361, 0.4149402678012848, -0.35555464029312134, 0.1737462282180786, -0.06527635455131531, 0.17923851311206818, 0.03591981157660484, 0.3857303261756897, -0.01847098208963871, -0.012091871351003647, 0.38323113322257996, 0.40035122632980347, -0.29625946283340454, 0.1078871563076973, -0.32898369431495667, -0.3420765697956085, -0.14016082882881165, 0.19892090559005737, -0.18257850408554077, 0.11076818406581879, -0.10606297850608826, -0.036389656364917755, -0.04959633946418762, -0.20370379090309143, 0.03192070871591568, 0.30016231536865234, 0.129469096660614, -0.001905880868434906, 0.03213581442832947, -0.17601031064987183, -0.6538843512535095, 0.2607220709323883, -0.058563217520713806, 0.03524188697338104, -0.2697526216506958, 0.05941884219646454, 0.1494491994380951, 0.11284312605857849, -0.004324400797486305, -0.06958775222301483, -0.10223659873008728, -0.010988201946020126, 0.21149972081184387, 0.16260142624378204, -0.14252610504627228, 0.37883254885673523, -0.02692217007279396, 0.22426651418209076, -0.7463829517364502, 0.42097944021224976, 0.0934700146317482, -0.23404565453529358, -0.14855393767356873, -0.08477093279361725, -0.13188783824443817, -0.00932016596198082, -0.09299818426370621, 0.37008318305015564, 0.11927389353513718, 0.3519122302532196, -0.3957274854183197, 0.05162222683429718, 0.1352362334728241, -0.00980813056230545, 0.22749513387680054, -0.12949278950691223, 0.09893955290317535, 0.05881549417972565, 0.22371119260787964, 0.09396807849407196, -0.4959444999694824, 0.19043581187725067, -0.041861772537231445, -0.04338719695806503, -0.0446147546172142, 0.2673465311527252, 0.06469989567995071, 0.008941911160945892, 0.2823008596897125, 0.3480302691459656, 0.20729902386665344, 0.15254905819892883, -0.4755436182022095, 0.15201681852340698, 0.38333556056022644, -0.0746765285730362, -0.0577811524271965, 0.17492569983005524, -0.13718146085739136, -0.1548609733581543, -0.03963237628340721, 0.3928322196006775, 0.3056362271308899, 0.04512371867895126, -0.1983313262462616, -0.022647932171821594, -0.1536429524421692, -0.1877862811088562, 0.2800898551940918, 0.09417569637298584, 0.23293036222457886, -0.041429586708545685, 0.009295225143432617, -0.12162826955318451, -0.225978821516037, -0.11652743071317673, -0.10880038887262344, 0.42256686091423035, -0.14041122794151306, 0.29356908798217773, -0.07319600135087967, -0.08334846049547195, 0.10467641055583954, 0.16933435201644897, -0.4824652373790741, -0.12345685809850693, -0.24440017342567444, 0.37344154715538025, -0.12301226705312729, -0.2095932960510254, 0.0024436265230178833, 0.2357969880104065, 0.24343401193618774, 0.08454695343971252, -0.3009319305419922, -0.18750663101673126, -0.2553953230381012, -0.06293660402297974, 0.3988228142261505, -0.008273318409919739, 0.2974635660648346, 0.0390503853559494, -0.12552626430988312, -0.1492874026298523, -0.13773910701274872, 0.07000812888145447, -0.13482682406902313, 0.6961285471916199, 0.24182835221290588, 0.5243450999259949, -0.15677087008953094, 0.20799432694911957, 0.22887222468852997, -0.3231235146522522, -0.09123463928699493, 0.2294842004776001, 0.11591675877571106, 0.07779063284397125, -0.09812793135643005, 0.1632595807313919, 0.007563991472125053, -0.26737552881240845, 0.2538444399833679, -0.16862735152244568, 0.1281529814004898, 0.17685994505882263, 0.5743893980979919, 0.03468900918960571, -0.09613858163356781, -0.1622677445411682, -0.11418353021144867, -0.5402125120162964, 0.42673060297966003, -0.0979248583316803, -0.3194722831249237, -0.11412014067173004, -0.2176811695098877, -0.2216169536113739, 0.44734081625938416, -0.5426099896430969, -0.016586456447839737, -0.5411643981933594, 0.13843710720539093, -0.1025780588388443, 0.0884104073047638, -0.0010569766163825989, 0.044705163687467575, 0.03796904906630516, -0.09483491629362106, -0.060281746089458466, 0.04417615011334419, -0.13504467904567719, 0.05964399501681328, 0.28438034653663635, 0.46590012311935425, 0.013570688664913177, 0.26043200492858887, 0.2778164744377136, -0.13462242484092712, 0.37195345759391785, 0.12347420305013657, 0.42095571756362915, -0.37973955273628235, -0.3551585078239441, -0.036929063498973846, 0.0864475667476654, -0.3474547863006592, -0.2913067042827606, 0.036403220146894455, 0.21863016486167908, -0.11573925614356995, 0.15171527862548828, 0.3093589246273041, -0.21223214268684387, 0.1311236172914505, 0.006411350332200527, 0.39833492040634155, 0.005881227552890778, 0.20788846909999847, -0.042570989578962326, -0.14664515852928162, -0.1952287256717682, -0.15762856602668762, 0.4216548502445221, -0.19828557968139648, -0.335894376039505, -0.10421501845121384, -0.580597996711731, 0.09382550418376923, 0.16216085851192474, 0.10058705508708954, 0.07801465690135956, 0.17767302691936493, 0.09486700594425201, -0.12060151994228363, 1.0974550247192383, 0.015833811834454536, -0.06996230781078339, 0.00006683170795440674, -0.10945691168308258, -0.2634546160697937, 0.3520747423171997, 0.18852660059928894, -0.32875585556030273, -0.07591642439365387, 0.06809809803962708, -0.4721677005290985, -0.20336294174194336, 0.03499584645032883, 0.624157726764679, -0.05062458664178848, -0.1518005132675171, -0.24309732019901276, -0.14317135512828827, -0.1686399132013321, -0.04402494430541992, -0.01840614154934883, 0.1250133216381073, 0.062283337116241455, -0.0837537944316864, 0.027916492894291878, -0.02717190608382225, -0.01328074187040329, 0.2633156180381775, 0.3303699195384979, -0.40560680627822876, 0.528752326965332, 0.24808716773986816, -0.6128925681114197, 0.46124038100242615, 0.4296267032623291, -0.09441855549812317, 0.015258235856890678, 0.038706302642822266, 0.1996227353811264, -0.009989913552999496, 0.5633199214935303, -0.10577482730150223, -0.0714714527130127, -0.015736129134893417, 0.4421923756599426, -0.10025275498628616, -0.04850824549794197, 0.35953471064567566, 0.09013502299785614, 0.0025660619139671326, -0.6119252443313599, 0.30725598335266113, 0.15121488273143768, 0.14855295419692993, 0.39999252557754517, 0.3100503981113434, -0.05905865132808685, 0.17895536124706268, 0.10333575308322906, 0.8632707595825195, -0.19596101343631744, 0.35471272468566895, 0.13945220410823822, -0.022791042923927307, 0.7570594549179077, 0.11996610462665558, 0.050905708223581314, -0.32940271496772766, -0.2961343824863434, 0.056748151779174805, -0.33704298734664917, 0.2566688358783722, 0.10256989300251007, 0.24285705387592316, 0.10615427792072296, -0.06613320857286453, -0.11809651553630829, -0.12884783744812012, 0.17812423408031464, -0.26771408319473267, -0.16856619715690613, -0.3257843852043152, 0.04886319488286972, -0.11632893979549408, 0.04948415234684944, 0.013527486473321915, -0.08572809398174286, -0.0051875039935112, 0.04467397928237915, -0.4197946786880493, 0.05403544753789902, -0.01873001456260681, 0.013864260166883469, 0.43680498003959656, -0.29647988080978394, -0.057727474719285965, 0.12379555404186249, 0.13290753960609436, 0.12584391236305237, -0.02120259404182434, 0.18998724222183228, -0.03817444667220116, -0.0432727113366127, 0.09818620979785919, -0.187455415725708, 0.2639933228492737, -0.04015006497502327, -0.20140808820724487, -0.06149652227759361, 0.07067632675170898, -0.21505814790725708, -0.18801474571228027, 0.02808206155896187, -0.19392910599708557, 0.019957732409238815, -0.14863236248493195, -0.10693834722042084, -0.07323823869228363, -0.2096269130706787, 0.08099105954170227, 0.4287315011024475, 0.1393459588289261, 0.2266952097415924, -0.24174398183822632, 0.0583198219537735, -0.13303755223751068, 0.24039915204048157, -0.1802891343832016, 0.058335065841674805, 0.31285297870635986, 0.4756775498390198, -0.11913297325372696, -0.17886042594909668, 0.19938933849334717, 0.20876020193099976, -0.5592321753501892, 0.589586615562439, -0.005669251084327698, 0.056469812989234924, -0.03960185497999191, -0.07314955443143845, -0.17206037044525146, -0.3669862151145935, 0.18529939651489258, -0.17377561330795288, -0.45336511731147766, 0.073545441031456, 0.18138118088245392, 0.26566341519355774, -0.02030482143163681, -0.20190376043319702, -0.14266309142112732, 0.08279024809598923, -0.18476465344429016, 0.004083655774593353, -0.07572582364082336, -0.016619516536593437, -0.021864796057343483, -0.2802450656890869, 0.18068180978298187, -0.2682436406612396, 0.035270318388938904, 0.2159481942653656, -0.2324921190738678, -0.132076233625412, -0.11473636329174042, 0.16285990178585052, -0.09713657945394516, -0.6547067761421204, 0.15946754813194275, -0.2889295816421509, -0.09890593588352203, -0.11093287914991379, 0.2862960696220398, 0.08668354898691177, -0.13293883204460144, -0.2782506048679352, 0.1694982498884201, 0.19057597219944, -0.060321055352687836, 0.2203228771686554, -0.3241502046585083, 0.3692478537559509, 0.27310460805892944, 0.1509193331003189, 0.01663145422935486, -0.20014238357543945, -0.519633948802948, 0.16462114453315735, -0.14126047492027283, -0.16545788943767548, 0.7667937278747559, -0.3258703052997589, -0.20179958641529083, 0.13711632788181305, 0.34593603014945984, 0.47160232067108154, -0.16363593935966492, -0.16450360417366028, 0.2084178626537323, 0.07714653015136719, -0.04701624810695648, -0.09400579333305359, -0.26706311106681824, 0.11250009387731552, -0.019959144294261932, 0.18356992304325104, -0.11430426687002182, -0.08121445029973984, -0.21115648746490479, 0.24105893075466156, 0.48022496700286865, -0.08598868548870087, 0.07862046360969543, 0.31064870953559875, 0.17902988195419312, 0.01553510595113039, 0.21092376112937927, 0.2803291082382202, 0.24983808398246765, 0.4078854024410248, 0.09858808666467667, -0.015324076637625694, -0.08281612396240234, 0.16499453783035278, 0.1332012563943863, -0.3211575150489807, 0.049733199179172516, 0.5653846859931946, -0.18763163685798645, 0.060055311769247055, -0.09178239107131958, 0.09459114074707031, -0.19308686256408691, -0.06932150572538376, -0.12197694182395935, 0.3069692850112915, 0.11773642152547836, 0.0577438659965992, -0.08739276230335236, -0.11780495196580887, -0.031183362007141113, 0.35876229405403137, -0.0415387824177742, -0.38740411400794983, 0.18697179853916168, 0.2900773584842682, -0.01530451700091362, -0.24478775262832642, 0.20449678599834442, -0.024581022560596466, 0.25181639194488525, -0.04912504926323891, -0.01747284270823002, 0.3373265862464905, -0.31143420934677124, -0.03231881558895111, 0.34226471185684204, 0.33233606815338135, 0.3261603116989136, -0.055734552443027496, 0.18288719654083252, -0.05339350551366806, -0.11417309939861298, -0.010387297719717026, 0.2763703465461731, -0.05423714593052864, 0.1226990669965744, 0.07855287194252014, -0.020124778151512146, -0.14687579870224, -0.15111489593982697, 0.1356925666332245, 0.35144925117492676, -0.40088316798210144, 0.40587878227233887, -0.20796024799346924, -0.1469656527042389, -0.07752834260463715, -0.12639591097831726, -0.36320024728775024, 0.0008514039218425751, 0.24967995285987854, -0.2686633765697479, -0.10143692046403885, -0.239585742354393, 0.02033008635044098, -0.10666044801473618, 0.6461858749389648, 0.24315135180950165, 0.21129459142684937, -0.20873498916625977, -0.252594918012619, -0.47847461700439453, -0.09714755415916443, -0.3785943388938904, 0.2563000023365021, 0.21410641074180603, 0.13908568024635315, -0.11252214014530182, 0.2046937495470047, -0.05171827971935272, 0.22512422502040863, -0.21120408177375793, 0.5177876949310303, -0.18980103731155396, -0.21606150269508362, -0.04021890088915825, -0.16928213834762573, -0.2578893303871155, -0.462108314037323, 0.4520483911037445, -0.4967787265777588, -0.03465308994054794, -0.014245555736124516, 0.1496865153312683, 0.025320827960968018, 0.3030041754245758, 0.19440129399299622, 0.36585286259651184, -0.0749521255493164, 0.20505067706108093, -0.41881421208381653, -0.29024574160575867, 0.1413879096508026, 0.060480326414108276, 0.019404249265789986, 0.21483084559440613, 0.47247159481048584, -0.14869888126850128, -0.3457722067832947, -0.40646475553512573, 0.3942202627658844, -0.08334346115589142, 0.16832195222377777, -0.2262355387210846, -0.07028930634260178, -0.06501968950033188, 0.1830456256866455, 0.40160641074180603, 0.28965991735458374, -0.04585910588502884, -0.03020969033241272, -0.40768298506736755, -0.10458825528621674, 0.21130934357643127, -0.39488908648490906, -0.4355940818786621, -0.03606931120157242, 0.05104184150695801, 0.11796820163726807, -0.3705900013446808, -0.08317165076732635, 0.11642342805862427, 0.035506460815668106, -0.07011333107948303, -0.026235099881887436, 0.3089855909347534, 0.02019895613193512, 0.046315476298332214, 0.10777579247951508, 0.4146459102630615, 0.1408940553665161, -0.1638304442167282, 0.20123381912708282, -0.09567449986934662 ]
https://github.com/huggingface/datasets/issues/6008
> By default, we write data to disk (so it can be memory-mapped) every 1000 rows/samples. You can control this with the `writer_batch_size` parameter. Also, when working with fixed-size arrays, the `ArrayXD` feature types yield better performance (e.g., in your case, `features=datasets.Features({"i": datasets.Array3D(shape=(512,512,3), dtype="float32")})` should be faster). > > Our support for multi-dim arrays could be better, and we plan to improve it as part of #5272. Thanks for the explanation! The Image array was just for demonstration, I use PIL Images in practice. Does that make a difference? What's the best approach for a dataset with PIL Images as rows?
Dataset.from_generator consistently freezes at ~1000 rows
### Describe the bug Whenever I try to create a dataset which contains images using `Dataset.from_generator`, it freezes around 996 rows. I suppose it has something to do with memory consumption, but there's more memory available. I Somehow it worked a few times but mostly this makes the datasets library much more cumbersome to work with because generators are the easiest way to turn an existing dataset into a Hugging Face dataset. I've let it run in the frozen state for way longer than it can possibly take to load the actual dataset. Let me know if you have ideas how to resolve it! ### Steps to reproduce the bug ```python from datasets import Dataset import numpy as np def gen(): for row in range(10000): yield {"i": np.random.rand(512, 512, 3)} Dataset.from_generator(gen) # -> 90% of the time gets stuck around 1000 rows ``` ### Expected behavior Should continue and go through all the examples yielded by the generator, or at least throw an error or somehow communicate what's going on. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 12.0.1 - Pandas version: 1.5.1
101
Dataset.from_generator consistently freezes at ~1000 rows ### Describe the bug Whenever I try to create a dataset which contains images using `Dataset.from_generator`, it freezes around 996 rows. I suppose it has something to do with memory consumption, but there's more memory available. I Somehow it worked a few times but mostly this makes the datasets library much more cumbersome to work with because generators are the easiest way to turn an existing dataset into a Hugging Face dataset. I've let it run in the frozen state for way longer than it can possibly take to load the actual dataset. Let me know if you have ideas how to resolve it! ### Steps to reproduce the bug ```python from datasets import Dataset import numpy as np def gen(): for row in range(10000): yield {"i": np.random.rand(512, 512, 3)} Dataset.from_generator(gen) # -> 90% of the time gets stuck around 1000 rows ``` ### Expected behavior Should continue and go through all the examples yielded by the generator, or at least throw an error or somehow communicate what's going on. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 12.0.1 - Pandas version: 1.5.1 > By default, we write data to disk (so it can be memory-mapped) every 1000 rows/samples. You can control this with the `writer_batch_size` parameter. Also, when working with fixed-size arrays, the `ArrayXD` feature types yield better performance (e.g., in your case, `features=datasets.Features({"i": datasets.Array3D(shape=(512,512,3), dtype="float32")})` should be faster). > > Our support for multi-dim arrays could be better, and we plan to improve it as part of #5272. Thanks for the explanation! The Image array was just for demonstration, I use PIL Images in practice. Does that make a difference? What's the best approach for a dataset with PIL Images as rows?
[ -0.2846596837043762, 0.23980244994163513, -0.03189616650342941, 0.5401877760887146, 0.2745557427406311, 0.07768195867538452, 0.22943264245986938, 0.1456349939107895, -0.06428185105323792, 0.1479133665561676, 0.47321951389312744, 0.16201141476631165, -0.09623195230960846, -0.16894245147705078, 0.1763302981853485, -0.14536423981189728, 0.1772185117006302, 0.055402614176273346, -0.11013825237751007, 0.0932638943195343, -0.2248649150133133, 0.13198775053024292, -0.10973354429006577, -0.09914633631706238, -0.5088114142417908, -0.038588158786296844, 0.06685829907655716, 0.060702789574861526, -0.11363206803798676, -0.32608550786972046, -0.004764080047607422, -0.028464769944548607, -0.07937714457511902, 0.5585951805114746, -0.00011423924297560006, -0.21501217782497406, 0.42926520109176636, 0.16199924051761627, -0.23918837308883667, 0.07229967415332794, 0.020624063909053802, -0.18559497594833374, -0.2388220727443695, 0.03292156755924225, 0.15410032868385315, -0.18168717622756958, -0.04727581888437271, -0.35378938913345337, 0.07014539837837219, -0.039609141647815704, 0.09901697933673859, 0.20086480677127838, 0.24194499850273132, 0.016087107360363007, 0.12368087470531464, 0.08559862524271011, -0.17550258338451385, 0.054483767598867416, 0.10860994458198547, -0.4039520025253296, 0.16115322709083557, 0.19589129090309143, -0.16285540163516998, -0.047279879450798035, 0.5518104434013367, 0.0377175398170948, -0.3966187834739685, -0.45438244938850403, 0.16855135560035706, 0.464810848236084, 0.18407846987247467, -0.10139002650976181, -0.039075303822755814, -0.3371533155441284, 0.031243305653333664, -0.12696745991706848, 0.1267213076353073, 0.16789838671684265, -0.5472928881645203, -0.1753893494606018, -0.42676612734794617, -0.324081689119339, -0.1847943365573883, 0.07540819048881531, -0.14951443672180176, -0.4421360492706299, 0.10474294424057007, 0.17632973194122314, 0.5535299181938171, 0.07022762298583984, 0.3398287892341614, -0.4138682782649994, -0.06194305047392845, -0.05519915372133255, -0.4862438440322876, 0.13043028116226196, 0.04955131560564041, 0.01860586367547512, 0.2560293674468994, -0.26107364892959595, 0.051489777863025665, -0.06929059326648712, 0.170765683054924, 0.055719342082738876, 0.20428363978862762, -0.021687109023332596, -0.22509081661701202, 0.11299936473369598, 0.3567562997341156, 0.14369767904281616, -0.2687658965587616, -0.0031383149325847626, -0.10220026224851608, -0.4228527545928955, 0.4659627676010132, -0.49220627546310425, -0.10321582108736038, -0.0001437366008758545, -0.10941335558891296, 0.3178335726261139, -0.2573317289352417, 0.07459553331136703, 0.1420297473669052, 0.10734401643276215, -0.0367807038128376, 0.26913848519325256, 0.0938137024641037, -0.0457879938185215, -0.24137692153453827, -0.4076400101184845, -0.17741326987743378, -0.1361803561449051, -0.19936233758926392, 0.13767921924591064, 0.061676204204559326, -0.22392432391643524, -0.18993499875068665, 0.01670442894101143, 0.08496266603469849, -0.019469618797302246, 0.2818613052368164, -0.31127193570137024, 0.10189376026391983, 0.25873100757598877, -0.11112833023071289, 0.052220575511455536, -0.04122353345155716, -0.00006766617298126221, 0.012864336371421814, 0.3906309902667999, 0.1780816912651062, -0.05274996533989906, 0.08184851706027985, 0.06520899385213852, -0.20729848742485046, 0.4525914490222931, -0.3437381386756897, 0.03610329329967499, 0.33951956033706665, 0.0786362737417221, 0.04292001202702522, -0.3112048804759979, -0.1099284216761589, -0.21468675136566162, 0.2633896768093109, 0.6580009460449219, -0.5300190448760986, 0.5070763826370239, -0.25761115550994873, -0.1267077624797821, 0.06389158964157104, 0.2849854826927185, -0.07725372910499573, 0.20645996928215027, -0.19473519921302795, -0.3684687614440918, -0.08012188225984573, 0.41329747438430786, -0.3649277091026306, 0.1840379387140274, -0.023284122347831726, 0.13829277455806732, -0.003381282091140747, 0.4027513861656189, 0.03613359481096268, -0.02333669923245907, 0.3640654683113098, 0.4388485550880432, -0.33500635623931885, 0.12307078391313553, -0.366913765668869, -0.32165491580963135, -0.1635628640651703, 0.2016158103942871, -0.09025154262781143, 0.06953124701976776, -0.0749807357788086, 0.02655130624771118, -0.10125114023685455, -0.17789924144744873, 0.05903754383325577, 0.27631351351737976, 0.13977915048599243, -0.04326168820261955, 0.04553602263331413, -0.11617054045200348, -0.5486617684364319, 0.23908796906471252, -0.0675681084394455, 0.003502708626911044, -0.31597527861595154, 0.13731414079666138, 0.1387784779071808, 0.11780977994203568, -0.018990468233823776, -0.05549247935414314, -0.07075046002864838, -0.008133836090564728, 0.12623372673988342, 0.11124362051486969, -0.08086027950048447, 0.372706800699234, -0.039434127509593964, 0.172309011220932, -0.651427686214447, 0.46134212613105774, 0.04409979283809662, -0.24963514506816864, -0.14359018206596375, -0.1556883156299591, -0.1302017867565155, 0.02855411171913147, -0.17804259061813354, 0.37737521529197693, 0.15661752223968506, 0.3332246243953705, -0.42527058720588684, 0.044291526079177856, 0.1445109099149704, -0.019872665405273438, 0.2916135787963867, -0.11689397692680359, 0.1466473937034607, 0.04430831968784332, 0.19176806509494781, 0.01601818948984146, -0.5017145276069641, 0.23192469775676727, -0.04307843744754791, -0.041255511343479156, -0.04434821754693985, 0.2570446729660034, 0.10654870420694351, 0.024127110838890076, 0.23407232761383057, 0.38631391525268555, 0.153178408741951, 0.1645139902830124, -0.427899032831192, 0.1377207487821579, 0.3752512037754059, -0.054645031690597534, -0.055482830852270126, 0.14723537862300873, -0.13377878069877625, -0.16619186103343964, -0.0023589767515659332, 0.4644366204738617, 0.30134475231170654, 0.057633671909570694, -0.229332834482193, -0.07176993042230606, -0.20745977759361267, -0.17823436856269836, 0.2513246238231659, 0.12930737435817719, 0.30999359488487244, 0.004553638864308596, 0.02961793541908264, -0.08892527222633362, -0.13208360970020294, -0.1937796175479889, -0.04197785630822182, 0.441768079996109, -0.12757202982902527, 0.292489618062973, -0.11439114809036255, -0.12023280560970306, 0.1408611685037613, 0.26622530817985535, -0.4049046039581299, -0.12877815961837769, -0.23305967450141907, 0.32246288657188416, -0.12721511721611023, -0.21361932158470154, -0.0629228726029396, 0.22511163353919983, 0.2765214741230011, 0.0639338344335556, -0.25737765431404114, -0.23236137628555298, -0.26994043588638306, -0.025175154209136963, 0.41678762435913086, 0.03837653994560242, 0.3071311414241791, 0.08527545630931854, -0.09853003919124603, -0.12772905826568604, -0.11341258883476257, 0.08658751845359802, -0.05356192961335182, 0.7252309918403625, 0.19585242867469788, 0.5032238960266113, -0.1376405954360962, 0.2017257958650589, 0.2153654843568802, -0.2976483702659607, -0.0517435297369957, 0.25959041714668274, 0.1363571584224701, 0.05848893150687218, -0.05076014995574951, 0.12825626134872437, 0.0018199793994426727, -0.29907363653182983, 0.0843481719493866, -0.13901309669017792, 0.19168737530708313, 0.16255304217338562, 0.6198644042015076, -0.00363168865442276, -0.02123144455254078, -0.2040177881717682, -0.10830818116664886, -0.5015448331832886, 0.45245102047920227, -0.08048015832901001, -0.2766600549221039, -0.15129011869430542, -0.26399683952331543, -0.17915591597557068, 0.5246622562408447, -0.5350551009178162, 0.03215041756629944, -0.4869946241378784, 0.09946702420711517, -0.11846154928207397, 0.044890642166137695, -0.0337459072470665, 0.10930574685335159, 0.03389851003885269, -0.1314215064048767, -0.018756181001663208, 0.0035880394279956818, -0.08577116578817368, 0.1113101989030838, 0.32324719429016113, 0.46901893615722656, 0.07014202326536179, 0.2706201672554016, 0.2258562445640564, -0.16583482921123505, 0.33914387226104736, 0.14920948445796967, 0.35421478748321533, -0.34698858857154846, -0.3039401173591614, -0.04191369190812111, 0.07870923727750778, -0.4306832551956177, -0.3505067825317383, 0.01523648202419281, 0.11482111364603043, -0.0939556360244751, 0.20657874643802643, 0.259604811668396, -0.2002478539943695, 0.19473186135292053, -0.06097060814499855, 0.4160272777080536, 0.04382583498954773, 0.1961716115474701, -0.07425536215305328, -0.13151338696479797, -0.2449144423007965, -0.21728649735450745, 0.40574222803115845, -0.2556469440460205, -0.3121426999568939, -0.12207534909248352, -0.4617151916027069, 0.1155788004398346, 0.1795959323644638, 0.16855309903621674, 0.07579299807548523, 0.21226894855499268, 0.08575840294361115, -0.12499964237213135, 1.0327808856964111, -0.11388223618268967, -0.10005860030651093, 0.1048569530248642, -0.044580962508916855, -0.23656156659126282, 0.31513649225234985, 0.17007897794246674, -0.29740217328071594, -0.10053212940692902, 0.03125166520476341, -0.41917455196380615, -0.15329430997371674, 0.011574026197195053, 0.6201238036155701, -0.08009526133537292, -0.21327625215053558, -0.21533018350601196, -0.11055944859981537, -0.1707935929298401, -0.07434982061386108, -0.09598764777183533, 0.12437048554420471, 0.04325760155916214, -0.12064092606306076, 0.008626433089375496, -0.0013899430632591248, -0.05077569559216499, 0.2760029137134552, 0.3405369520187378, -0.508439838886261, 0.5067418813705444, 0.17861777544021606, -0.6698691248893738, 0.535741925239563, 0.3336401879787445, -0.08476991206407547, 0.1320694088935852, 0.07857756316661835, 0.1311006247997284, -0.030620727688074112, 0.48236048221588135, -0.11249247938394547, -0.15914714336395264, -0.07786796987056732, 0.3756299614906311, -0.041398968547582626, -0.03534725680947304, 0.3380686044692993, 0.043965406715869904, 0.008518580347299576, -0.6939513087272644, 0.30449652671813965, 0.20630162954330444, 0.09173743426799774, 0.4553499221801758, 0.09996509552001953, -0.07385800033807755, 0.23287221789360046, 0.17587436735630035, 0.8161531686782837, -0.19825610518455505, 0.29483911395072937, 0.10579600930213928, -0.007920339703559875, 0.7045273184776306, 0.03968113660812378, 0.07953804731369019, -0.3167240619659424, -0.25983887910842896, 0.0663832426071167, -0.3918268382549286, 0.25177639722824097, 0.19651103019714355, 0.22845685482025146, 0.10417042672634125, -0.08198653906583786, -0.17375525832176208, -0.10664180666208267, 0.17520207166671753, -0.28255197405815125, -0.11755307018756866, -0.25762027502059937, 0.08071103692054749, -0.11739896982908249, -0.02754492498934269, -0.007425714284181595, -0.05826596915721893, -0.061826884746551514, 0.06408563256263733, -0.41774484515190125, 0.0863572210073471, 0.01183272898197174, 0.09858405590057373, 0.3280778229236603, -0.281532883644104, -0.07046167552471161, 0.08935686945915222, 0.015062585473060608, 0.0944799929857254, 0.02469795010983944, 0.2039254903793335, 0.03597008436918259, -0.008213303983211517, 0.13375893235206604, -0.1929987221956253, 0.3067038059234619, -0.05253799632191658, -0.17955708503723145, -0.03725794330239296, 0.05039646476507187, -0.23622484505176544, -0.15941672027111053, 0.050389137119054794, -0.08777807652950287, 0.05565742403268814, -0.12346631288528442, -0.09099126607179642, -0.15722166001796722, -0.1748855710029602, 0.10156437754631042, 0.39252158999443054, 0.16465742886066437, 0.3733763098716736, -0.26825758814811707, 0.03448948264122009, -0.0940854623913765, 0.15631058812141418, -0.11974963545799255, 0.13013364374637604, 0.29121139645576477, 0.4247063398361206, -0.11652050912380219, -0.1980331540107727, 0.2375611513853073, 0.11947917938232422, -0.4976848363876343, 0.6020321249961853, -0.09340083599090576, 0.07517454028129578, -0.026150643825531006, -0.15179026126861572, -0.17517384886741638, -0.2675255239009857, 0.14566203951835632, -0.20450276136398315, -0.3929591476917267, 0.06058772653341293, 0.16621893644332886, 0.2766622006893158, -0.1052997037768364, -0.23696425557136536, -0.11069893836975098, 0.07359243929386139, -0.19775304198265076, 0.01910879835486412, -0.11177384108304977, 0.05899511277675629, -0.07022775709629059, -0.2092927247285843, 0.058935828506946564, -0.2892412841320038, 0.0413399338722229, 0.18662111461162567, -0.18296340107917786, -0.14935259521007538, -0.05912540853023529, 0.1692129224538803, -0.07339774072170258, -0.63823401927948, 0.14559979736804962, -0.35498809814453125, -0.07542319595813751, -0.06031422317028046, 0.17905014753341675, 0.05052352696657181, -0.19954630732536316, -0.3045194745063782, 0.16555029153823853, 0.2034173160791397, -0.0684974193572998, 0.29285740852355957, -0.38358744978904724, 0.42050498723983765, 0.31005892157554626, 0.21837277710437775, 0.112148717045784, -0.1927996724843979, -0.5685245990753174, 0.12513351440429688, -0.20220279693603516, -0.1142488643527031, 0.8146551251411438, -0.3179042637348175, -0.11795567721128464, 0.17514675855636597, 0.27931880950927734, 0.5136358141899109, -0.19589783251285553, -0.19506144523620605, 0.19602152705192566, 0.11726967990398407, -0.011586539447307587, -0.0698910728096962, -0.326943039894104, 0.10254625231027603, -0.033697355538606644, 0.1478847861289978, -0.10813786089420319, -0.1234770342707634, -0.2379685342311859, 0.24357561767101288, 0.509185254573822, -0.14045754075050354, 0.05737527832388878, 0.37023428082466125, 0.14121006429195404, 0.025253452360630035, 0.20801255106925964, 0.21653467416763306, 0.21064189076423645, 0.4395415782928467, 0.15743659436702728, -0.027222707867622375, 0.017615750432014465, 0.1467665135860443, 0.1289496272802353, -0.27347397804260254, 0.04639628529548645, 0.6055732369422913, -0.16326212882995605, 0.040422845631837845, -0.06592065095901489, -0.028558850288391113, -0.0968443900346756, -0.009737920016050339, -0.046527862548828125, 0.26786404848098755, 0.13168860971927643, 0.14078637957572937, -0.1852947175502777, -0.14741775393486023, -0.07852046191692352, 0.31921809911727905, -0.05565237998962402, -0.3324818015098572, 0.1502940058708191, 0.3416169285774231, -0.027998629957437515, -0.2377021610736847, 0.31781652569770813, -0.012499995529651642, 0.24047218263149261, -0.10663206875324249, -0.013993816450238228, 0.30176982283592224, -0.2620205581188202, 0.0025374265387654305, 0.361364483833313, 0.34653085470199585, 0.4161665141582489, -0.08501243591308594, 0.11164779216051102, -0.01859494112432003, -0.13596026599407196, -0.03961416333913803, 0.2521732449531555, -0.037540871649980545, 0.08781024068593979, 0.09876685589551926, 0.0036041438579559326, -0.15071526169776917, -0.12393368780612946, 0.1805805265903473, 0.2984219193458557, -0.34816962480545044, 0.39194297790527344, -0.12447647750377655, -0.1962600201368332, 0.0033198408782482147, -0.12639032304286957, -0.3523956537246704, -0.0026189759373664856, 0.2732345461845398, -0.30933210253715515, -0.08192864060401917, -0.2155751734972, 0.027289945632219315, -0.13345551490783691, 0.5787817239761353, 0.2186201810836792, 0.2281176894903183, -0.22451092302799225, -0.2510080337524414, -0.5032121539115906, -0.077933669090271, -0.4526006281375885, 0.21182480454444885, 0.22997918725013733, 0.20446497201919556, -0.11925134062767029, 0.23795530200004578, -0.03729551285505295, 0.2329179346561432, -0.23402926325798035, 0.604045033454895, -0.2543348968029022, -0.23695874214172363, 0.04452502727508545, -0.15528087317943573, -0.30946817994117737, -0.5237334966659546, 0.4212331771850586, -0.49923044443130493, 0.013841293752193451, 0.009801320731639862, 0.031924769282341, 0.13219551742076874, 0.3600899577140808, 0.2555672526359558, 0.35625413060188293, -0.01802482083439827, 0.20099350810050964, -0.3569003641605377, -0.2880409061908722, 0.147573783993721, 0.049515411257743835, 0.006261862814426422, 0.2508118450641632, 0.4368759095668793, -0.12755054235458374, -0.2914220690727234, -0.39917683601379395, 0.3179636001586914, -0.19393578171730042, 0.1991748809814453, -0.23123006522655487, -0.10659061372280121, -0.06534573435783386, 0.20349836349487305, 0.34678345918655396, 0.2090531885623932, -0.023128598928451538, -0.06056715175509453, -0.4488216042518616, -0.12680134177207947, 0.13858662545681, -0.3832705318927765, -0.47732430696487427, -0.07424893975257874, 0.048011600971221924, 0.02692563645541668, -0.23792210221290588, 0.02481837570667267, 0.06911596655845642, 0.12935256958007812, -0.09868715703487396, 0.0037331581115722656, 0.2596145272254944, 0.12006828188896179, 0.09673161804676056, 0.09136678278446198, 0.3783230483531952, 0.06643692404031754, -0.15843096375465393, 0.12385661900043488, -0.0933271273970604 ]
https://github.com/huggingface/datasets/issues/6007
This error means that one of the int32 (`Value("int32")`) columns in the dataset has a value that is out of the valid (int32) range. I'll open a PR to print the name of a problematic column to make debugging such errors easier.
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
42
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 This error means that one of the int32 (`Value("int32")`) columns in the dataset has a value that is out of the valid (int32) range. I'll open a PR to print the name of a problematic column to make debugging such errors easier.
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/6007
I am afraid int32 is not the reason for this error. I have submitted a commit to use int64 for all ints in the dataset: https://huggingface.co/datasets/liwu/MNBVC/commit/857ac00d9eab96a6708ad6a82bd9001686042a9e and I have updated my env to the latest datasets release: Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.13.1 - Platform: macOS-13.2.1-arm64-arm-64bit - Python version: 3.11.2 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 But the error still exist ``` Downloading and preparing dataset mnbvc/news_peoples_daily to /Users/silver/.cache/huggingface/datasets/liwu___mnbvc/news_peoples_daily/0.0.1/ee380f6309fe9b8b0d1fb14d77118f132444f22c8c4b28bf5c1645312688e051... Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 9070.40it/s] Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 2697.16it/s] --------------------------------------------------------------------------- OverflowError Traceback (most recent call last) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1647, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1646 example = self.info.features.encode_example(record) if self.info.features is not None else record -> 1647 writer.write(example, key) 1648 num_examples_progress_update += 1 File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:490, in ArrowWriter.write(self, example, key, writer_batch_size) 488 self.hkey_record = [] --> 490 self.write_examples_on_file() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:448, in ArrowWriter.write_examples_on_file(self) 444 batch_examples[col] = [ 445 row[0][col].to_pylist()[0] if isinstance(row[0][col], (pa.Array, pa.ChunkedArray)) else row[0][col] 446 for row in self.current_examples 447 ] --> 448 self.write_batch(batch_examples=batch_examples) 449 self.current_examples = [] File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:553, in ArrowWriter.write_batch(self, batch_examples, writer_batch_size) 552 typed_sequence = OptimizedTypedSequence(col_values, type=col_type, try_type=col_try_type, col=col) --> 553 arrays.append(pa.array(typed_sequence)) 554 inferred_features[col] = typed_sequence.get_inferred_type() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:236, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:189, in TypedSequence.__arrow_array__(self, type) 188 trying_cast_to_python_objects = True --> 189 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 190 # use smaller integer precisions if possible File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:320, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:39, in pyarrow.lib._sequence_to_array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1656, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1655 num_shards = shard_id + 1 -> 1656 num_examples, num_bytes = writer.finalize() 1657 writer.close() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:584, in ArrowWriter.finalize(self, close_stream) 583 self.hkey_record = [] --> 584 self.write_examples_on_file() 585 # If schema is known, infer features even if no examples were written File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:448, in ArrowWriter.write_examples_on_file(self) 444 batch_examples[col] = [ 445 row[0][col].to_pylist()[0] if isinstance(row[0][col], (pa.Array, pa.ChunkedArray)) else row[0][col] 446 for row in self.current_examples 447 ] --> 448 self.write_batch(batch_examples=batch_examples) 449 self.current_examples = [] File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:553, in ArrowWriter.write_batch(self, batch_examples, writer_batch_size) 552 typed_sequence = OptimizedTypedSequence(col_values, type=col_type, try_type=col_try_type, col=col) --> 553 arrays.append(pa.array(typed_sequence)) 554 inferred_features[col] = typed_sequence.get_inferred_type() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:236, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:189, in TypedSequence.__arrow_array__(self, type) 188 trying_cast_to_python_objects = True --> 189 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 190 # use smaller integer precisions if possible File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:320, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:39, in pyarrow.lib._sequence_to_array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[2], line 1 ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') File ~/git/venv/lib/python3.11/site-packages/datasets/load.py:1809, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1806 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1808 # Download and prepare data -> 1809 builder_instance.download_and_prepare( 1810 download_config=download_config, 1811 download_mode=download_mode, 1812 verification_mode=verification_mode, 1813 try_from_hf_gcs=try_from_hf_gcs, 1814 num_proc=num_proc, 1815 storage_options=storage_options, 1816 ) 1818 # Build dataset for splits 1819 keep_in_memory = ( 1820 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1821 ) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:909, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 907 if num_proc is not None: 908 prepare_split_kwargs["num_proc"] = num_proc --> 909 self._download_and_prepare( 910 dl_manager=dl_manager, 911 verification_mode=verification_mode, 912 **prepare_split_kwargs, 913 **download_and_prepare_kwargs, 914 ) 915 # Sync info 916 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1670, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1669 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1670 super()._download_and_prepare( 1671 dl_manager, 1672 verification_mode, 1673 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1674 or verification_mode == VerificationMode.ALL_CHECKS, 1675 **prepare_splits_kwargs, 1676 ) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1004, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1000 split_dict.add(split_generator.split_info) 1002 try: 1003 # Prepare split will record examples associated to the split -> 1004 self._prepare_split(split_generator, **prepare_split_kwargs) 1005 except OSError as e: 1006 raise OSError( 1007 "Cannot find data file. " 1008 + (self.manual_download_instructions or "") 1009 + "\nOriginal error:\n" 1010 + str(e) 1011 ) from None File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1508, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1506 job_id = 0 1507 with pbar: -> 1508 for job_id, done, content in self._prepare_split_single( 1509 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1510 ): 1511 if done: 1512 result = content File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1665, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1663 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1664 e = e.__context__ -> 1665 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1667 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Besides, it works fine when I am using streamed dataset.
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
763
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 I am afraid int32 is not the reason for this error. I have submitted a commit to use int64 for all ints in the dataset: https://huggingface.co/datasets/liwu/MNBVC/commit/857ac00d9eab96a6708ad6a82bd9001686042a9e and I have updated my env to the latest datasets release: Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.13.1 - Platform: macOS-13.2.1-arm64-arm-64bit - Python version: 3.11.2 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 But the error still exist ``` Downloading and preparing dataset mnbvc/news_peoples_daily to /Users/silver/.cache/huggingface/datasets/liwu___mnbvc/news_peoples_daily/0.0.1/ee380f6309fe9b8b0d1fb14d77118f132444f22c8c4b28bf5c1645312688e051... Downloading data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 9070.40it/s] Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 2697.16it/s] --------------------------------------------------------------------------- OverflowError Traceback (most recent call last) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1647, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1646 example = self.info.features.encode_example(record) if self.info.features is not None else record -> 1647 writer.write(example, key) 1648 num_examples_progress_update += 1 File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:490, in ArrowWriter.write(self, example, key, writer_batch_size) 488 self.hkey_record = [] --> 490 self.write_examples_on_file() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:448, in ArrowWriter.write_examples_on_file(self) 444 batch_examples[col] = [ 445 row[0][col].to_pylist()[0] if isinstance(row[0][col], (pa.Array, pa.ChunkedArray)) else row[0][col] 446 for row in self.current_examples 447 ] --> 448 self.write_batch(batch_examples=batch_examples) 449 self.current_examples = [] File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:553, in ArrowWriter.write_batch(self, batch_examples, writer_batch_size) 552 typed_sequence = OptimizedTypedSequence(col_values, type=col_type, try_type=col_try_type, col=col) --> 553 arrays.append(pa.array(typed_sequence)) 554 inferred_features[col] = typed_sequence.get_inferred_type() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:236, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:189, in TypedSequence.__arrow_array__(self, type) 188 trying_cast_to_python_objects = True --> 189 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 190 # use smaller integer precisions if possible File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:320, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:39, in pyarrow.lib._sequence_to_array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1656, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1655 num_shards = shard_id + 1 -> 1656 num_examples, num_bytes = writer.finalize() 1657 writer.close() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:584, in ArrowWriter.finalize(self, close_stream) 583 self.hkey_record = [] --> 584 self.write_examples_on_file() 585 # If schema is known, infer features even if no examples were written File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:448, in ArrowWriter.write_examples_on_file(self) 444 batch_examples[col] = [ 445 row[0][col].to_pylist()[0] if isinstance(row[0][col], (pa.Array, pa.ChunkedArray)) else row[0][col] 446 for row in self.current_examples 447 ] --> 448 self.write_batch(batch_examples=batch_examples) 449 self.current_examples = [] File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:553, in ArrowWriter.write_batch(self, batch_examples, writer_batch_size) 552 typed_sequence = OptimizedTypedSequence(col_values, type=col_type, try_type=col_try_type, col=col) --> 553 arrays.append(pa.array(typed_sequence)) 554 inferred_features[col] = typed_sequence.get_inferred_type() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:236, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:110, in pyarrow.lib._handle_arrow_array_protocol() File ~/git/venv/lib/python3.11/site-packages/datasets/arrow_writer.py:189, in TypedSequence.__arrow_array__(self, type) 188 trying_cast_to_python_objects = True --> 189 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 190 # use smaller integer precisions if possible File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:320, in pyarrow.lib.array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/array.pxi:39, in pyarrow.lib._sequence_to_array() File ~/git/venv/lib/python3.11/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[2], line 1 ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') File ~/git/venv/lib/python3.11/site-packages/datasets/load.py:1809, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1806 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1808 # Download and prepare data -> 1809 builder_instance.download_and_prepare( 1810 download_config=download_config, 1811 download_mode=download_mode, 1812 verification_mode=verification_mode, 1813 try_from_hf_gcs=try_from_hf_gcs, 1814 num_proc=num_proc, 1815 storage_options=storage_options, 1816 ) 1818 # Build dataset for splits 1819 keep_in_memory = ( 1820 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1821 ) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:909, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 907 if num_proc is not None: 908 prepare_split_kwargs["num_proc"] = num_proc --> 909 self._download_and_prepare( 910 dl_manager=dl_manager, 911 verification_mode=verification_mode, 912 **prepare_split_kwargs, 913 **download_and_prepare_kwargs, 914 ) 915 # Sync info 916 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1670, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1669 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1670 super()._download_and_prepare( 1671 dl_manager, 1672 verification_mode, 1673 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1674 or verification_mode == VerificationMode.ALL_CHECKS, 1675 **prepare_splits_kwargs, 1676 ) File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1004, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1000 split_dict.add(split_generator.split_info) 1002 try: 1003 # Prepare split will record examples associated to the split -> 1004 self._prepare_split(split_generator, **prepare_split_kwargs) 1005 except OSError as e: 1006 raise OSError( 1007 "Cannot find data file. " 1008 + (self.manual_download_instructions or "") 1009 + "\nOriginal error:\n" 1010 + str(e) 1011 ) from None File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1508, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1506 job_id = 0 1507 with pbar: -> 1508 for job_id, done, content in self._prepare_split_single( 1509 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1510 ): 1511 if done: 1512 result = content File ~/git/venv/lib/python3.11/site-packages/datasets/builder.py:1665, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1663 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1664 e = e.__context__ -> 1665 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1667 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Besides, it works fine when I am using streamed dataset.
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/6007
`simhash` is the problematic column - it has values such as `18329103420363166823` that are out of the int64 range. You can fix this by setting the feature type to `Value("string")` (it's advised to use this type for hash values in general) > Besides, it works fine when I am using streamed dataset. Streaming yields Python dictionaries from the script without converting them to the Arrow representation, as this conversion step is not that cheap performance-wise.
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
75
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 `simhash` is the problematic column - it has values such as `18329103420363166823` that are out of the int64 range. You can fix this by setting the feature type to `Value("string")` (it's advised to use this type for hash values in general) > Besides, it works fine when I am using streamed dataset. Streaming yields Python dictionaries from the script without converting them to the Arrow representation, as this conversion step is not that cheap performance-wise.
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/6007
i am using uint64 for simhash uint64 ranges up to about 3.69E19. 18329103420363166823 is less than this value. moreover, our simhash algorithm use 64 bits. it should fit in uint64.
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
30
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 i am using uint64 for simhash uint64 ranges up to about 3.69E19. 18329103420363166823 is less than this value. moreover, our simhash algorithm use 64 bits. it should fit in uint64.
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/6007
You are right. I overlooked the feature type. This is a reproducer: ```python import pyarrow as pa from datasets.arrow_writer import TypedSequence pa.array(TypedSequence([18329103420363166823], type=Value("uint64"))) ``` `pa.array([18329103420363166823])` also fails with the same error, so it seems PyArrow does not always infer the correct type as NumPy does (`uint64` in this case). I'll report this issue in the Arrow repo. `pa.array([18329103420363166823], pa.uint64)` works, so maybe we can implement a temporary fix (supporting complex input such as `[{"image": pil_image, "num": uint64_value}]` would be hard though). In the meantime, you should be able to bypass this error by returning the `simhash` values as NumPy scalars in the script: ```python def _generate_examples(self, ...): ... yield {..., "simhash": np.uint64(simhash), ...} ```
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
114
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 You are right. I overlooked the feature type. This is a reproducer: ```python import pyarrow as pa from datasets.arrow_writer import TypedSequence pa.array(TypedSequence([18329103420363166823], type=Value("uint64"))) ``` `pa.array([18329103420363166823])` also fails with the same error, so it seems PyArrow does not always infer the correct type as NumPy does (`uint64` in this case). I'll report this issue in the Arrow repo. `pa.array([18329103420363166823], pa.uint64)` works, so maybe we can implement a temporary fix (supporting complex input such as `[{"image": pil_image, "num": uint64_value}]` would be hard though). In the meantime, you should be able to bypass this error by returning the `simhash` values as NumPy scalars in the script: ```python def _generate_examples(self, ...): ... yield {..., "simhash": np.uint64(simhash), ...} ```
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/6007
Thank you for checking this issue in detail. However, it seems that using `np.uint64(simhash)` does not work. The same issue still exists. https://huggingface.co/datasets/liwu/MNBVC/commit/1e44f1e400b7e61052647d44c99cdae3bae9c830 Anyway, we decide to use string type for these simhash values. Hope pyarrow can fix their bug soon.
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset
### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5
41
Get an error "OverflowError: Python int too large to convert to C long" when loading a large dataset ### Describe the bug When load a large dataset with the following code ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ``` We encountered the error: "OverflowError: Python int too large to convert to C long" The error look something like: ``` OverflowError: Python int too large to convert to C long During handling of the above exception, another exception occurred: OverflowError Traceback (most recent call last) <ipython-input-7-0ed8700e662d> in <module> ----> 1 dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', cache_dir='/sfs/MNBVC/.cache/') /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1749 ignore_verifications=ignore_verifications, 1750 try_from_hf_gcs=try_from_hf_gcs, -> 1751 use_auth_token=use_auth_token, 1752 ) 1753 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 703 if not downloaded_from_gcs: 704 self._download_and_prepare( --> 705 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 706 ) 707 # Sync info /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos) 1225 1226 def _download_and_prepare(self, dl_manager, verify_infos): -> 1227 super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) 1228 1229 def _get_examples_iterable_for_split(self, split_generator: SplitGenerator) -> ExamplesIterable: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 791 try: 792 # Prepare split will record examples associated to the split --> 793 self._prepare_split(split_generator, **prepare_split_kwargs) 794 except OSError as e: 795 raise OSError( /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys) 1219 writer.write(example, key) 1220 finally: -> 1221 num_examples, num_bytes = writer.finalize() 1222 1223 split_generator.split_info.num_examples = num_examples /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 536 # Re-intializing to empty list for next batch 537 self.hkey_record = [] --> 538 self.write_examples_on_file() 539 if self.pa_writer is None: 540 if self.schema: /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 407 # Since current_examples contains (example, key) tuples 408 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 409 self.write_batch(batch_examples=batch_examples) 410 self.current_examples = [] 411 /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 506 col_try_type = try_features[col] if try_features is not None and col in try_features else None 507 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 508 arrays.append(pa.array(typed_sequence)) 509 inferred_features[col] = typed_sequence.get_inferred_type() 510 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /sfs/MNBVC/venv/lib64/python3.6/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 180 else: 181 trying_cast_to_python_objects = True --> 182 out = pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) 183 # use smaller integer precisions if possible 184 if self.trying_int_optimization: /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib.array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /sfs/MNBVC/venv/lib64/python3.6/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() OverflowError: Python int too large to convert to C long ``` However, that dataset can be loaded in a streaming manner: ```python from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train', streaming=True) for i in dataset: pass # it work well ``` Another issue is reported in our dataset hub: https://huggingface.co/datasets/liwu/MNBVC/discussions/2 ### Steps to reproduce the bug from datasets import load_dataset dataset = load_dataset("liwu/MNBVC", 'news_peoples_daily', split='train') ### Expected behavior the dataset can be safely loaded ### Environment info - `datasets` version: 2.4.0 - Platform: Linux-3.10.0-1160.an7.x86_64-x86_64-with-centos-7.9 - Python version: 3.6.8 - PyArrow version: 6.0.1 - Pandas version: 1.1.5 Thank you for checking this issue in detail. However, it seems that using `np.uint64(simhash)` does not work. The same issue still exists. https://huggingface.co/datasets/liwu/MNBVC/commit/1e44f1e400b7e61052647d44c99cdae3bae9c830 Anyway, we decide to use string type for these simhash values. Hope pyarrow can fix their bug soon.
[ -0.4273005723953247, -0.3950992226600647, -0.026656195521354675, 0.3553202748298645, 0.35095882415771484, -0.00437396764755249, 0.10522252321243286, 0.33112990856170654, 0.3119520843029022, 0.19228410720825195, -0.027331477031111717, 0.1621960550546646, -0.11134392023086548, 0.0895872563123703, -0.20462161302566528, -0.1775018572807312, 0.1220521479845047, -0.17765212059020996, -0.25584712624549866, 0.1860109567642212, -0.37808850407600403, -0.07006960362195969, -0.17661821842193604, 0.04806460067629814, -0.23183847963809967, -0.21604017913341522, 0.12426763027906418, 0.3667455017566681, -0.27562370896339417, -0.3445780575275421, 0.003411330282688141, -0.3893599510192871, 0.3516899645328522, 0.4516560733318329, -0.0001181446568807587, -0.18242868781089783, 0.11768405139446259, -0.04202890396118164, -0.32315704226493835, 0.09475984424352646, -0.039298515766859055, -0.5150792598724365, -0.006220899522304535, -0.45916748046875, 0.16284595429897308, -0.05158693343400955, -0.17475253343582153, -0.08125835657119751, 0.18807318806648254, 0.57615065574646, 0.19275721907615662, 0.05508647859096527, 0.3847641348838806, 0.066802017390728, 0.22039787471294403, -0.03740214556455612, -0.06243717670440674, 0.4031561017036438, 0.21089167892932892, 0.22969183325767517, -0.028704367578029633, -0.06308902055025101, -0.14894747734069824, -0.18602944910526276, 0.1188749149441719, -0.16871744394302368, 0.057088594883680344, -0.1999967396259308, 0.007224944420158863, -0.007968146353960037, 0.10818692296743393, -0.08280953019857407, -0.10172420740127563, -0.041200511157512665, 0.04498571902513504, -0.44882291555404663, -0.1035352349281311, 0.1953098475933075, 0.006717197597026825, 0.0862073227763176, -0.18851499259471893, -0.25022536516189575, -0.2555001378059387, 0.21202482283115387, -0.32102417945861816, -0.11662013828754425, -0.14016900956630707, 0.21713155508041382, 0.21627315878868103, -0.18306396901607513, 0.017507322132587433, -0.024291012436151505, 0.03425479307770729, 0.18231862783432007, -0.3292945325374603, -0.18983900547027588, 0.003925589844584465, 0.1016528308391571, 0.286570280790329, -0.04653053730726242, 0.06803914904594421, -0.01824970915913582, -0.1135217696428299, 0.14824602007865906, 0.1817092001438141, 0.1451258659362793, -0.6392799019813538, 0.4040762484073639, 0.3212817907333374, -0.025127405300736427, -0.18582548201084137, -0.08128368854522705, -0.049958907067775726, -0.30619409680366516, 0.25211194157600403, 0.10100926458835602, 0.3818822503089905, -0.3228905498981476, -0.4120517373085022, 0.1471565067768097, -0.21592259407043457, 0.28504419326782227, 0.28412026166915894, 0.3467128574848175, -0.09875400364398956, 0.23286613821983337, 0.07463954389095306, 0.0833415761590004, -0.23511537909507751, -0.202382892370224, -0.150694340467453, 0.10457059741020203, -0.0724998489022255, -0.044331662356853485, 0.09369862079620361, -0.0716947466135025, 0.1700402796268463, 0.2849712371826172, 0.18396587669849396, -0.33783626556396484, 0.005977615714073181, -0.478157639503479, 0.039766766130924225, 0.08606655895709991, -0.07800431549549103, -0.11582846194505692, 0.37072670459747314, 0.15519385039806366, -0.11944496631622314, 0.34183216094970703, -0.5060861706733704, -0.3711850345134735, -0.18037107586860657, 0.1869174689054489, 0.014307849109172821, -0.016629161313176155, -0.26676425337791443, -0.17007212340831757, 0.21955503523349762, -0.18516597151756287, 0.2114570438861847, -0.42568472027778625, 0.2160862535238266, -0.16842706501483917, -0.0490507073700428, 0.17450198531150818, -0.29947221279144287, 0.2589305639266968, -0.01978038065135479, 0.19197985529899597, 0.4121955633163452, 0.5086793303489685, -0.18264177441596985, -0.033356551080942154, -0.37830281257629395, -0.33097368478775024, 0.37573471665382385, -0.18065185844898224, -0.43467313051223755, 0.4298313856124878, -0.04181218147277832, -0.04125913977622986, -0.14741206169128418, 0.10902555286884308, 0.1871950626373291, -0.08169332891702652, 0.1933714598417282, 0.4011757969856262, -0.22514177858829498, 0.19181017577648163, -0.44967591762542725, -0.2674906849861145, 0.2478322982788086, 0.1967025250196457, 0.17562848329544067, -0.06670401990413666, 0.21777917444705963, -0.07312451303005219, 0.25881338119506836, -0.06310293078422546, -0.22276169061660767, 0.25805217027664185, 0.11467485129833221, 0.13091306388378143, -0.21843720972537994, -0.2864816188812256, 0.01084668468683958, -0.023134633898735046, -0.01016043871641159, -0.16320112347602844, 0.094716876745224, -0.15478792786598206, -0.5186917781829834, 0.23062562942504883, 0.07093217968940735, 0.36050814390182495, 0.04756283015012741, 0.018511712551116943, 0.16914497315883636, -0.06382644921541214, 0.1751849502325058, 0.45256415009498596, -0.43481284379959106, 0.0051934123039245605, -0.07389730215072632, 0.14947374165058136, -0.1353268027305603, -0.15584814548492432, 0.02662196010351181, 0.12149657309055328, 0.33217987418174744, -0.03791803866624832, -0.36545029282569885, 0.1801176369190216, -0.009776562452316284, -0.2948693335056305, -0.3651312589645386, -0.21572023630142212, 0.22062036395072937, -0.3945517838001251, 0.2989802658557892, 0.19280053675174713, 0.24524268507957458, -0.04735745117068291, 0.04771680384874344, 0.2859417200088501, -0.30865833163261414, 0.12132135033607483, 0.09259237349033356, -0.04177092760801315, 0.3189942538738251, -0.1241253986954689, 0.20322851836681366, 0.007417626678943634, 0.0014881612733006477, 0.1994989812374115, 0.1595279574394226, -0.05024346709251404, -0.20332945883274078, -0.1310964971780777, 0.671554446220398, -0.06587813794612885, 0.10676920413970947, 0.2518104314804077, -0.20792311429977417, -0.03859369456768036, 0.06895790249109268, -0.21736621856689453, 0.550590455532074, 0.3331359028816223, -0.08229215443134308, -0.06867194920778275, 0.014711707830429077, -0.09951230883598328, 0.26642993092536926, 0.1696024090051651, 0.32267507910728455, 0.15934407711029053, 0.4819997549057007, -0.044442642480134964, -0.20974662899971008, -0.27626320719718933, 0.04477185755968094, 0.26742926239967346, -0.38407057523727417, 0.38414135575294495, -0.06962013244628906, -0.251554012298584, -0.17747321724891663, -0.28449547290802, 0.004043566063046455, -0.3359317183494568, -0.3326468765735626, 0.43846115469932556, 0.017003104090690613, -0.07723622024059296, -0.22626936435699463, 0.06222877651453018, 0.3358648419380188, -0.2709208130836487, 0.1708352118730545, 0.05200760066509247, -0.2650725543498993, 0.011704735457897186, 0.4868502914905548, -0.24399998784065247, 0.34278759360313416, 0.12019676715135574, -0.16552463173866272, -0.039052508771419525, -0.20386984944343567, -0.12344835698604584, 0.09919226169586182, 0.1694277971982956, -0.030192892998456955, 0.3613824248313904, -0.21136343479156494, -0.16740286350250244, 0.010533709079027176, 0.043319642543792725, 0.05945548415184021, 0.16590341925621033, -0.10908278822898865, 0.14397025108337402, -0.03303413838148117, -0.2585493326187134, -0.44593414664268494, -0.5692219138145447, 0.10587559640407562, 0.059380605816841125, 0.13857054710388184, 0.25813642144203186, 0.12988749146461487, 0.24722826480865479, 0.3478856086730957, -0.11012275516986847, -0.31894880533218384, -0.13861903548240662, 0.35731762647628784, -0.17738918960094452, -0.19554077088832855, 0.10692112147808075, -0.024518195539712906, -0.047350868582725525, 0.14091208577156067, -0.40797409415245056, 0.1772584170103073, -0.42272499203681946, 0.46870094537734985, -0.4635942578315735, -0.04442078620195389, 0.1144370287656784, -0.21715886890888214, 0.010356038808822632, 0.12779755890369415, 0.09290213882923126, -0.12362039089202881, 0.14443928003311157, 0.49612313508987427, -0.2544419765472412, 0.44793465733528137, -0.1675303429365158, 0.5885947942733765, 0.17589029669761658, 0.05358093976974487, 0.34824326634407043, 0.02175559662282467, 0.014476725831627846, -0.21496382355690002, -0.3718562126159668, 0.0630587711930275, -0.22956813871860504, -0.17295874655246735, 0.06716451793909073, -0.0826604813337326, -0.07205042243003845, 0.12978975474834442, -0.21790872514247894, -0.051289282739162445, -0.22401146590709686, 0.20996154844760895, -0.09039053320884705, 0.1738799810409546, -0.14571203291416168, -0.09767315536737442, -0.24756312370300293, -0.23845571279525757, -0.17265363037586212, 0.1791299283504486, 0.018602076917886734, 0.0412871353328228, 0.10141317546367645, -0.16951845586299896, -0.2960937023162842, 0.25177648663520813, -0.02027669921517372, 0.378727525472641, 0.00327213853597641, 0.034303247928619385, -0.09064503759145737, -0.0984186977148056, 0.44563430547714233, 0.286112517118454, 0.07992542535066605, 0.09266813099384308, 0.17231769859790802, -0.44928431510925293, -0.07645618915557861, -0.10963431000709534, 0.39061108231544495, 0.5413092374801636, 0.30658158659935, -0.21160757541656494, 0.14862753450870514, 0.6596489548683167, 0.40459921956062317, -0.033488087356090546, -0.15791520476341248, -0.282258003950119, -0.3841201066970825, -0.29867836833000183, 0.24832358956336975, 0.27365541458129883, 0.2747375965118408, -0.24455854296684265, -0.28429847955703735, -0.28724613785743713, -0.07732900977134705, 0.020731579512357712, -0.10377249121665955, 0.24744513630867004, -0.27771705389022827, 0.18136048316955566, -0.43756166100502014, 0.23997749388217926, 0.24989578127861023, 0.566769540309906, 0.07643525302410126, -0.4990856945514679, 0.10596118867397308, 0.12008436024188995, 0.3082754909992218, 0.09950681030750275, -0.13070398569107056, 0.2255306839942932, -0.09968675673007965, 0.44804608821868896, -0.07788200676441193, 0.5246807932853699, -0.148279070854187, 0.22094720602035522, -0.34291088581085205, -0.19213354587554932, 0.5471701622009277, 0.16631555557250977, 0.19766579568386078, 0.31118491291999817, 0.026269830763339996, -0.30598124861717224, 0.31073564291000366, -0.16278792917728424, 0.849790632724762, 0.0666956901550293, -0.06066574901342392, 0.3852912187576294, -0.03204619884490967, 0.22019267082214355, -0.0002780705690383911, 0.1315300315618515, -0.3702273368835449, -0.027098724618554115, 0.18778759241104126, -0.13702905178070068, 0.06583860516548157, -0.18384605646133423, -0.2857062816619873, 0.2849736511707306, -0.25002336502075195, -0.09471611678600311, -0.048962872475385666, 0.33140942454338074, -0.3776554763317108, 0.007666807621717453, -0.2876812517642975, 0.1592930555343628, -0.386682391166687, -0.053935457020998, -0.08390773832798004, 0.04848678782582283, -0.08805999159812927, -0.1577218919992447, -0.24220113456249237, 0.08613096177577972, -0.284875750541687, 0.373124897480011, -0.2572709023952484, -0.29216721653938293, 0.5167392492294312, -0.09814140945672989, 0.08122821897268295, 0.2914045453071594, -0.06481875479221344, 0.034971434623003006, -0.14759624004364014, -0.18979211151599884, 0.05812516435980797, 0.17811056971549988, 0.10609791427850723, -0.02005016803741455, -0.28549763560295105, 0.04728541895747185, -0.0592295341193676, -0.16250263154506683, 0.024472340941429138, 0.10543495416641235, 0.5009013414382935, -0.4884926974773407, -0.3275986611843109, -0.2451355755329132, -0.09851661324501038, -0.2617267966270447, 0.11408819258213043, -0.06117526814341545, -0.13015511631965637, 0.20374424755573273, 0.22624042630195618, -0.4189799427986145, -0.10186898708343506, 0.17977894842624664, -0.003685580100864172, -0.12414636462926865, 0.47180840373039246, 0.17880357801914215, -0.19214409589767456, -0.13290202617645264, 0.3621407151222229, -0.19844719767570496, -0.38313958048820496, 0.24978657066822052, -0.08816049993038177, 0.31345340609550476, 0.04936467483639717, 0.16489416360855103, 0.12852787971496582, -0.026103854179382324, -0.05556495860219002, -0.47899454832077026, -0.6197270750999451, 0.020489629358053207, -0.1789807379245758, 0.0716436356306076, 0.2257624715566635, 0.11449196934700012, -0.3802780210971832, 0.060969702899456024, -0.2499333620071411, 0.11757152527570724, -0.09408152848482132, 0.10025638341903687, 0.15817895531654358, -0.28567296266555786, -0.15499526262283325, 0.08355066925287247, 0.14725877344608307, 0.3399650752544403, 0.20342284440994263, -0.2201191931962967, -0.1802954226732254, 0.12341971695423126, -0.006576906889677048, -0.315959095954895, -0.08770568668842316, -0.2838718891143799, 0.03739703446626663, -0.03816712275147438, 0.10210215300321579, 0.1163487583398819, 0.07618539035320282, 0.02099764347076416, -0.24134314060211182, 0.0034298282116651535, -0.12185095250606537, 0.1992436647415161, 0.13464666903018951, 0.40823808312416077, 0.19386868178844452, 0.5115569829940796, 0.24224497377872467, -0.046296678483486176, -0.43919482827186584, -0.008643422275781631, 0.3187030255794525, 0.036488451063632965, 0.34265968203544617, -0.26976871490478516, 0.075685054063797, 0.16929224133491516, -0.23282304406166077, 0.2291342318058014, -0.255435049533844, -0.0987740159034729, 0.26777684688568115, 0.16084608435630798, -0.17872202396392822, 0.13948796689510345, 0.15855368971824646, -0.3148193061351776, -0.023261405527591705, 0.2851651906967163, -0.20909331738948822, -0.14055588841438293, -0.2761327028274536, -0.022944927215576172, 0.21735185384750366, 0.27299338579177856, 0.0023755356669425964, 0.4859409034252167, -0.04427839815616608, -0.21067771315574646, 0.39080744981765747, 0.1611444354057312, 0.32881197333335876, 0.8358761072158813, -0.2156842201948166, 0.13327184319496155, -0.27342745661735535, 0.041664496064186096, -0.014557629823684692, -0.3601616322994232, -0.03347761556506157, 0.28801125288009644, -0.2637093961238861, 0.27294921875, 0.02029646746814251, 0.20703577995300293, -0.26228824257850647, -0.07231549918651581, -0.17346200346946716, 0.23263347148895264, -0.3106839060783386, 0.10655315220355988, 0.20396843552589417, 0.08396996557712555, -0.035195574164390564, 0.2106022983789444, -0.15057408809661865, -0.040507104247808456, 0.10409239679574966, 0.3406965136528015, -0.20162132382392883, -0.2716285288333893, 0.26083606481552124, 0.4320446848869324, 0.08981695026159286, -0.46410369873046875, 0.12155915796756744, 0.2563055157661438, 0.004215370863676071, -0.18154293298721313, -0.11361982673406601, 0.518314003944397, 0.2721559703350067, 0.020924046635627747, 0.032708071172237396, 0.05674492195248604, -0.14462006092071533, 0.1229279637336731, -0.2400071769952774, 0.1473473161458969, 0.40709927678108215, 0.2802128195762634, 0.08324109762907028, -0.1769864708185196, -0.03167212754487991, 0.13094188272953033, -0.08260278403759003, -0.2602497339248657, 0.2884724736213684, 0.05318606644868851, -0.3902147114276886, -0.25396886467933655, 0.010516069829463959, -0.25070130825042725, -0.06606025993824005, 0.41232389211654663, 0.07801249623298645, 0.24568064510822296, 0.16989673674106598, 0.042796533554792404, -0.2895325720310211, 0.43101072311401367, 0.2551945149898529, 0.2772292196750641, -0.5120603442192078, -0.11491236090660095, -0.31128764152526855, 0.1108938455581665, -0.3621388375759125, 0.035496048629283905, 0.19935059547424316, 0.07290630042552948, -0.14432835578918457, 0.11744130402803421, 0.24190334975719452, 0.2748088538646698, 0.35398054122924805, 0.16537050902843475, -0.1419418752193451, -0.4123850464820862, 0.07854028046131134, -0.12405791133642197, 0.0035364553332328796, -0.5456083416938782, 0.2555711567401886, -0.20637716352939606, 0.008678048849105835, -0.19115637242794037, 0.009041659533977509, 0.018496938049793243, -0.05934958904981613, 0.3211500942707062, 0.24234354496002197, 0.591717541217804, -0.010546721518039703, -0.01108492910861969, 0.24354153871536255, -0.14336077868938446, -0.10123233497142792, 0.2880120277404785, 0.10816310346126556, 0.37451744079589844, -0.035826291888952255, -0.07707174867391586, -0.2277897596359253, 0.18545475602149963, -0.020570911467075348, -0.5014036297798157, 0.04270125925540924, -0.20563319325447083, -0.12497739493846893, 0.08245620131492615, 0.06540268659591675, 0.2370985597372055, 0.01059313677251339, 0.272193968296051, -0.1350933015346527, -0.13359537720680237, 0.35315799713134766, 0.08318215608596802, -0.3751516342163086, 0.006107404828071594, 0.5184324979782104, 0.09052208811044693, -0.11257990449666977, -0.4577997326850891, 0.13875986635684967, 0.39225995540618896, -0.042852483689785004, -0.18254494667053223, 0.3959067761898041, 0.029019393026828766, 0.0926859974861145, -0.060139939188957214, 0.5353976488113403, -0.03100484423339367, -0.18696346879005432, 0.18142952024936676, -0.15507301688194275 ]
https://github.com/huggingface/datasets/issues/5997
I just noticed the [docs](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2881C11-L2881C200) say: >If batched is `True` and `batch_size` is `n > 1`, then the function takes a batch of `n` examples as input and can return a batch with `n` examples, or with an arbitrary number of examples. so maybe this is a bug then.
extend the map function so it can wrap around long text that does not fit in the context window
### Feature request I understand `dataset` provides a [`map`](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2849) function. This function in turn takes in a callable that is used to tokenize the text on which a model is trained. Frequently this text will not fit within a models's context window. In this case it would be useful to wrap around the text into multiple rows with each row fitting the model's context window. I tried to do it using this code as example which in turn I have borrowed from [here](https://stackoverflow.com/a/76343993/147530): ``` data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) ``` but running the code gives me this error: ``` File "/llm/fine-tune.py", line 117, in <module> data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3480, in _map_single writer.write_batch(batch) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_writer.py", line 556, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3798, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 2962, in pyarrow.lib.Table.validate File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 394 but got length 447 ``` The lambda function I have provided is correctly chopping up long text so it wraps around (and because of this 394 samples become 447 after wrap around) but the dataset `map` function does not like it. ### Motivation please see above ### Your contribution I'm afraid I don't have much knowledge to help
49
extend the map function so it can wrap around long text that does not fit in the context window ### Feature request I understand `dataset` provides a [`map`](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2849) function. This function in turn takes in a callable that is used to tokenize the text on which a model is trained. Frequently this text will not fit within a models's context window. In this case it would be useful to wrap around the text into multiple rows with each row fitting the model's context window. I tried to do it using this code as example which in turn I have borrowed from [here](https://stackoverflow.com/a/76343993/147530): ``` data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) ``` but running the code gives me this error: ``` File "/llm/fine-tune.py", line 117, in <module> data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3480, in _map_single writer.write_batch(batch) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_writer.py", line 556, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3798, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 2962, in pyarrow.lib.Table.validate File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 394 but got length 447 ``` The lambda function I have provided is correctly chopping up long text so it wraps around (and because of this 394 samples become 447 after wrap around) but the dataset `map` function does not like it. ### Motivation please see above ### Your contribution I'm afraid I don't have much knowledge to help I just noticed the [docs](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2881C11-L2881C200) say: >If batched is `True` and `batch_size` is `n > 1`, then the function takes a batch of `n` examples as input and can return a batch with `n` examples, or with an arbitrary number of examples. so maybe this is a bug then.
[ -0.3404634892940521, 0.03542882204055786, -0.08898577094078064, 0.043310411274433136, 0.17575713992118835, -0.04931211471557617, 0.30036675930023193, 0.36894655227661133, -0.09006550908088684, -0.17397615313529968, 0.09924708306789398, 0.5054342746734619, -0.03185398131608963, 0.32149404287338257, 0.11065222322940826, -0.35725125670433044, 0.09137898683547974, -0.0831860676407814, 0.4148484766483307, 0.30931544303894043, -0.35015034675598145, -0.08045724034309387, -0.39516276121139526, 0.15817491710186005, -0.12172611057758331, -0.20354029536247253, -0.28787991404533386, -0.3700942397117615, 0.07613245397806168, -0.21095067262649536, 0.004973582923412323, 0.10255733132362366, -0.1655050367116928, 0.25701630115509033, -0.00011748912220355123, -0.19098219275474548, -0.12051665782928467, -0.06064571812748909, 0.20487311482429504, -0.15861617028713226, 0.24906638264656067, -0.22372058033943176, -0.3613227903842926, -0.13529863953590393, 0.06681149452924728, -0.10928241163492203, -0.24335145950317383, -0.20687872171401978, 0.20258183777332306, 0.31924012303352356, 0.07839358597993851, 0.14948412775993347, 0.11391100287437439, -0.11100094765424728, 0.06787888705730438, 0.13695412874221802, 0.05119796097278595, 0.04567951336503029, 0.4494415819644928, -0.17819267511367798, -0.10504482686519623, 0.3481353521347046, -0.24123729765415192, -0.04752224311232567, 0.20192556083202362, -0.13029804825782776, -0.18552342057228088, -0.3786454498767853, -0.015575270168483257, 0.09814591705799103, 0.327703595161438, -0.3860630393028259, -0.27182668447494507, -0.40748584270477295, 0.14553695917129517, -0.1282467097043991, -0.02961663156747818, 0.057006217539310455, 0.04083309322595596, 0.07963022589683533, -0.3519148528575897, -0.33039650321006775, -0.14965525269508362, 0.2792609930038452, -0.30386513471603394, 0.2699810266494751, -0.011285442858934402, 0.37053078413009644, 0.1541323959827423, -0.27678996324539185, -0.09275981783866882, 0.03194929659366608, 0.08192650973796844, 0.2787820100784302, -0.10765397548675537, -0.13869282603263855, 0.1904054582118988, 0.19666121900081635, 0.408525288105011, 0.09637337177991867, -0.07297353446483612, 0.10346163809299469, 0.008602049201726913, -0.09260818362236023, 0.07116472721099854, -0.015173062682151794, 0.2624515891075134, 0.37069082260131836, -0.09171522408723831, -0.2511286735534668, -0.023759260773658752, -0.03629201650619507, -0.06699813157320023, -0.2617030441761017, -0.3784725069999695, -0.004213051870465279, -0.010323628783226013, 0.39840972423553467, 0.11973635107278824, -0.028969962149858475, -0.4952002465724945, 0.14215746521949768, 0.1988489031791687, 0.19346871972084045, 0.10586236417293549, -0.038450583815574646, 0.057175032794475555, 0.1793297976255417, 0.17043791711330414, -0.1749749481678009, -0.07210108637809753, -0.03683429956436157, -0.04450783133506775, 0.11701032519340515, -0.0439060814678669, 0.13054536283016205, 0.11023890227079391, -0.23393788933753967, 0.06001518666744232, -0.14506499469280243, -0.36502978205680847, -0.08257247507572174, 0.08170589804649353, 0.10225386917591095, -0.27387693524360657, 0.08975254744291306, 0.13631954789161682, 0.13719499111175537, -0.11911439895629883, 0.08527657389640808, -0.24731814861297607, -0.20247042179107666, -0.08486127108335495, -0.019698329269886017, 0.030587173998355865, 0.22943997383117676, -0.036157164722681046, 0.4400521516799927, 0.31176766753196716, -0.2603134512901306, 0.41029736399650574, -0.15097863972187042, -0.548576831817627, -0.25987228751182556, 0.15054821968078613, 0.2992435395717621, -0.37419867515563965, -0.1481691151857376, 0.04471909627318382, 0.1644093543291092, -0.1817164421081543, 0.26439014077186584, -0.10530459880828857, 0.25943824648857117, -0.30276745557785034, 0.5635426044464111, 0.4021022915840149, -0.38493943214416504, -0.635461688041687, 0.26098668575286865, -0.4728931188583374, -0.0904136449098587, -0.18840384483337402, -0.22286801040172577, 0.4414561986923218, 0.13902795314788818, 0.31493842601776123, 0.3012654781341553, -0.12266569584608078, -0.07793600857257843, 0.06015394628047943, -0.046221621334552765, 0.446577787399292, 0.13730375468730927, -0.11783359944820404, -0.146812304854393, -0.07267899811267853, -0.2149842381477356, 0.418283611536026, 0.0029621580615639687, 0.3336637616157532, -0.06229839101433754, 0.2277827262878418, 0.11390690505504608, -0.0394999235868454, -0.45590007305145264, -0.1641038954257965, -0.12966951727867126, 0.12050482630729675, -0.05765792354941368, -0.40090903639793396, -0.3154611587524414, 0.04485836625099182, 0.22018824517726898, 0.02433329075574875, -0.06482107937335968, -0.03241829574108124, -0.1703733205795288, 0.0365440770983696, -0.0830787718296051, 0.364768385887146, 0.027537619695067406, -0.05253554880619049, 0.2877941429615021, 0.11662554740905762, 0.08485747873783112, 0.2072262018918991, 0.06550421565771103, -0.1334463208913803, 0.17517465353012085, 0.2198885977268219, -0.07445263117551804, -0.09213376045227051, 0.43553999066352844, 0.11001207679510117, -0.1107221245765686, -0.5617764592170715, 0.01862485706806183, 0.14548897743225098, -0.17776700854301453, 0.10956236720085144, 0.01006532832980156, -0.06271202862262726, -0.16007326543331146, -0.2171822339296341, 0.32561665773391724, 0.32908329367637634, 0.5256913304328918, -0.2263164520263672, 0.3410670757293701, 0.09780161827802658, 0.05161415785551071, -0.16255874931812286, -0.2957463264465332, -0.06772851943969727, 0.176100492477417, 0.1883659064769745, -0.21864405274391174, 0.053303688764572144, 0.42098790407180786, 0.3109525442123413, -0.14626967906951904, 0.09390990436077118, 0.1926741898059845, -0.22578978538513184, 0.06108587980270386, 0.25467053055763245, -0.07445956766605377, 0.1394815891981125, 0.25959229469299316, -0.22253207862377167, 0.18088984489440918, 0.03838164731860161, 0.045130856335163116, 0.07933151721954346, 0.20589405298233032, 0.05100423842668533, 0.16269829869270325, 0.3788628876209259, -0.06002850458025932, -0.1035708487033844, -0.42567265033721924, 0.23824045062065125, 0.0644904300570488, -0.17320485413074493, 0.0776364877820015, -0.36114510893821716, -0.25288325548171997, -0.029945725575089455, -0.15476863086223602, 0.00983867235481739, -0.08103220164775848, -0.07115204632282257, 0.25230342149734497, -0.2477903515100479, 0.41419216990470886, 0.1544073075056076, 0.47492316365242004, 0.3921356201171875, -0.14865446090698242, 0.10203027725219727, -0.12295618653297424, 0.14213918149471283, -0.03261600434780121, 0.11930486559867859, -0.1312311589717865, 0.2022925168275833, 0.28139200806617737, 0.25295233726501465, -0.4226990342140198, -0.3874351680278778, 0.17516493797302246, -0.1680004894733429, 0.035458944737911224, 0.2733228802680969, -0.01181008294224739, -0.3548330068588257, -0.06292477250099182, 0.27059274911880493, 0.052466899156570435, -0.20399627089500427, -0.17524145543575287, 0.052535779774188995, -0.0038215145468711853, -0.07897982746362686, 0.148700550198555, -0.24281927943229675, -0.5070273876190186, 0.7082009315490723, -0.09519299864768982, 0.17026293277740479, -0.05301231890916824, 0.299348384141922, 0.09136997163295746, -0.07949334383010864, -0.2906801998615265, -0.15967857837677002, 0.2135937362909317, 0.384229451417923, -0.2740488350391388, 0.197545126080513, -0.16936221718788147, -0.13298258185386658, 0.07145810127258301, 0.35137829184532166, -0.3469691276550293, 0.06758783757686615, 0.2367648333311081, 0.2765229046344757, -0.10500115156173706, -0.09016174077987671, 0.4040186405181885, 0.026313330978155136, 0.07693885266780853, -0.024202875792980194, -0.3239285945892334, 0.06526710093021393, 0.14260898530483246, -0.04130903258919716, 0.1675988733768463, 0.46014392375946045, 0.033561788499355316, 0.21707648038864136, 0.4217296838760376, 0.09804345667362213, -0.065182164311409, -0.283058226108551, -0.06399402022361755, 0.14282789826393127, -0.2040712833404541, 0.28519877791404724, -0.059337541460990906, 0.06231392174959183, 0.20527039468288422, 0.008761655539274216, 0.011962145566940308, 0.4451209306716919, -0.5256563425064087, 0.039406582713127136, -0.4078567624092102, 0.2844274640083313, -0.24637800455093384, 0.28881391882896423, -0.18175940215587616, 0.11616268754005432, -0.5182758569717407, -0.0036165453493595123, 0.13017638027668, -0.25405168533325195, 0.11028453707695007, -0.22627274692058563, -0.4621545076370239, -0.08973276615142822, -0.367808073759079, 0.33221572637557983, 0.25426316261291504, 0.25788527727127075, 0.10716144740581512, 0.027249924838542938, -0.220870241522789, -0.12094913423061371, 1.1360121965408325, -0.4345966577529907, -0.30661189556121826, 0.06347690522670746, 0.3009321689605713, -0.44085270166397095, 0.08212044090032578, 0.09385265409946442, 0.42820605635643005, 0.07512830197811127, 0.3090175986289978, 0.033017098903656006, 0.11162199825048447, 0.14134694635868073, 0.007975827902555466, -0.046081747859716415, -0.07042545825242996, 0.2906411290168762, -0.059781514108181, -0.4462415874004364, 0.35782748460769653, 0.4241405129432678, 0.15877825021743774, 0.3746337592601776, -0.17255239188671112, 0.22193099558353424, -0.35968029499053955, 0.012847624719142914, 0.04135432094335556, 0.3114747703075409, 0.08833585679531097, -0.007153138518333435, 0.046641796827316284, -0.1923094093799591, 0.29763904213905334, 0.29479461908340454, -0.22316500544548035, -0.47910571098327637, -0.03292339667677879, -0.07600907981395721, 0.7516545057296753, 0.2670001685619354, 0.07178723067045212, 0.4508943557739258, 0.04298578202724457, 0.35502520203590393, -0.24011631309986115, 0.3764764666557312, 0.16421112418174744, 0.04493977501988411, -0.12845122814178467, -0.34095561504364014, 0.12137946486473083, 0.07193707674741745, -0.1735498011112213, 0.5154902338981628, -0.007950372993946075, -0.45775091648101807, 0.4530096650123596, -0.05807900056242943, 0.8831580877304077, 0.330788791179657, 0.0358181968331337, 0.08209322392940521, 0.0565422847867012, 0.4589219391345978, -0.4920356869697571, 0.1755954623222351, -0.07979762554168701, 0.43279755115509033, -0.06729277968406677, -0.04044121131300926, -0.0921824723482132, 0.3042159676551819, -0.2670702636241913, -0.2063942402601242, 0.13317659497261047, 0.2536351978778839, -0.15244001150131226, 0.060306817293167114, 0.04521574825048447, -0.47633567452430725, -0.10166692733764648, 0.0777767226099968, 0.06609934568405151, -0.2757863998413086, 0.09587743878364563, 0.07278752326965332, 0.231031134724617, -0.4663611352443695, -0.5284126996994019, 0.054563239216804504, -0.8976742029190063, -0.040818486362695694, -0.03469853103160858, -0.059794433414936066, 0.6094912886619568, 0.06230195239186287, -0.12474212050437927, 0.3573364019393921, -0.12054908275604248, 0.2531419098377228, 0.21837060153484344, 0.004565354436635971, -0.0038162805140018463, -0.299308180809021, 0.12339325994253159, 0.20964813232421875, -0.21489743888378143, 0.03363850340247154, 0.16806623339653015, -0.3500329554080963, -0.10648874193429947, 0.13219742476940155, 0.2821151614189148, -0.4848635792732239, -0.06820690631866455, -0.18366900086402893, 0.05063018202781677, -0.42329633235931396, -0.0015999721363186836, -0.032804638147354126, -0.06166829541325569, 0.17483940720558167, -0.13904763758182526, -0.10476624965667725, -0.031794726848602295, 0.3460022509098053, -0.1870875060558319, -0.0777394101023674, 0.2389015555381775, 0.41098183393478394, -0.1350209265947342, -0.1914137452840805, 0.052610233426094055, 0.3124781847000122, -0.1981641948223114, 0.24161425232887268, -0.05899924412369728, -0.12030079215765, -0.07870396971702576, 0.19898825883865356, 0.016318919137120247, 0.31981921195983887, -0.18262100219726562, -0.4311828017234802, -0.4340393841266632, 0.32580745220184326, 0.048126041889190674, 0.11390095949172974, 0.038696013391017914, 0.6014102101325989, -0.06140982359647751, 0.33868616819381714, -0.21740543842315674, -0.009359277784824371, 0.20656120777130127, -0.05435200780630112, -0.12317627668380737, 0.026039931923151016, 0.09832297265529633, 0.10497763752937317, -0.0494183748960495, 0.5990938544273376, -0.1714388132095337, -0.11580716073513031, -0.26419174671173096, 0.14205798506736755, 0.36856842041015625, -0.1653566062450409, 0.07469575107097626, -0.1914600431919098, 0.03865854814648628, -0.2835977375507355, 0.17498482763767242, -0.17605313658714294, 0.021182328462600708, -0.2599443197250366, 0.05983579531311989, -0.12787321209907532, 0.040776029229164124, 0.005466315895318985, 0.17477767169475555, 0.12650594115257263, 0.19591261446475983, 0.20630788803100586, -0.020350802689790726, 0.04985837638378143, 0.03533424437046051, 0.2515842020511627, 0.5503159761428833, -0.18873091042041779, 0.17902565002441406, 0.22689929604530334, -0.3290959894657135, 0.19660203158855438, 0.14794686436653137, 0.4139765202999115, -0.24958384037017822, -0.006932694464921951, 0.4477420747280121, 0.09143255650997162, -0.2916795611381531, -0.2168557196855545, 0.24292123317718506, -0.17258867621421814, 0.2548201084136963, 0.2027062624692917, -0.021119557321071625, -0.1000978946685791, -0.275276780128479, -0.0167243555188179, 0.44324374198913574, -0.13857129216194153, -0.09457364678382874, 0.3790890872478485, -0.03372906148433685, -0.052637360990047455, 0.5745445489883423, 0.30682262778282166, 0.5995928645133972, 0.22681283950805664, 0.0006848461925983429, -0.04488523304462433, -0.07995683699846268, 0.016251910477876663, 0.2144968956708908, -0.2840227484703064, -0.025168709456920624, 0.13842517137527466, 0.06171543523669243, 0.30451881885528564, 0.06025153398513794, 0.033547449856996536, -0.1908300817012787, -0.38844484090805054, 0.04128371924161911, 0.30550187826156616, -0.18003691732883453, -0.08863592147827148, -0.3055378198623657, -0.1498573124408722, -0.03263009339570999, -0.1045832633972168, 0.05078193545341492, -0.40309199690818787, 0.3280825614929199, -0.26770877838134766, -0.04277019575238228, -0.15682028234004974, -0.20702320337295532, -0.13299882411956787, 0.20471429824829102, -0.42509210109710693, 0.13726381957530975, -0.02534814551472664, -0.10788977891206741, -0.06619621813297272, 0.012732816860079765, 0.3487321734428406, -0.13689535856246948, -0.13631895184516907, -0.09708540141582489, -0.4324052631855011, -0.011981260031461716, -0.08544011414051056, 0.15303649008274078, 0.18760551512241364, -0.19922170042991638, 0.1933135837316513, 0.05309882014989853, -0.10655656456947327, 0.27530455589294434, 0.22037607431411743, -0.038425251841545105, 0.018740452826023102, -0.03493236377835274, 0.059919487684965134, -0.3842771053314209, -0.19661837816238403, -0.21980760991573334, -0.05028950423002243, 0.018786992877721786, 0.5010263919830322, -0.39343780279159546, 0.12374573200941086, -0.13451887667179108, 0.0400061160326004, 0.24200867116451263, 0.2669062912464142, 0.3300684690475464, 0.16872258484363556, -0.30719324946403503, -0.3047501742839813, -0.19915160536766052, 0.0029494687914848328, -0.28480568528175354, -0.14004264771938324, 0.17361745238304138, -0.09534594416618347, 0.4095623195171356, -0.13941921293735504, 0.016458388417959213, -0.0938236266374588, -0.2112806886434555, 0.08829444646835327, -0.24953904747962952, 0.1289898157119751, 0.14776788651943207, 0.4396388530731201, 0.39728450775146484, -0.1840663105249405, 0.17787179350852966, 0.05206811800599098, -0.13694050908088684, -0.5402094125747681, 0.18655335903167725, -0.16842088103294373, -0.5176962614059448, 0.46425729990005493, 0.12109270691871643, 0.09263764321804047, -0.11535462737083435, 0.2136087268590927, -0.2986204922199249, 0.16189852356910706, -0.19674597680568695, 0.3411259651184082, 0.2241482436656952, 0.3658924102783203, -0.21927353739738464, -0.25900381803512573, 0.1009356677532196, -0.3461402654647827, 0.04824100434780121, -0.22011633217334747, -0.09822002053260803, 0.5013660192489624, -0.2607555389404297, 0.1356315165758133, -0.02552371472120285, 0.18728558719158173, -0.11052243411540985, 0.22763139009475708, 0.14501799643039703, -0.32018253207206726, 0.4635968804359436, -0.338682621717453, -0.45261242985725403, 0.26614096760749817, 0.07066456973552704, -0.05517305061221123, -0.10929150879383087, -0.7755767107009888, -0.27343374490737915, 0.25278645753860474, 0.4349396228790283, -0.23726342618465424, 0.19596368074417114, -0.1270032674074173, -0.1504807472229004, -0.27985337376594543, 0.393057644367218, -0.009771285578608513, -0.13464820384979248, -0.0824609249830246, -0.5477561950683594 ]
https://github.com/huggingface/datasets/issues/5997
All the values in a batch must be of the same length. So one solution is dropping all the input columns: ```python data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True, remove_columns=data.column_names) ``` Another is padding/transforming the input columns to the tokenizer output's length (447).
extend the map function so it can wrap around long text that does not fit in the context window
### Feature request I understand `dataset` provides a [`map`](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2849) function. This function in turn takes in a callable that is used to tokenize the text on which a model is trained. Frequently this text will not fit within a models's context window. In this case it would be useful to wrap around the text into multiple rows with each row fitting the model's context window. I tried to do it using this code as example which in turn I have borrowed from [here](https://stackoverflow.com/a/76343993/147530): ``` data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) ``` but running the code gives me this error: ``` File "/llm/fine-tune.py", line 117, in <module> data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3480, in _map_single writer.write_batch(batch) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_writer.py", line 556, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3798, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 2962, in pyarrow.lib.Table.validate File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 394 but got length 447 ``` The lambda function I have provided is correctly chopping up long text so it wraps around (and because of this 394 samples become 447 after wrap around) but the dataset `map` function does not like it. ### Motivation please see above ### Your contribution I'm afraid I don't have much knowledge to help
46
extend the map function so it can wrap around long text that does not fit in the context window ### Feature request I understand `dataset` provides a [`map`](https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L2849) function. This function in turn takes in a callable that is used to tokenize the text on which a model is trained. Frequently this text will not fit within a models's context window. In this case it would be useful to wrap around the text into multiple rows with each row fitting the model's context window. I tried to do it using this code as example which in turn I have borrowed from [here](https://stackoverflow.com/a/76343993/147530): ``` data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) ``` but running the code gives me this error: ``` File "/llm/fine-tune.py", line 117, in <module> data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3480, in _map_single writer.write_batch(batch) File "/llm/.env/lib/python3.9/site-packages/datasets/arrow_writer.py", line 556, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3798, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 2962, in pyarrow.lib.Table.validate File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Column 1 named input_ids expected length 394 but got length 447 ``` The lambda function I have provided is correctly chopping up long text so it wraps around (and because of this 394 samples become 447 after wrap around) but the dataset `map` function does not like it. ### Motivation please see above ### Your contribution I'm afraid I don't have much knowledge to help All the values in a batch must be of the same length. So one solution is dropping all the input columns: ```python data = data.map(lambda samples: tokenizer(samples["text"], max_length=tokenizer.model_max_length, truncation=True, stride=4, return_overflowing_tokens=True), batched=True, remove_columns=data.column_names) ``` Another is padding/transforming the input columns to the tokenizer output's length (447).
[ -0.3404634892940521, 0.03542882204055786, -0.08898577094078064, 0.043310411274433136, 0.17575713992118835, -0.04931211471557617, 0.30036675930023193, 0.36894655227661133, -0.09006550908088684, -0.17397615313529968, 0.09924708306789398, 0.5054342746734619, -0.03185398131608963, 0.32149404287338257, 0.11065222322940826, -0.35725125670433044, 0.09137898683547974, -0.0831860676407814, 0.4148484766483307, 0.30931544303894043, -0.35015034675598145, -0.08045724034309387, -0.39516276121139526, 0.15817491710186005, -0.12172611057758331, -0.20354029536247253, -0.28787991404533386, -0.3700942397117615, 0.07613245397806168, -0.21095067262649536, 0.004973582923412323, 0.10255733132362366, -0.1655050367116928, 0.25701630115509033, -0.00011748912220355123, -0.19098219275474548, -0.12051665782928467, -0.06064571812748909, 0.20487311482429504, -0.15861617028713226, 0.24906638264656067, -0.22372058033943176, -0.3613227903842926, -0.13529863953590393, 0.06681149452924728, -0.10928241163492203, -0.24335145950317383, -0.20687872171401978, 0.20258183777332306, 0.31924012303352356, 0.07839358597993851, 0.14948412775993347, 0.11391100287437439, -0.11100094765424728, 0.06787888705730438, 0.13695412874221802, 0.05119796097278595, 0.04567951336503029, 0.4494415819644928, -0.17819267511367798, -0.10504482686519623, 0.3481353521347046, -0.24123729765415192, -0.04752224311232567, 0.20192556083202362, -0.13029804825782776, -0.18552342057228088, -0.3786454498767853, -0.015575270168483257, 0.09814591705799103, 0.327703595161438, -0.3860630393028259, -0.27182668447494507, -0.40748584270477295, 0.14553695917129517, -0.1282467097043991, -0.02961663156747818, 0.057006217539310455, 0.04083309322595596, 0.07963022589683533, -0.3519148528575897, -0.33039650321006775, -0.14965525269508362, 0.2792609930038452, -0.30386513471603394, 0.2699810266494751, -0.011285442858934402, 0.37053078413009644, 0.1541323959827423, -0.27678996324539185, -0.09275981783866882, 0.03194929659366608, 0.08192650973796844, 0.2787820100784302, -0.10765397548675537, -0.13869282603263855, 0.1904054582118988, 0.19666121900081635, 0.408525288105011, 0.09637337177991867, -0.07297353446483612, 0.10346163809299469, 0.008602049201726913, -0.09260818362236023, 0.07116472721099854, -0.015173062682151794, 0.2624515891075134, 0.37069082260131836, -0.09171522408723831, -0.2511286735534668, -0.023759260773658752, -0.03629201650619507, -0.06699813157320023, -0.2617030441761017, -0.3784725069999695, -0.004213051870465279, -0.010323628783226013, 0.39840972423553467, 0.11973635107278824, -0.028969962149858475, -0.4952002465724945, 0.14215746521949768, 0.1988489031791687, 0.19346871972084045, 0.10586236417293549, -0.038450583815574646, 0.057175032794475555, 0.1793297976255417, 0.17043791711330414, -0.1749749481678009, -0.07210108637809753, -0.03683429956436157, -0.04450783133506775, 0.11701032519340515, -0.0439060814678669, 0.13054536283016205, 0.11023890227079391, -0.23393788933753967, 0.06001518666744232, -0.14506499469280243, -0.36502978205680847, -0.08257247507572174, 0.08170589804649353, 0.10225386917591095, -0.27387693524360657, 0.08975254744291306, 0.13631954789161682, 0.13719499111175537, -0.11911439895629883, 0.08527657389640808, -0.24731814861297607, -0.20247042179107666, -0.08486127108335495, -0.019698329269886017, 0.030587173998355865, 0.22943997383117676, -0.036157164722681046, 0.4400521516799927, 0.31176766753196716, -0.2603134512901306, 0.41029736399650574, -0.15097863972187042, -0.548576831817627, -0.25987228751182556, 0.15054821968078613, 0.2992435395717621, -0.37419867515563965, -0.1481691151857376, 0.04471909627318382, 0.1644093543291092, -0.1817164421081543, 0.26439014077186584, -0.10530459880828857, 0.25943824648857117, -0.30276745557785034, 0.5635426044464111, 0.4021022915840149, -0.38493943214416504, -0.635461688041687, 0.26098668575286865, -0.4728931188583374, -0.0904136449098587, -0.18840384483337402, -0.22286801040172577, 0.4414561986923218, 0.13902795314788818, 0.31493842601776123, 0.3012654781341553, -0.12266569584608078, -0.07793600857257843, 0.06015394628047943, -0.046221621334552765, 0.446577787399292, 0.13730375468730927, -0.11783359944820404, -0.146812304854393, -0.07267899811267853, -0.2149842381477356, 0.418283611536026, 0.0029621580615639687, 0.3336637616157532, -0.06229839101433754, 0.2277827262878418, 0.11390690505504608, -0.0394999235868454, -0.45590007305145264, -0.1641038954257965, -0.12966951727867126, 0.12050482630729675, -0.05765792354941368, -0.40090903639793396, -0.3154611587524414, 0.04485836625099182, 0.22018824517726898, 0.02433329075574875, -0.06482107937335968, -0.03241829574108124, -0.1703733205795288, 0.0365440770983696, -0.0830787718296051, 0.364768385887146, 0.027537619695067406, -0.05253554880619049, 0.2877941429615021, 0.11662554740905762, 0.08485747873783112, 0.2072262018918991, 0.06550421565771103, -0.1334463208913803, 0.17517465353012085, 0.2198885977268219, -0.07445263117551804, -0.09213376045227051, 0.43553999066352844, 0.11001207679510117, -0.1107221245765686, -0.5617764592170715, 0.01862485706806183, 0.14548897743225098, -0.17776700854301453, 0.10956236720085144, 0.01006532832980156, -0.06271202862262726, -0.16007326543331146, -0.2171822339296341, 0.32561665773391724, 0.32908329367637634, 0.5256913304328918, -0.2263164520263672, 0.3410670757293701, 0.09780161827802658, 0.05161415785551071, -0.16255874931812286, -0.2957463264465332, -0.06772851943969727, 0.176100492477417, 0.1883659064769745, -0.21864405274391174, 0.053303688764572144, 0.42098790407180786, 0.3109525442123413, -0.14626967906951904, 0.09390990436077118, 0.1926741898059845, -0.22578978538513184, 0.06108587980270386, 0.25467053055763245, -0.07445956766605377, 0.1394815891981125, 0.25959229469299316, -0.22253207862377167, 0.18088984489440918, 0.03838164731860161, 0.045130856335163116, 0.07933151721954346, 0.20589405298233032, 0.05100423842668533, 0.16269829869270325, 0.3788628876209259, -0.06002850458025932, -0.1035708487033844, -0.42567265033721924, 0.23824045062065125, 0.0644904300570488, -0.17320485413074493, 0.0776364877820015, -0.36114510893821716, -0.25288325548171997, -0.029945725575089455, -0.15476863086223602, 0.00983867235481739, -0.08103220164775848, -0.07115204632282257, 0.25230342149734497, -0.2477903515100479, 0.41419216990470886, 0.1544073075056076, 0.47492316365242004, 0.3921356201171875, -0.14865446090698242, 0.10203027725219727, -0.12295618653297424, 0.14213918149471283, -0.03261600434780121, 0.11930486559867859, -0.1312311589717865, 0.2022925168275833, 0.28139200806617737, 0.25295233726501465, -0.4226990342140198, -0.3874351680278778, 0.17516493797302246, -0.1680004894733429, 0.035458944737911224, 0.2733228802680969, -0.01181008294224739, -0.3548330068588257, -0.06292477250099182, 0.27059274911880493, 0.052466899156570435, -0.20399627089500427, -0.17524145543575287, 0.052535779774188995, -0.0038215145468711853, -0.07897982746362686, 0.148700550198555, -0.24281927943229675, -0.5070273876190186, 0.7082009315490723, -0.09519299864768982, 0.17026293277740479, -0.05301231890916824, 0.299348384141922, 0.09136997163295746, -0.07949334383010864, -0.2906801998615265, -0.15967857837677002, 0.2135937362909317, 0.384229451417923, -0.2740488350391388, 0.197545126080513, -0.16936221718788147, -0.13298258185386658, 0.07145810127258301, 0.35137829184532166, -0.3469691276550293, 0.06758783757686615, 0.2367648333311081, 0.2765229046344757, -0.10500115156173706, -0.09016174077987671, 0.4040186405181885, 0.026313330978155136, 0.07693885266780853, -0.024202875792980194, -0.3239285945892334, 0.06526710093021393, 0.14260898530483246, -0.04130903258919716, 0.1675988733768463, 0.46014392375946045, 0.033561788499355316, 0.21707648038864136, 0.4217296838760376, 0.09804345667362213, -0.065182164311409, -0.283058226108551, -0.06399402022361755, 0.14282789826393127, -0.2040712833404541, 0.28519877791404724, -0.059337541460990906, 0.06231392174959183, 0.20527039468288422, 0.008761655539274216, 0.011962145566940308, 0.4451209306716919, -0.5256563425064087, 0.039406582713127136, -0.4078567624092102, 0.2844274640083313, -0.24637800455093384, 0.28881391882896423, -0.18175940215587616, 0.11616268754005432, -0.5182758569717407, -0.0036165453493595123, 0.13017638027668, -0.25405168533325195, 0.11028453707695007, -0.22627274692058563, -0.4621545076370239, -0.08973276615142822, -0.367808073759079, 0.33221572637557983, 0.25426316261291504, 0.25788527727127075, 0.10716144740581512, 0.027249924838542938, -0.220870241522789, -0.12094913423061371, 1.1360121965408325, -0.4345966577529907, -0.30661189556121826, 0.06347690522670746, 0.3009321689605713, -0.44085270166397095, 0.08212044090032578, 0.09385265409946442, 0.42820605635643005, 0.07512830197811127, 0.3090175986289978, 0.033017098903656006, 0.11162199825048447, 0.14134694635868073, 0.007975827902555466, -0.046081747859716415, -0.07042545825242996, 0.2906411290168762, -0.059781514108181, -0.4462415874004364, 0.35782748460769653, 0.4241405129432678, 0.15877825021743774, 0.3746337592601776, -0.17255239188671112, 0.22193099558353424, -0.35968029499053955, 0.012847624719142914, 0.04135432094335556, 0.3114747703075409, 0.08833585679531097, -0.007153138518333435, 0.046641796827316284, -0.1923094093799591, 0.29763904213905334, 0.29479461908340454, -0.22316500544548035, -0.47910571098327637, -0.03292339667677879, -0.07600907981395721, 0.7516545057296753, 0.2670001685619354, 0.07178723067045212, 0.4508943557739258, 0.04298578202724457, 0.35502520203590393, -0.24011631309986115, 0.3764764666557312, 0.16421112418174744, 0.04493977501988411, -0.12845122814178467, -0.34095561504364014, 0.12137946486473083, 0.07193707674741745, -0.1735498011112213, 0.5154902338981628, -0.007950372993946075, -0.45775091648101807, 0.4530096650123596, -0.05807900056242943, 0.8831580877304077, 0.330788791179657, 0.0358181968331337, 0.08209322392940521, 0.0565422847867012, 0.4589219391345978, -0.4920356869697571, 0.1755954623222351, -0.07979762554168701, 0.43279755115509033, -0.06729277968406677, -0.04044121131300926, -0.0921824723482132, 0.3042159676551819, -0.2670702636241913, -0.2063942402601242, 0.13317659497261047, 0.2536351978778839, -0.15244001150131226, 0.060306817293167114, 0.04521574825048447, -0.47633567452430725, -0.10166692733764648, 0.0777767226099968, 0.06609934568405151, -0.2757863998413086, 0.09587743878364563, 0.07278752326965332, 0.231031134724617, -0.4663611352443695, -0.5284126996994019, 0.054563239216804504, -0.8976742029190063, -0.040818486362695694, -0.03469853103160858, -0.059794433414936066, 0.6094912886619568, 0.06230195239186287, -0.12474212050437927, 0.3573364019393921, -0.12054908275604248, 0.2531419098377228, 0.21837060153484344, 0.004565354436635971, -0.0038162805140018463, -0.299308180809021, 0.12339325994253159, 0.20964813232421875, -0.21489743888378143, 0.03363850340247154, 0.16806623339653015, -0.3500329554080963, -0.10648874193429947, 0.13219742476940155, 0.2821151614189148, -0.4848635792732239, -0.06820690631866455, -0.18366900086402893, 0.05063018202781677, -0.42329633235931396, -0.0015999721363186836, -0.032804638147354126, -0.06166829541325569, 0.17483940720558167, -0.13904763758182526, -0.10476624965667725, -0.031794726848602295, 0.3460022509098053, -0.1870875060558319, -0.0777394101023674, 0.2389015555381775, 0.41098183393478394, -0.1350209265947342, -0.1914137452840805, 0.052610233426094055, 0.3124781847000122, -0.1981641948223114, 0.24161425232887268, -0.05899924412369728, -0.12030079215765, -0.07870396971702576, 0.19898825883865356, 0.016318919137120247, 0.31981921195983887, -0.18262100219726562, -0.4311828017234802, -0.4340393841266632, 0.32580745220184326, 0.048126041889190674, 0.11390095949172974, 0.038696013391017914, 0.6014102101325989, -0.06140982359647751, 0.33868616819381714, -0.21740543842315674, -0.009359277784824371, 0.20656120777130127, -0.05435200780630112, -0.12317627668380737, 0.026039931923151016, 0.09832297265529633, 0.10497763752937317, -0.0494183748960495, 0.5990938544273376, -0.1714388132095337, -0.11580716073513031, -0.26419174671173096, 0.14205798506736755, 0.36856842041015625, -0.1653566062450409, 0.07469575107097626, -0.1914600431919098, 0.03865854814648628, -0.2835977375507355, 0.17498482763767242, -0.17605313658714294, 0.021182328462600708, -0.2599443197250366, 0.05983579531311989, -0.12787321209907532, 0.040776029229164124, 0.005466315895318985, 0.17477767169475555, 0.12650594115257263, 0.19591261446475983, 0.20630788803100586, -0.020350802689790726, 0.04985837638378143, 0.03533424437046051, 0.2515842020511627, 0.5503159761428833, -0.18873091042041779, 0.17902565002441406, 0.22689929604530334, -0.3290959894657135, 0.19660203158855438, 0.14794686436653137, 0.4139765202999115, -0.24958384037017822, -0.006932694464921951, 0.4477420747280121, 0.09143255650997162, -0.2916795611381531, -0.2168557196855545, 0.24292123317718506, -0.17258867621421814, 0.2548201084136963, 0.2027062624692917, -0.021119557321071625, -0.1000978946685791, -0.275276780128479, -0.0167243555188179, 0.44324374198913574, -0.13857129216194153, -0.09457364678382874, 0.3790890872478485, -0.03372906148433685, -0.052637360990047455, 0.5745445489883423, 0.30682262778282166, 0.5995928645133972, 0.22681283950805664, 0.0006848461925983429, -0.04488523304462433, -0.07995683699846268, 0.016251910477876663, 0.2144968956708908, -0.2840227484703064, -0.025168709456920624, 0.13842517137527466, 0.06171543523669243, 0.30451881885528564, 0.06025153398513794, 0.033547449856996536, -0.1908300817012787, -0.38844484090805054, 0.04128371924161911, 0.30550187826156616, -0.18003691732883453, -0.08863592147827148, -0.3055378198623657, -0.1498573124408722, -0.03263009339570999, -0.1045832633972168, 0.05078193545341492, -0.40309199690818787, 0.3280825614929199, -0.26770877838134766, -0.04277019575238228, -0.15682028234004974, -0.20702320337295532, -0.13299882411956787, 0.20471429824829102, -0.42509210109710693, 0.13726381957530975, -0.02534814551472664, -0.10788977891206741, -0.06619621813297272, 0.012732816860079765, 0.3487321734428406, -0.13689535856246948, -0.13631895184516907, -0.09708540141582489, -0.4324052631855011, -0.011981260031461716, -0.08544011414051056, 0.15303649008274078, 0.18760551512241364, -0.19922170042991638, 0.1933135837316513, 0.05309882014989853, -0.10655656456947327, 0.27530455589294434, 0.22037607431411743, -0.038425251841545105, 0.018740452826023102, -0.03493236377835274, 0.059919487684965134, -0.3842771053314209, -0.19661837816238403, -0.21980760991573334, -0.05028950423002243, 0.018786992877721786, 0.5010263919830322, -0.39343780279159546, 0.12374573200941086, -0.13451887667179108, 0.0400061160326004, 0.24200867116451263, 0.2669062912464142, 0.3300684690475464, 0.16872258484363556, -0.30719324946403503, -0.3047501742839813, -0.19915160536766052, 0.0029494687914848328, -0.28480568528175354, -0.14004264771938324, 0.17361745238304138, -0.09534594416618347, 0.4095623195171356, -0.13941921293735504, 0.016458388417959213, -0.0938236266374588, -0.2112806886434555, 0.08829444646835327, -0.24953904747962952, 0.1289898157119751, 0.14776788651943207, 0.4396388530731201, 0.39728450775146484, -0.1840663105249405, 0.17787179350852966, 0.05206811800599098, -0.13694050908088684, -0.5402094125747681, 0.18655335903167725, -0.16842088103294373, -0.5176962614059448, 0.46425729990005493, 0.12109270691871643, 0.09263764321804047, -0.11535462737083435, 0.2136087268590927, -0.2986204922199249, 0.16189852356910706, -0.19674597680568695, 0.3411259651184082, 0.2241482436656952, 0.3658924102783203, -0.21927353739738464, -0.25900381803512573, 0.1009356677532196, -0.3461402654647827, 0.04824100434780121, -0.22011633217334747, -0.09822002053260803, 0.5013660192489624, -0.2607555389404297, 0.1356315165758133, -0.02552371472120285, 0.18728558719158173, -0.11052243411540985, 0.22763139009475708, 0.14501799643039703, -0.32018253207206726, 0.4635968804359436, -0.338682621717453, -0.45261242985725403, 0.26614096760749817, 0.07066456973552704, -0.05517305061221123, -0.10929150879383087, -0.7755767107009888, -0.27343374490737915, 0.25278645753860474, 0.4349396228790283, -0.23726342618465424, 0.19596368074417114, -0.1270032674074173, -0.1504807472229004, -0.27985337376594543, 0.393057644367218, -0.009771285578608513, -0.13464820384979248, -0.0824609249830246, -0.5477561950683594 ]
https://github.com/huggingface/datasets/issues/5993
We'll do a new release of `datasets` soon to make the fix available :) In the meantime you can use `datasets` from source (main)
ValueError: Table schema does not match schema used to create file
### Describe the bug Saving a dataset as parquet fails with a `ValueError: Table schema does not match schema used to create file` if the dataset was obtained out of a `.select_columns()` call with columns selected out of order. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict( { "x1": [1, 2, 3], "x2": [10, 11, 12], } ) ds = dataset.select_columns(["x2", "x1"]) ds.to_parquet("demo.parquet") ``` ```shell >>> ValueError: Table schema does not match schema used to create file: table: x2: int64 x1: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x2": {"dtype": "int64", "_type": "V' + 53 vs. file: x1: int64 x2: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x1": {"dtype": "int64", "_type": "V' + 53 ``` --- I think this is because after the `.select_columns()` call with out of order columns, the output dataset features' schema ends up being out of sync with the schema of the arrow table backing it. ```python ds.features.arrow_schema >>> x1: int64 x2: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x1": {"dtype": "int64", "_type": "V' + 53 ds.data.schema >>> x2: int64 x1: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x2": {"dtype": "int64", "_type": "V' + 53 ``` So when we call `.to_parquet()`, the call behind the scenes to `datasets.io.parquet.ParquetDatasetWriter(...).write()` which initialises the backend `pyarrow.parquet.ParquetWriter` with `schema = self.dataset.features.arrow_schema` triggers `pyarrow` on write when [it checks](https://github.com/apache/arrow/blob/11b140a734a516e436adaddaeb35d23f30dcce44/python/pyarrow/parquet/core.py#L1086-L1090) that the `ParquetWriter` schema matches the schema of the table being written 🙌 https://github.com/huggingface/datasets/blob/6ed837325cb539a5deb99129e5ad181d0269e050/src/datasets/io/parquet.py#L139-L141 ### Expected behavior The dataset gets successfully saved as parquet. *In the same way as it does if saving it as csv: ```python import datasets dataset = datasets.Dataset.from_dict( { "x1": [1, 2, 3], "x2": [10, 11, 12], } ) ds = dataset.select_columns(["x2", "x1"]) ds.to_csv("demo.csv") ``` ### Environment info `python==3.11` `datasets==2.13.1`
24
ValueError: Table schema does not match schema used to create file ### Describe the bug Saving a dataset as parquet fails with a `ValueError: Table schema does not match schema used to create file` if the dataset was obtained out of a `.select_columns()` call with columns selected out of order. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_dict( { "x1": [1, 2, 3], "x2": [10, 11, 12], } ) ds = dataset.select_columns(["x2", "x1"]) ds.to_parquet("demo.parquet") ``` ```shell >>> ValueError: Table schema does not match schema used to create file: table: x2: int64 x1: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x2": {"dtype": "int64", "_type": "V' + 53 vs. file: x1: int64 x2: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x1": {"dtype": "int64", "_type": "V' + 53 ``` --- I think this is because after the `.select_columns()` call with out of order columns, the output dataset features' schema ends up being out of sync with the schema of the arrow table backing it. ```python ds.features.arrow_schema >>> x1: int64 x2: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x1": {"dtype": "int64", "_type": "V' + 53 ds.data.schema >>> x2: int64 x1: int64 -- schema metadata -- huggingface: '{"info": {"features": {"x2": {"dtype": "int64", "_type": "V' + 53 ``` So when we call `.to_parquet()`, the call behind the scenes to `datasets.io.parquet.ParquetDatasetWriter(...).write()` which initialises the backend `pyarrow.parquet.ParquetWriter` with `schema = self.dataset.features.arrow_schema` triggers `pyarrow` on write when [it checks](https://github.com/apache/arrow/blob/11b140a734a516e436adaddaeb35d23f30dcce44/python/pyarrow/parquet/core.py#L1086-L1090) that the `ParquetWriter` schema matches the schema of the table being written 🙌 https://github.com/huggingface/datasets/blob/6ed837325cb539a5deb99129e5ad181d0269e050/src/datasets/io/parquet.py#L139-L141 ### Expected behavior The dataset gets successfully saved as parquet. *In the same way as it does if saving it as csv: ```python import datasets dataset = datasets.Dataset.from_dict( { "x1": [1, 2, 3], "x2": [10, 11, 12], } ) ds = dataset.select_columns(["x2", "x1"]) ds.to_csv("demo.csv") ``` ### Environment info `python==3.11` `datasets==2.13.1` We'll do a new release of `datasets` soon to make the fix available :) In the meantime you can use `datasets` from source (main)
[ -0.2826020419597626, -0.03604024648666382, 0.04691947251558304, 0.303589791059494, 0.12757602334022522, 0.0786287784576416, -0.09735140204429626, 0.290692538022995, 0.07794879376888275, 0.2212046980857849, 0.32674533128738403, 0.6393993496894836, -0.09413140267133713, 0.41772839426994324, -0.1704549789428711, -0.19860605895519257, 0.19568973779678345, 0.13805124163627625, -0.09969842433929443, 0.052043765783309937, -0.3040847182273865, 0.19741250574588776, 0.13784337043762207, 0.05682673305273056, 0.033289432525634766, -0.07410375773906708, -0.10523784905672073, 0.2813751697540283, -0.23371753096580505, -0.1588401347398758, 0.020658932626247406, -0.4134073853492737, 0.016290441155433655, 0.3903387784957886, -0.00011452428589109331, -0.17147091031074524, -0.032543934881687164, -0.18897473812103271, -0.1179022565484047, -0.3422321677207947, -0.06711786985397339, -0.23107588291168213, -0.04890001192688942, -0.30002063512802124, -0.04009062796831131, -0.14235788583755493, -0.32006439566612244, -0.3352256417274475, 0.1980418860912323, 0.2447206676006317, 0.22421026229858398, 0.17065834999084473, 0.3409292995929718, -0.08201253414154053, 0.5941998362541199, 0.005449594929814339, -0.36635738611221313, 0.05506373569369316, 0.04692993313074112, 0.0009291954338550568, 0.38410159945487976, 0.18712159991264343, -0.039664141833782196, -0.2733609080314636, 0.22736987471580505, 0.24192342162132263, 0.18133249878883362, -0.028261244297027588, -0.024276986718177795, 0.037700437009334564, 0.373256653547287, -0.31127259135246277, -0.3224002420902252, -0.13631296157836914, -0.11056879162788391, -0.41803330183029175, 0.2967776358127594, 0.27179259061813354, 0.3142409026622772, 0.12907539308071136, 0.23204562067985535, 0.0994371548295021, -0.11342881619930267, -0.1301562339067459, 0.04988090693950653, 0.05956880748271942, -0.09049443155527115, 0.10233993828296661, -0.12793467938899994, -0.1843770146369934, -0.15931928157806396, -0.30077579617500305, -0.31287968158721924, 0.03117305040359497, -0.16378749907016754, -0.18184763193130493, -0.07438415288925171, -0.04114292934536934, 0.04720136523246765, 0.4304206669330597, 0.16002535820007324, -0.1106964498758316, 0.08656647801399231, 0.11074712127447128, 0.3661465346813202, 0.05698803812265396, -0.16886526346206665, 0.22131912410259247, -0.1744738519191742, 0.36989453434944153, 0.046404317021369934, -0.1373509019613266, 0.3556906282901764, -0.045422304421663284, 0.21350029110908508, -0.07405973970890045, 0.40672624111175537, -0.15522682666778564, -0.2354157567024231, 0.5250934958457947, 0.017840862274169922, 0.030386313796043396, -0.14980152249336243, 0.28988125920295715, 0.15416927635669708, 0.0939965695142746, 0.06267985701560974, 0.35326042771339417, 0.07824528962373734, 0.00233280286192894, -0.22531425952911377, 0.03290001302957535, 0.015284568071365356, 0.027194425463676453, -0.21085362136363983, 0.16800597310066223, 0.06105288118124008, 0.3954561948776245, -0.1317920684814453, -0.05178341642022133, 0.08751918375492096, -0.29905107617378235, 0.025029094889760017, 0.20447523891925812, -0.01423569768667221, 0.15626132488250732, 0.32317209243774414, -0.20696772634983063, -0.2830069363117218, 0.14319396018981934, -0.3770209550857544, -0.17129769921302795, -0.31302574276924133, 0.22776193916797638, 0.12445473670959473, -0.06822605431079865, -0.7790526151657104, -0.28161975741386414, 0.3593268096446991, -0.1506481021642685, 0.05200621858239174, -0.15395711362361908, -0.16215556859970093, -0.26409515738487244, -0.12437407672405243, 0.23238620162010193, -0.32860857248306274, 0.2685231566429138, 0.298889696598053, 0.0813913643360138, 0.3152925372123718, 0.08954786509275436, -0.016210779547691345, -0.03954460471868515, -0.08149982243776321, 0.15372741222381592, 0.449041485786438, -0.19894132018089294, -0.2923685908317566, -0.04183262959122658, -0.18151983618736267, 0.1957997977733612, 0.2679106593132019, -0.08968891948461533, 0.36988183856010437, -0.05353046953678131, -0.175932839512825, 0.2363433986902237, 0.030276501551270485, 0.21083389222621918, -0.2645775079727173, -0.15161418914794922, 0.12571290135383606, -0.011988971382379532, -0.3688699007034302, -0.06358468532562256, 0.10420846939086914, -0.17750053107738495, 0.2251620590686798, -0.15860934555530548, -0.16548873484134674, 0.2243807017803192, 0.5075244903564453, 0.35298818349838257, 0.06473195552825928, -0.3296602666378021, -0.3658536970615387, 0.20164570212364197, 0.19269470870494843, -0.26701322197914124, -0.2995914816856384, -0.15267086029052734, -0.23795807361602783, 0.07845067977905273, -0.31040704250335693, -0.05236593633890152, 0.1421060413122177, 0.11103794723749161, 0.018489226698875427, -0.05380548909306526, -0.11691901087760925, 0.06940183788537979, -0.49174490571022034, 0.1016588807106018, -0.12950417399406433, 0.49778881669044495, -0.2981663644313812, -0.37475600838661194, 0.19221842288970947, 0.043400757014751434, 0.18014420568943024, -0.12590400874614716, -0.09315654635429382, 0.5157520174980164, 0.36126723885536194, 0.0952882170677185, -0.4015829265117645, 0.19804589450359344, -0.11399760097265244, 0.06690481305122375, -0.1452893763780594, -0.06219712272286415, 0.1925828605890274, 0.034132346510887146, -0.3661898374557495, 0.3217177987098694, -0.12770745158195496, 0.22390204668045044, 0.1462470293045044, -0.07767801731824875, 0.11057834327220917, 0.09311531484127045, 0.0719909816980362, -0.23791494965553284, 0.06372369825839996, 0.12330058217048645, -0.2240522801876068, -0.06473393738269806, -0.4021715521812439, 0.30221933126449585, 0.7265881299972534, 0.16359031200408936, 0.19242629408836365, -0.1606149822473526, 0.324097603559494, -0.027533885091543198, 0.08818353712558746, 0.3052416443824768, 0.41767504811286926, 0.17714011669158936, -0.4053993821144104, 0.027457060292363167, -0.25117814540863037, 0.04785100370645523, 0.1566123068332672, 0.0049273185431957245, 0.29095155000686646, 0.3730812668800354, 0.22414737939834595, 0.12082688510417938, -0.16512882709503174, 0.09425784647464752, -0.23931995034217834, 0.16346438229084015, -0.37371304631233215, 0.20825089514255524, -0.29069826006889343, 0.2983244061470032, -0.30572840571403503, 0.12993696331977844, -0.06274522095918655, -0.3759011924266815, -0.018074076622724533, 0.22305163741111755, -0.28398770093917847, -0.009016616269946098, -0.27005311846733093, 0.0027460306882858276, 0.09946765750646591, -0.13604891300201416, -0.008574262261390686, -0.13163229823112488, -0.06348398327827454, 0.01678125560283661, -0.009778100997209549, 0.264503538608551, 0.2931675910949707, -0.010685358196496964, 0.0008689090609550476, -0.5045118927955627, -0.2322322130203247, 0.05087989568710327, -0.1702650487422943, 0.175145223736763, 0.19830310344696045, 0.12636564671993256, 0.09337212145328522, -0.4405452311038971, 0.18119476735591888, -0.019556794315576553, -0.3114272654056549, 0.28022176027297974, 0.06376609206199646, -0.2505682408809662, 0.14270862936973572, -0.5030379295349121, 0.06954088807106018, -0.30519741773605347, 0.21745890378952026, 0.4242863655090332, 0.09920892119407654, -0.2513255178928375, -0.07928772270679474, -0.1478545069694519, -0.21364469826221466, 0.36048179864883423, -0.20733463764190674, 0.07531938701868057, 0.16450251638889313, -0.15678879618644714, -0.28732460737228394, 0.14728792011737823, -0.018635522574186325, -0.08988582342863083, 0.08050570636987686, -0.1972300410270691, -0.08011038601398468, -0.3233056962490082, -0.07246808707714081, -0.28563836216926575, 0.09060735255479813, 0.6133341789245605, 0.12044646590948105, -0.0225350521504879, -0.11566624045372009, -0.06436120718717575, 0.16244783997535706, 0.2663028836250305, 0.13792185485363007, -0.2107066810131073, 0.7190148830413818, -0.05728733912110329, 0.41449734568595886, 0.006698980927467346, 0.033953770995140076, 0.40999501943588257, -0.07504972815513611, 0.35518261790275574, -0.45771682262420654, -0.007965460419654846, -0.16413426399230957, -0.06597000360488892, 0.082146555185318, 0.1311081051826477, -0.11889056861400604, 0.26405683159828186, 0.14431217312812805, 0.099675253033638, -0.06291981786489487, -0.12214095890522003, -0.16155584156513214, 0.007364464923739433, 0.19627244770526886, -0.03998561203479767, 0.006399981677532196, 0.033614933490753174, 0.041439298540353775, 0.20939122140407562, 0.21729111671447754, 0.07458852976560593, -0.1106632798910141, -0.4500329792499542, 0.21166303753852844, 0.014804095029830933, 0.06388287246227264, 0.05168021842837334, 0.24868571758270264, 0.10905115306377411, -0.4211995005607605, -0.07564563304185867, -0.17036588490009308, 0.42511671781539917, -0.1177920326590538, 0.15502271056175232, -0.046103812754154205, 0.04055061936378479, -0.2809666097164154, -0.2482474148273468, -0.18717586994171143, 0.06794895231723785, -0.12083443999290466, 0.7257598638534546, -0.3563997149467468, 0.15506866574287415, 0.2691223919391632, 0.2522053122520447, -0.22242246568202972, -0.0004312247037887573, -0.3024425506591797, 0.07448264956474304, -0.24167361855506897, 0.02562098018825054, 0.07846346497535706, 0.26398494839668274, -0.059037938714027405, 0.11023726314306259, -0.3329581618309021, -0.23091766238212585, -0.2911546528339386, -0.10222634673118591, 0.5514554977416992, -0.363869309425354, 0.30758601427078247, -0.284090518951416, 0.3067159056663513, 0.24996574223041534, 0.7031444907188416, 0.04774963855743408, -0.4232545495033264, 0.07609458267688751, -0.26630309224128723, 0.021381083875894547, 0.11851753294467926, -0.10314404964447021, 0.12632764875888824, -0.48707491159439087, 0.11359637975692749, -0.16549967229366302, -0.41432419419288635, 0.3576785624027252, -0.25097817182540894, 0.061272032558918, -0.2257561981678009, 0.48749861121177673, 0.12489475309848785, -0.06655693054199219, 0.0536588691174984, 0.7177585363388062, -0.2241654098033905, 0.7436782121658325, 0.34341752529144287, 0.9538729190826416, 0.15666842460632324, 0.28774547576904297, 0.4041462540626526, -0.5263168215751648, 0.33316555619239807, -0.22395935654640198, -0.13924548029899597, -0.460296630859375, -0.500158965587616, -0.04590832069516182, -0.2419939786195755, 0.24628476798534393, 0.12966126203536987, -0.19148194789886475, 0.30920401215553284, -0.34335824847221375, 0.3573954999446869, -0.2474987804889679, 0.05722404271364212, -0.19642657041549683, -0.042285285890102386, -0.3331587016582489, 0.089082270860672, 0.21051761507987976, -0.3369482159614563, -0.03184109181165695, 0.10999879240989685, -0.3409518599510193, -0.23156791925430298, -0.23901310563087463, 0.21344880759716034, -0.1192665547132492, 0.1248963326215744, 0.009635640308260918, -0.3668716549873352, 0.09964478015899658, 0.15868476033210754, -0.10015679150819778, 0.033961229026317596, 0.06625651568174362, 0.04983476921916008, 0.35853755474090576, 0.027919430285692215, 0.05942625179886818, -0.11515329033136368, 0.22728560864925385, -0.03466259688138962, 0.19235320389270782, 0.07729087769985199, -0.0347239226102829, -0.24525439739227295, -0.2463492602109909, 0.13490846753120422, 0.07847969979047775, -0.4022616446018219, -0.6202483177185059, -0.07364199310541153, -0.015680037438869476, -0.26434579491615295, 0.1536671221256256, -0.07783143222332001, -0.09561028331518173, 0.052926257252693176, -0.33412933349609375, -0.22636666893959045, -0.13052627444267273, 0.3259979784488678, -0.11406581103801727, 0.25567612051963806, 0.467844694852829, 0.021602071821689606, -0.2449224293231964, -0.1609184294939041, 0.1483123004436493, 0.19675147533416748, -0.4645687937736511, 0.0688444972038269, -0.28306543827056885, -0.002166643738746643, 0.11831194162368774, 0.34885939955711365, 0.28130486607551575, -0.014352824538946152, -0.004276365041732788, -0.2993018925189972, 0.22239765524864197, 0.15525861084461212, 0.0808866024017334, 0.010139784775674343, 0.01464717835187912, -0.15024405717849731, -0.31037265062332153, -0.08672983944416046, -0.30908116698265076, -0.0462225079536438, -0.04377339407801628, 0.24806176126003265, 0.43359214067459106, 0.14767712354660034, -0.12697073817253113, -0.18319331109523773, 0.2034386396408081, 0.03336481750011444, 0.08139435946941376, -0.20209966599941254, -0.14034020900726318, 0.09390043467283249, 0.17448656260967255, 0.19800132513046265, -0.1915455311536789, -0.33397209644317627, -0.16710397601127625, -0.07246609777212143, 0.005308747291564941, 0.13977348804473877, -0.019180145114660263, -0.23137694597244263, 0.4154253900051117, 0.04821162670850754, -0.16560843586921692, 0.010316448286175728, -0.49044251441955566, 0.10600940883159637, -0.2283085733652115, 0.03699216619133949, -0.17445331811904907, -0.04364103823900223, -0.1908818930387497, 0.17122961580753326, -0.14658117294311523, 0.24206975102424622, 0.414568156003952, -0.15897293388843536, -0.14378046989440918, 0.23284021019935608, 0.5077655911445618, 0.3245517909526825, -0.10494650900363922, -0.46066755056381226, 0.1645997017621994, 0.2238583117723465, -0.16189870238304138, -0.4337434470653534, -0.06040121614933014, -0.05346421152353287, -0.0474446564912796, 0.2917654514312744, 0.033712804317474365, 0.09119755029678345, -0.4307330548763275, 0.2584766447544098, 0.2761951982975006, -0.2897249162197113, 0.4358806610107422, 0.42015841603279114, -0.10321809351444244, 0.11391003429889679, 0.23012569546699524, 0.0983421802520752, 0.3364780843257904, 0.2651536464691162, 0.37610554695129395, 0.17770814895629883, 0.5965555906295776, -0.18991942703723907, 0.09466420859098434, -0.17548495531082153, -0.21207855641841888, -0.11264766752719879, 0.16928645968437195, 0.07650864124298096, 0.22614294290542603, -0.03678804636001587, 0.09839248657226562, -0.1930486261844635, -0.2928827106952667, 0.08140288293361664, -0.08923035860061646, 0.06543393433094025, 0.18061397969722748, -0.2196066826581955, -0.18874898552894592, 0.01426301896572113, -0.2683388590812683, 0.2109188586473465, -0.12920136749744415, -0.021078646183013916, 0.16173967719078064, -0.1758398711681366, -0.01730854995548725, -0.12016887217760086, 0.3046741485595703, -0.2857813835144043, 0.20141735672950745, 0.1601090282201767, -0.019349943846464157, -0.06183338910341263, -0.021120691671967506, 0.46426090598106384, 0.3938438892364502, 0.09165704995393753, 0.05778324231505394, 0.05606832727789879, -0.11504267156124115, 0.1812007874250412, 0.13461369276046753, -0.23214320838451385, -0.11547219753265381, 0.40850895643234253, 0.19125527143478394, -0.21237006783485413, -0.03444923460483551, 0.25204819440841675, 0.24444043636322021, -0.256479412317276, 0.32218074798583984, -0.14467816054821014, -0.17830169200897217, 0.13046926259994507, 0.25443336367607117, -0.1454990953207016, -0.31887710094451904, -0.07023751735687256, 0.30770406126976013, 0.19910815358161926, 0.043215665966272354, 0.11270703375339508, 0.18961627781391144, 0.24526891112327576, 0.3313620388507843, -0.28984102606773376, -0.19958052039146423, -0.08210282772779465, -0.39049282670021057, -0.04582875221967697, -0.3307628035545349, -0.3864758014678955, 0.1475580930709839, 0.32537829875946045, 0.15075382590293884, 0.11992423236370087, 0.24610242247581482, 0.3226914405822754, -0.19450238347053528, 0.23172128200531006, -0.2546519637107849, -0.25574713945388794, 0.1345241367816925, -0.26437708735466003, -0.21299634873867035, -0.3991202414035797, 0.05294833332300186, 0.4162563681602478, 0.10500308871269226, -0.12290120869874954, -0.05670173466205597, -0.19020572304725647, -0.06434974074363708, 0.089676633477211, 0.08092222362756729, 0.10788971930742264, -0.13153840601444244, -0.16363580524921417, 0.0034543555229902267, -0.3836941421031952, -0.25725069642066956, 0.46053603291511536, -0.1460370272397995, 0.39000147581100464, -0.022922612726688385, -0.18201309442520142, -0.39107951521873474, -0.06962787359952927, -0.1724698543548584, 0.09741737693548203, -0.42913568019866943, 0.12955938279628754, 0.0771733969449997, -0.01356545090675354, -0.035700585693120956, 0.10320225358009338, 0.02214960753917694, 0.41973766684532166, 0.0825149416923523, -0.36391785740852356, 0.3991795778274536, 0.1950269341468811, -0.2413468360900879, 0.13610246777534485, 0.30530667304992676, 0.2569083869457245, 0.07933897525072098, -0.10241382569074631, -0.04366941750049591, 0.2835625410079956, -0.008932547643780708, 0.04374723881483078, 0.1534985899925232, 0.03444838896393776, 0.001332022249698639, 0.025922127068042755, 0.39450544118881226, -0.13970579206943512, -0.05368422716856003, 0.0817810595035553, -0.18886476755142212 ]
https://github.com/huggingface/datasets/issues/5989
in this case we need to decide what to do with the existing datasets with white space characters (there shouldn't be a lot of them I think)
Set a rule on the config and split names
> should we actually allow characters like spaces? maybe it's better to add validation for whitespace symbols and directly in datasets and raise https://github.com/huggingface/datasets-server/issues/853
27
Set a rule on the config and split names > should we actually allow characters like spaces? maybe it's better to add validation for whitespace symbols and directly in datasets and raise https://github.com/huggingface/datasets-server/issues/853 in this case we need to decide what to do with the existing datasets with white space characters (there shouldn't be a lot of them I think)
[ -0.059814464300870895, -0.04150398075580597, -0.08315175771713257, 0.05934174358844757, 0.19995608925819397, -0.1714780628681183, 0.46470189094543457, 0.13817793130874634, 0.13507847487926483, 0.22843386232852936, -0.12750555574893951, -0.20322933793067932, -0.012206869199872017, 0.4376853108406067, -0.17629685997962952, -0.08739520609378815, -0.0738164633512497, 0.2611483335494995, -0.08996137976646423, -0.11255145817995071, -0.15544836223125458, -0.030858930200338364, 0.05796483904123306, 0.20066681504249573, -0.37705615162849426, -0.26042792201042175, 0.1533212959766388, 0.03571782261133194, -0.2794746458530426, -0.3001689612865448, -0.03363587707281113, 0.30586159229278564, -0.19392992556095123, 0.34277552366256714, -0.00009997149754781276, -0.04932995140552521, 0.1906723827123642, 0.06309644877910614, -0.1539955735206604, -0.053893789649009705, -0.2904296815395355, -0.10750842094421387, 0.05888183414936066, -0.15728573501110077, -0.13482017815113068, -0.026530535891652107, 0.08000906556844711, -0.3283946216106415, 0.3465084731578827, 0.12652471661567688, 0.30501994490623474, 0.2344253957271576, -0.21003690361976624, -0.017853548750281334, -0.01841086894273758, 0.25745561718940735, -0.16488522291183472, -0.26992350816726685, 0.04754207283258438, 0.11766456812620163, -0.1918875128030777, 0.3083098828792572, 0.2524948716163635, 0.049661844968795776, 0.05292277783155441, 0.18597537279129028, -0.37077969312667847, -0.18675263226032257, 0.06278085708618164, 0.508783757686615, 0.2148582935333252, -0.10203284025192261, -0.3338612914085388, -0.3606227934360504, -0.13789862394332886, -0.4517669081687927, 0.5895064473152161, 0.12829804420471191, 0.01852860301733017, 0.1880788654088974, -0.3103640675544739, -0.23445561528205872, -0.11715560406446457, -0.011133883148431778, -0.0665270984172821, 0.23625466227531433, -0.09433898329734802, -0.045047953724861145, -0.038968976587057114, -0.31091436743736267, -0.12401652336120605, -0.16827252507209778, -0.15240292251110077, -0.11673679202795029, -0.18602126836776733, -0.1856255829334259, -0.3328598439693451, 0.2025829255580902, 0.29569211602211, 0.15334175527095795, -0.16427834331989288, 0.1171833723783493, 0.0059904977679252625, -0.010954491794109344, 0.14252924919128418, -0.06543512642383575, 0.2058616429567337, -0.03277358040213585, 0.5845929980278015, 0.10953207314014435, 0.053537704050540924, -0.11640577018260956, 0.3309498131275177, -0.31695711612701416, -0.25883767008781433, -0.23492646217346191, 0.20118248462677002, -0.18521001935005188, -0.013191495090723038, 0.1676475703716278, 0.3738538920879364, -0.06611316651105881, 0.10355076938867569, 0.3042030334472656, 0.050529491156339645, 0.008175579831004143, -0.1136263832449913, 0.1557907909154892, 0.054375819861888885, -0.22899194061756134, -0.2173534333705902, -0.20352618396282196, -0.24138429760932922, 0.19127607345581055, 0.1520477831363678, 0.009286340326070786, 0.1970430463552475, 0.1722468137741089, 0.19718673825263977, 0.11570349335670471, -0.023124653846025467, -0.023856984451413155, 0.09382396936416626, 0.2695898711681366, 0.04853130877017975, 0.19897758960723877, -0.17893525958061218, -0.22442923486232758, 0.08988910913467407, -0.2501591444015503, -0.14707840979099274, -0.09176276624202728, -0.3016503155231476, 0.2882816791534424, -0.09307532012462616, -0.0318383052945137, -0.18685689568519592, 0.04102785140275955, 0.2176852971315384, -0.015454351902008057, 0.051609721034765244, 0.2063380479812622, -0.18550769984722137, 0.003589130938053131, 0.024263650178909302, 0.09972783923149109, -0.16889417171478271, -0.005247257649898529, 0.03863927721977234, -0.1097516119480133, 0.18615879118442535, 0.4155953526496887, -0.06277205795049667, -0.3104596734046936, -0.2680954337120056, 0.5925039052963257, 0.07340710610151291, -0.16020897030830383, -0.029472650960087776, 0.3161618411540985, 0.08008112013339996, -0.2707693576812744, 0.2352457195520401, -0.32095855474472046, 0.47411152720451355, -0.101383276283741, 0.05548172444105148, 0.23217566311359406, -0.0026451023295521736, 0.1590539813041687, -0.2465846985578537, -0.29825693368911743, 0.03484126925468445, 0.010949932038784027, -0.02322343736886978, -0.2299269586801529, 0.0057785287499427795, 0.03634900227189064, 0.2709132432937622, -0.29662543535232544, 0.16977369785308838, 0.06633839011192322, 0.31227463483810425, 0.1606636792421341, -0.08896621316671371, -0.1541685163974762, -0.3377010226249695, -0.07242267578840256, 0.09259455651044846, 0.09316887706518173, -0.051423776894807816, -0.3567744195461273, -0.09271275997161865, -0.16096621751785278, -0.2580114006996155, 0.08497977256774902, 0.26123228669166565, 0.20133107900619507, -0.07872572541236877, -0.13217492401599884, -0.2700546979904175, 0.212162047624588, -0.005665197968482971, 0.4100055992603302, -0.20999152958393097, 0.13052257895469666, -0.049328915774822235, -0.03230205550789833, 0.17007571458816528, 0.10783755779266357, 0.045956872403621674, -0.11991702765226364, -0.019708655774593353, 0.4738350808620453, 0.1772157996892929, 0.2951951026916504, 0.17373383045196533, 0.13449916243553162, 0.4153672754764557, 0.02861925959587097, -0.043239347636699677, 0.11420701444149017, -0.05474924296140671, 0.15728391706943512, -0.1990801990032196, 0.4728073477745056, -0.14374762773513794, 0.03463154286146164, -0.03368319571018219, 0.06276867538690567, 0.3241329491138458, -0.26840466260910034, -0.07732144743204117, -0.4271948039531708, 0.10378070175647736, -0.12862282991409302, 0.3298439383506775, 0.2310701459646225, -0.506704568862915, -0.13660702109336853, 0.5582298040390015, 0.06362161040306091, 0.1368878185749054, -0.07470103353261948, 0.05786381661891937, -0.00526108592748642, 0.22725139558315277, 0.23508179187774658, 0.1373281180858612, 0.3723328709602356, -0.1526390016078949, -0.011985039338469505, -0.061438702046871185, -0.3212321996688843, 0.4093227684497833, 0.05356287956237793, -0.0989067405462265, 0.1572260558605194, -0.06401677429676056, -0.0975203663110733, -0.5938912034034729, -0.015412531793117523, -0.014959368854761124, -0.1271516978740692, -0.36269092559814453, -0.10343092679977417, -0.2782817482948303, -0.11256179958581924, -0.1058579534292221, -0.012627232819795609, -0.39562270045280457, -0.21668124198913574, 0.33251652121543884, -0.10076899826526642, -0.3328877389431, 0.30801451206207275, -0.0682508647441864, 0.28233999013900757, -0.16267430782318115, 0.13803772628307343, -0.4091779291629791, 0.043317463248968124, -0.14317721128463745, 0.21536260843276978, 0.19522824883460999, -0.09637746214866638, 0.46004587411880493, -0.029382824897766113, 0.05353472754359245, -0.15483899414539337, -0.4684444069862366, 0.1557639241218567, -0.19731569290161133, 0.11742980778217316, 0.36099809408187866, 0.26233720779418945, 0.16511261463165283, -0.2547867000102997, 0.07934018969535828, -0.18952181935310364, -0.09764336049556732, -0.1057969257235527, 0.08410999178886414, -0.06340670585632324, -0.3676382899284363, -0.37101665139198303, -0.03696639835834503, -0.30988025665283203, 0.1679718941450119, -0.23867012560367584, 0.028002437204122543, 0.351735919713974, -0.22113436460494995, -0.10548058152198792, -0.32201987504959106, 0.12063039094209671, -0.4287029504776001, -0.38673079013824463, 0.3481421172618866, -0.2560683488845825, -0.2589150667190552, 0.06666594743728638, 0.11994795501232147, 0.044852115213871, -0.13716155290603638, -0.1759135127067566, -0.1060594916343689, -0.23739461600780487, 0.17432937026023865, 0.4223295748233795, 0.06696788966655731, 0.057589977979660034, 0.09404762089252472, -0.2148045003414154, -0.24243329465389252, -0.1493271291255951, 0.08215318620204926, -0.08849748969078064, 0.2324603796005249, -0.0012703035026788712, 0.25876760482788086, -0.022978495806455612, 0.32288527488708496, -0.020170338451862335, 0.08447699248790741, 0.395120769739151, -0.11134134978055954, 0.3333069980144501, 0.09925566613674164, -0.14993110299110413, 0.31958717107772827, 0.05317016690969467, 0.10037683695554733, 0.5257628560066223, 0.050663307309150696, 0.25472453236579895, 0.03372352570295334, 0.09384921938180923, -0.13476720452308655, -0.4762226343154907, 0.024853648617863655, 0.14066645503044128, 0.0010868627578020096, 0.15984490513801575, -0.043761320412158966, 0.12535911798477173, -0.19069749116897583, -0.1355675905942917, 0.14606580138206482, -0.1210893765091896, -0.16220371425151825, -0.5452067852020264, 0.17407788336277008, -0.2702636420726776, 0.2398591786623001, -0.04610918089747429, 0.20604416728019714, -0.17892754077911377, 0.02268405258655548, 0.07544521987438202, 0.1523737609386444, 0.6880311369895935, -0.41128864884376526, -0.15955816209316254, -0.3130108118057251, 0.13428203761577606, -0.15840891003608704, 0.0701112300157547, -0.19228675961494446, 0.08445572853088379, 0.0626065731048584, 0.41261711716651917, -0.4843587875366211, -0.37570759654045105, 0.09204812347888947, 0.1276409924030304, -0.24964596331119537, 0.09397461265325546, -0.13285280764102936, -0.18472570180892944, -0.32616642117500305, 0.09567467868328094, 0.11846835911273956, 0.18285098671913147, 0.015746135264635086, -0.010727614164352417, -0.09230099618434906, -0.1478310525417328, 0.42553579807281494, 0.37748873233795166, 0.33653515577316284, -0.10907253623008728, 0.061975643038749695, 0.21586962044239044, 0.3496890664100647, 0.245588481426239, 0.30695101618766785, -0.3894030749797821, -0.3257101774215698, -0.010241951793432236, -0.36276957392692566, 0.5042271614074707, 0.43024513125419617, -0.02288512885570526, 0.09078222513198853, 0.09337504208087921, 0.4370940923690796, -0.0933639332652092, 0.14331334829330444, 0.22489230334758759, 0.20496580004692078, -0.3718663156032562, -0.1682489514350891, 0.1792527288198471, 0.17655256390571594, -0.15777063369750977, 0.025803539901971817, 0.6529098153114319, -0.6058453917503357, 0.21631503105163574, -0.010945819318294525, 0.7847931981086731, 0.17088532447814941, 0.2246570885181427, 0.12457354366779327, -0.2703354060649872, 0.4305534362792969, -0.06709481030702591, -0.15656156837940216, -0.21605516970157623, -0.1958300620317459, -0.016289561986923218, 0.13890355825424194, 0.37115803360939026, 0.19384819269180298, -0.19213807582855225, 0.29610875248908997, 0.046628162264823914, 0.20398293435573578, -0.19827648997306824, 0.34029099345207214, -0.1845938265323639, -0.49531152844429016, -0.4436986744403839, 0.20910295844078064, -0.028063274919986725, -0.053756050765514374, 0.015726856887340546, -0.19797590374946594, 0.2326613962650299, -0.3348918557167053, -0.009658381342887878, -0.16154158115386963, -0.25152313709259033, -0.11359565705060959, 0.12939414381980896, 0.05213762819766998, 0.13464108109474182, 0.07213257998228073, 0.5368790626525879, 0.4122297167778015, -0.1287013441324234, 0.22818595170974731, -0.13884881138801575, 0.20757043361663818, -0.4240562915802002, 0.11548309028148651, 0.04821700602769852, -0.1698308289051056, -0.12653836607933044, -0.2719195783138275, 0.13385827839374542, 0.05429577827453613, -0.1243639886379242, -0.09501339495182037, -0.2569922208786011, -0.5709563493728638, 0.15111593902111053, -0.21973024308681488, 0.030923403799533844, -0.27507883310317993, 0.2340976744890213, -0.18616420030593872, -0.16816937923431396, 0.29914146661758423, 0.2941065728664398, -0.05482068657875061, -0.22503909468650818, -0.01417846605181694, -0.05244666337966919, 0.12822939455509186, 0.31340354681015015, -0.04768046736717224, -0.2724587619304657, -0.4156716763973236, 0.19855302572250366, 0.15905822813510895, -0.2975330650806427, 0.1811578869819641, 0.2369556874036789, -0.41847214102745056, -0.08556829392910004, 0.20769642293453217, 0.18386809527873993, -0.004231510683894157, 0.25339460372924805, -0.15410815179347992, -0.09844888001680374, 0.28222745656967163, -0.10885168612003326, 0.3279725909233093, 0.19033296406269073, 0.19058771431446075, -0.10606209188699722, -0.08943862468004227, -0.43488675355911255, 0.05233272910118103, -0.139301598072052, 0.09837812185287476, 0.09516521543264389, -0.20337438583374023, 0.36179235577583313, -0.3163870573043823, 0.186194509267807, 0.0447334349155426, -0.13203772902488708, -0.2920316457748413, -0.2332429140806198, 0.07166209816932678, -0.024896400049328804, -0.06962071359157562, -0.05012261122465134, 0.12552446126937866, 0.026181429624557495, -0.12340101599693298, 0.22680479288101196, 0.11090590059757233, 0.129810631275177, 0.1983104795217514, 0.1901453286409378, -0.26984724402427673, -0.10004894435405731, -0.07298080623149872, 0.20094828307628632, 0.2667253911495209, 0.1688271015882492, 0.1921488642692566, -0.2590493857860565, -0.1499607264995575, 0.32675406336784363, 0.20524832606315613, 0.12919192016124725, 0.1519978791475296, 0.09143377840518951, -0.19914531707763672, -0.20770099759101868, 0.3656567633152008, 0.44937387108802795, 0.3229800760746002, -0.1394454836845398, -0.1627064347267151, 0.14547309279441833, 0.3381330966949463, -0.34542399644851685, 0.009215619415044785, 0.25132474303245544, 0.014582019299268723, 0.24992427229881287, 0.2876072824001312, 0.23690064251422882, -0.05290086567401886, -0.2580015957355499, 0.15640361607074738, 0.20322377979755402, -0.15462204813957214, 0.2138182669878006, 0.3105425238609314, -0.24085168540477753, 0.07846494764089584, 0.5016748905181885, 0.10588531196117401, 0.0003981366753578186, 0.46541497111320496, -0.17448030412197113, 0.4824700951576233, -0.0057664904743433, 0.0572972409427166, 0.18838068842887878, -0.06285209208726883, 0.10091638565063477, 0.08086136728525162, -0.18133658170700073, -0.013637535274028778, 0.10084745287895203, 0.24418416619300842, -0.12571218609809875, -0.4471280872821808, -0.2570313513278961, 0.15839579701423645, -0.18291833996772766, -0.3064693510532379, -0.20758147537708282, 0.036595411598682404, -0.15449686348438263, 0.026719041168689728, -0.02870207279920578, -0.06029011309146881, 0.29840347170829773, 0.06343598663806915, 0.20541727542877197, -0.35565924644470215, 0.1691529005765915, 0.05840390548110008, 0.2255256325006485, -0.12838609516620636, 0.4164118468761444, 0.08818963915109634, -0.15185897052288055, 0.2473825216293335, 0.307216614484787, 0.2881366014480591, -0.12120209634304047, 0.09358333051204681, 0.031511422246694565, -0.2108963578939438, -0.09370541572570801, -0.11105923354625702, 0.14625395834445953, 0.1600821614265442, 0.11336764693260193, 0.3529241383075714, 0.25987252593040466, -0.2109450399875641, 0.10633451491594315, -0.08318375051021576, -0.1835794895887375, -0.04046744480729103, 0.07418058812618256, 0.17082911729812622, -0.18299423158168793, -0.20562346279621124, -0.33800849318504333, -0.34745538234710693, 0.018945705145597458, 0.5091773867607117, -0.22675934433937073, 0.17633630335330963, -0.3616170287132263, 0.1419130563735962, 0.27766701579093933, 0.4314124286174774, 0.08658276498317719, -0.08591517806053162, -0.023713771253824234, -0.1252613663673401, -0.5163717865943909, -0.08261758834123611, -0.07995255291461945, 0.07731635123491287, -0.18002016842365265, -0.09032049775123596, -0.01845778152346611, -0.005916304886341095, 0.1158716231584549, 0.011044666171073914, -0.16772469878196716, -0.29682475328445435, -0.30582624673843384, 0.11712610721588135, 0.23207969963550568, 0.0786423310637474, 0.1708361804485321, -0.20474006235599518, 0.3105698823928833, 0.014223802834749222, 0.07741309702396393, -0.09147636592388153, 0.4253969192504883, 0.02105197310447693, -0.11447177082300186, -0.13760478794574738, 0.3129378855228424, 0.17962437868118286, -0.18636438250541687, 0.055802129209041595, -0.07200194895267487, -0.35579317808151245, -0.4168332517147064, 0.2578217685222626, 0.2140236496925354, 0.23239880800247192, -0.020812969654798508, -0.08067026734352112, -0.2004411816596985, 0.22012361884117126, -0.008668646216392517, 0.23567171394824982, -0.12379521876573563, 0.21075373888015747, 0.19651959836483002, -0.026758361607789993, -0.08036451041698456, 0.2247978299856186, -0.250549852848053, -0.024565886706113815, -0.05563122034072876, -0.7402986288070679, 0.4203837513923645, -0.16240088641643524, -0.2697299122810364, -0.07495954632759094, 0.30281251668930054, 0.31342262029647827, -0.1708436757326126, -0.6178938150405884, 0.08120833337306976, 0.09997828304767609, -0.15787658095359802, -0.30080968141555786, 0.17182058095932007, 0.22307367622852325, -0.19897997379302979, -0.016246765851974487, 0.4003899395465851, 0.2701088488101959, -0.46145179867744446, 0.19493642449378967, -0.04237255081534386 ]
https://github.com/huggingface/datasets/issues/5988
Unfortunately, I can't reproduce the error. What does the following code return for you? ```python import requests from huggingface_hub import hf_hub_url r = requests.get(hf_hub_url("codeparrot/codeparrot-clean-train", "dataset_infos.json", repo_type="dataset")) ``` Also, can you provide more info about your network (region, proxies, etc.)?
ConnectionError: Couldn't reach dataset_infos.json
### Describe the bug I'm trying to load codeparrot/codeparrot-clean-train, but get the following error: ConnectionError: Couldn't reach https://huggingface.co/datasets/codeparrot/codeparrot-clean-train/resolve/main/dataset_infos.json (ConnectionError(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))) ### Steps to reproduce the bug train_data = load_dataset('codeparrot/codeparrot-clean-train', split='train') ### Expected behavior download the dataset ### Environment info centos7
39
ConnectionError: Couldn't reach dataset_infos.json ### Describe the bug I'm trying to load codeparrot/codeparrot-clean-train, but get the following error: ConnectionError: Couldn't reach https://huggingface.co/datasets/codeparrot/codeparrot-clean-train/resolve/main/dataset_infos.json (ConnectionError(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))) ### Steps to reproduce the bug train_data = load_dataset('codeparrot/codeparrot-clean-train', split='train') ### Expected behavior download the dataset ### Environment info centos7 Unfortunately, I can't reproduce the error. What does the following code return for you? ```python import requests from huggingface_hub import hf_hub_url r = requests.get(hf_hub_url("codeparrot/codeparrot-clean-train", "dataset_infos.json", repo_type="dataset")) ``` Also, can you provide more info about your network (region, proxies, etc.)?
[ -0.36494722962379456, -0.2202487587928772, -0.05098268389701843, 0.30980199575424194, 0.14730001986026764, -0.14014923572540283, -0.03622368723154068, 0.34880274534225464, 0.2515786290168762, 0.1794554740190506, -0.23319512605667114, 0.24075737595558167, 0.3046640157699585, 0.23989418148994446, 0.13381227850914001, -0.14387419819831848, -0.03341693431138992, 0.05077653005719185, -0.08495966345071793, 0.04738152027130127, -0.13677942752838135, 0.07093480229377747, -0.05343480408191681, 0.21579332649707794, -0.3542664647102356, 0.014487085863947868, -0.07097341865301132, 0.3759198486804962, -0.1593107283115387, -0.3751794099807739, 0.5421237945556641, 0.08637937903404236, 0.19603517651557922, 0.6905542016029358, -0.00011963956785621122, 0.24402020871639252, 0.42100581526756287, -0.00898304209113121, -0.44763070344924927, -0.4580792188644409, -0.34929054975509644, -0.12814949452877045, 0.23904381692409515, -0.09648334980010986, -0.05402408540248871, 0.09128300845623016, 0.06441608816385269, 0.08264177292585373, 0.4542950689792633, 0.25846511125564575, 0.16597683727741241, 0.4006064236164093, 0.24454565346240997, -0.15861918032169342, -0.120043084025383, -0.06428540498018265, 0.01966112107038498, 0.8044682741165161, 0.04144308716058731, -0.11286140978336334, -0.05659535899758339, 0.18271684646606445, 0.006435319781303406, 0.05215400457382202, 0.2294466197490692, -0.11488644033670425, 0.03126700222492218, -0.051219191402196884, 0.03231867030262947, 0.03711044788360596, 0.10331100970506668, -0.1963675320148468, -0.30401092767715454, -0.10591509193181992, -0.0986739844083786, -0.32491835951805115, 0.3139742910861969, -0.00576622411608696, -0.24433167278766632, 0.2545090615749359, -0.44146621227264404, -0.3518933355808258, -0.21556934714317322, 0.2828202545642853, 0.0032735541462898254, 0.04728364571928978, -0.21564647555351257, 0.1549890786409378, 0.17571726441383362, 0.1249009221792221, -0.01746077463030815, -0.152518168091774, 0.1425943225622177, 0.057283274829387665, -0.1802363395690918, 0.09028147161006927, 0.04759594798088074, 0.08079376071691513, 0.28020137548446655, 0.22944748401641846, -0.1201537698507309, 0.09960450232028961, -0.22007152438163757, 0.22418718039989471, 0.27425825595855713, -0.021889127790927887, -0.13708430528640747, 0.1868841052055359, 0.3564629852771759, 0.6122459173202515, -0.032918114215135574, -0.03559945151209831, -0.09860260784626007, 0.07359994947910309, -0.3698646128177643, -0.12273092567920685, 0.3279697000980377, -0.20901162922382355, -0.23249149322509766, 0.24234646558761597, -0.16106560826301575, 0.01206858828663826, 0.1411440372467041, 0.5129457712173462, -0.3978748321533203, 0.15719299018383026, 0.03384189307689667, 0.18407103419303894, -0.16201256215572357, 0.17339402437210083, -0.22651568055152893, 0.12632732093334198, -0.18283504247665405, 0.26004815101623535, 0.0917111188173294, -0.23900845646858215, 0.1431208699941635, -0.04809705913066864, 0.21969354152679443, -0.44889768958091736, -0.009769562631845474, 0.009898833930492401, -0.4572104215621948, 0.24075576663017273, 0.11621032655239105, 0.11378701776266098, 0.2819119691848755, -0.10817757248878479, -0.09300131350755692, -0.23765209317207336, -0.5613496899604797, -0.4351103603839874, 0.09058871865272522, 0.09670284390449524, -0.11783565580844879, 0.09802401065826416, -0.48985201120376587, -0.2629542052745819, -0.17547607421875, 0.030228473246097565, -0.17050254344940186, -0.024510784074664116, -0.04795130342245102, -0.13245145976543427, 0.3637469410896301, 0.39183735847473145, 0.2105638086795807, -0.18981358408927917, 0.27153491973876953, -0.06933985650539398, 0.07942524552345276, 0.2427770495414734, -0.2226828634738922, 0.032037608325481415, -0.3754899799823761, -0.015558384358882904, 0.26149487495422363, -0.46037283539772034, -0.5666580200195312, 0.41668811440467834, -0.31729140877723694, 0.20760780572891235, -0.11710846424102783, -0.1039448231458664, -0.17511768639087677, 0.22538509964942932, 0.41089510917663574, 0.15264591574668884, 0.17268608510494232, -0.09603896737098694, -0.1276230812072754, -0.352055162191391, -0.04540356993675232, 0.301689088344574, 0.17149758338928223, 0.24567881226539612, 0.10841965675354004, -0.006746970117092133, 0.45962393283843994, 0.06927673518657684, 0.03862261772155762, 0.3125871419906616, 0.2137690782546997, 0.2944117784500122, -0.00931653380393982, -0.22363868355751038, -0.02489868551492691, 0.2774551808834076, 0.08091802895069122, -0.0457841195166111, -0.23436151444911957, -0.08889074623584747, -0.4960407018661499, 0.1540604531764984, -0.1499468833208084, -0.022190140560269356, 0.056495070457458496, 0.26461243629455566, 0.0981862023472786, 0.06066584587097168, -0.26180315017700195, 0.7948218584060669, -0.3138386607170105, 0.2286541759967804, -0.3671494126319885, 0.7102519273757935, -0.1625097393989563, -0.0013694018125534058, 0.08957204222679138, 0.26595205068588257, 0.1781272441148758, -0.1746828705072403, -0.049658723175525665, 0.42762672901153564, 0.05469391494989395, 0.16173596680164337, 0.3407084047794342, -0.08703359961509705, 0.13131478428840637, -0.5390530824661255, -0.138173446059227, 0.17223982512950897, 0.19401168823242188, 0.20351415872573853, 0.2534838318824768, 0.20880408585071564, 0.07864414155483246, 0.4384020268917084, 0.10059670358896255, 0.024487651884555817, 0.20181715488433838, -0.027954302728176117, -0.08104267716407776, 0.21115848422050476, 0.4135318994522095, -0.029360299929976463, 0.043997593224048615, -0.13485580682754517, -0.11830922216176987, -0.15940745174884796, 0.1535407304763794, -0.13452710211277008, 0.1221533715724945, 0.3299221098423004, 0.012956298887729645, -0.07127515971660614, 0.0022841840982437134, -0.06956197321414948, 0.28179502487182617, -0.021749014034867287, -0.20418237149715424, 0.23559507727622986, -0.14142891764640808, 0.0033218637108802795, 0.03245643526315689, 0.09552669525146484, 0.08212073147296906, 0.1143072098493576, 0.02063717320561409, -0.11757467687129974, -0.14568212628364563, -0.5302068591117859, -0.2190016210079193, 0.20429496467113495, -0.321341335773468, 0.25163185596466064, -0.21587222814559937, 0.23089954257011414, 0.022349193692207336, -0.12834426760673523, -0.4233233630657196, -0.24504350125789642, -0.10890105366706848, 0.3123013377189636, 0.14058932662010193, -0.008315186947584152, -0.34254252910614014, 0.0343969464302063, -0.04385526850819588, -0.1061694324016571, -0.10425301641225815, -0.1886913776397705, -0.10234247148036957, -0.09017050266265869, 0.0034238100051879883, -0.017168868333101273, 0.17675524950027466, -0.3678872585296631, -0.17132195830345154, -0.05517740547657013, -0.03554827719926834, 0.24002891778945923, -0.05873318389058113, 0.18598820269107819, 0.3628881573677063, 0.49288010597229004, -0.013686306774616241, -0.11840265989303589, 0.4103645086288452, 0.07127092778682709, -0.10223780572414398, 0.030583113431930542, -0.06231638044118881, 0.11538873612880707, 0.11218293011188507, -0.010177772492170334, -0.31091171503067017, -0.5235148668289185, 0.43115875124931335, -0.15894053876399994, 0.05082615464925766, 0.21978618204593658, 0.18717429041862488, 0.2058027684688568, 0.0101432204246521, 0.09387227892875671, -0.2423311173915863, -0.4523586630821228, 0.15727731585502625, -0.07014903426170349, -0.20742705464363098, -0.02116452157497406, 0.0916614755988121, 0.23478978872299194, -0.13862164318561554, -0.7353419065475464, -0.3859783411026001, -0.11589952558279037, 0.2972329258918762, -0.10968067497015, 0.013348070904612541, -0.022288884967565536, -0.3959830105304718, 0.010230153799057007, 0.0347304493188858, -0.27739059925079346, -0.166347473859787, -0.02554723247885704, 0.36550453305244446, 0.2203626185655594, 0.4054453670978546, -0.16364631056785583, 0.2813360393047333, 0.27375486493110657, 0.13199517130851746, 0.42008811235427856, -0.07397785782814026, 0.37184441089630127, -0.11828190088272095, -0.4180031716823578, -0.1715172827243805, -0.23458445072174072, -0.17388522624969482, -0.04085490107536316, 0.14743539690971375, 0.22210748493671417, -0.5265597701072693, -0.49575698375701904, -0.2626054883003235, -0.27311956882476807, -0.02497725747525692, 0.12754979729652405, 0.17063012719154358, 0.061261363327503204, 0.06845632195472717, -0.17451849579811096, 0.0469648502767086, 0.10594231635332108, 0.6751935482025146, 0.12729933857917786, 0.07196159660816193, -0.5166996717453003, -0.3624284267425537, -0.20466285943984985, 0.26330581307411194, 0.14498087763786316, 0.22726896405220032, -0.22977495193481445, 0.25411951541900635, 0.15666399896144867, -0.2383294701576233, 0.637954592704773, 0.06444930285215378, 0.3019982576370239, -0.029810689389705658, -0.16054518520832062, -0.46012359857559204, 0.06698307394981384, 0.13693752884864807, 0.2788073420524597, 0.16748185455799103, 0.40875279903411865, -0.3763372302055359, -0.1729600429534912, 0.12413688004016876, -0.013813968747854233, -0.06427136063575745, -0.15067172050476074, -0.3222643733024597, -0.45026516914367676, -0.45018792152404785, 0.06710047274827957, 0.02140657603740692, 0.2936962842941284, 0.013520754873752594, -0.19623497128486633, 0.34173235297203064, -0.14764317870140076, 0.03946075960993767, 0.12264318764209747, 0.15528827905654907, -0.042877357453107834, 0.05841776728630066, 0.37464749813079834, 0.3012639582157135, 0.3340608477592468, 0.5701931118965149, 0.05411257967352867, -0.24493655562400818, 0.3788754940032959, 0.15157295763492584, 0.21433623135089874, 0.4454839527606964, 0.009888753294944763, 0.23228323459625244, 0.3898242712020874, 0.2704450190067291, -0.27433913946151733, 0.04209518805146217, 0.21154099702835083, 0.006367400288581848, -0.4357132315635681, -0.3945060074329376, 0.48397397994995117, -0.25936660170555115, -0.012133769690990448, 0.0821685865521431, 0.3215164542198181, 0.07254942506551743, 0.14543083310127258, -0.4336700439453125, 1.1236432790756226, 0.20276162028312683, 0.09744971990585327, 0.1925172507762909, -0.5093623995780945, 0.5768761038780212, -0.5889790058135986, 0.16332650184631348, -0.213987797498703, 0.03947501629590988, -0.09119875729084015, -0.2236437350511551, 0.03235336393117905, -0.2237686961889267, 0.021941713988780975, 0.15392927825450897, -0.3513954281806946, 0.15345819294452667, -0.057472094893455505, 0.14172707498073578, -0.37238505482673645, 0.09411317855119705, -0.689367949962616, 0.14060384035110474, -0.18138457834720612, 0.520819365978241, -0.12049002945423126, -0.09440183639526367, -0.4496374726295471, -0.3340643346309662, -0.2638252377510071, 0.13736192882061005, 0.09237112104892731, 0.26971107721328735, 0.13389138877391815, -0.03816889226436615, -0.15598510205745697, -0.15428081154823303, 0.11794231832027435, 0.046212777495384216, -0.36289721727371216, 0.17779770493507385, -0.4373836815357208, -0.09745173156261444, 0.0869712308049202, 0.07149766385555267, -0.14076478779315948, -0.13972896337509155, -0.538098156452179, 0.2598145306110382, -0.18712887167930603, -0.5826143026351929, 0.18212024867534637, 0.09286834299564362, 0.11675028502941132, -0.13009481132030487, 0.04709937423467636, -0.1698284149169922, 0.16082321107387543, -0.14087054133415222, 0.09093198925256729, 0.1405411660671234, -0.1375514417886734, -0.11904333531856537, 0.3252142071723938, -0.3108901381492615, -0.07403042912483215, 0.5946027040481567, -0.050050344318151474, -0.21865762770175934, 0.37254947423934937, 0.22371770441532135, -0.25151312351226807, -0.13968388736248016, 0.0011934414505958557, 0.4363242983818054, -0.41500526666641235, -0.0016648732125759125, -0.17329278588294983, 0.08067020773887634, -0.3345319628715515, 0.17416493594646454, 0.3235311508178711, -0.06656531989574432, 0.05813714861869812, -0.6675123572349548, -0.35196632146835327, 0.1889452189207077, -0.13493777811527252, 0.17238494753837585, 0.11235684156417847, 0.295299232006073, -0.17322644591331482, -0.13401272892951965, -0.23534446954727173, 0.1773611307144165, -0.4651806354522705, -0.05723998695611954, 0.4022446870803833, -0.12191732227802277, 0.3319561183452606, -0.039461325854063034, 0.1069478839635849, 0.14838722348213196, -0.22600522637367249, -0.09938422590494156, -0.2482641488313675, 0.18334512412548065, -0.010234881192445755, -0.21450936794281006, -0.16222630441188812, -0.1300806701183319, 0.016328204423189163, 0.08164754509925842, 0.16266413033008575, 0.18555812537670135, 0.1409335881471634, -0.25052738189697266, -0.06682723760604858, -0.08853596448898315, -0.27446281909942627, 0.21173982322216034, 0.20557411015033722, 0.6283972859382629, -0.10049885511398315, -0.011411360464990139, -0.27288568019866943, 0.018912777304649353, -0.12551550567150116, 0.14726875722408295, 0.13106733560562134, 0.1499020904302597, 0.42410600185394287, -0.22197341918945312, 0.1335829496383667, 0.02614426240324974, 0.32966750860214233, 0.3515942692756653, -0.211964949965477, 0.07068239897489548, 0.0011180378496646881, 0.13267046213150024, -0.023968659341335297, -0.035029441118240356, 0.44377824664115906, -0.07673323154449463, -0.12851251661777496, 0.1111077219247818, 0.042827457189559937, 0.10909079015254974, -0.05549885705113411, 0.11105076968669891, 0.5164976716041565, 0.37446099519729614, 0.034740932285785675, 0.2542923092842102, -0.012569516897201538, 0.05354393646121025, 0.006845593452453613, -0.018442943692207336, 0.20973747968673706, 0.2763558030128479, -0.18832144141197205, -0.0024743471294641495, -0.20505693554878235, 0.41197431087493896, -0.05492793396115303, -0.2568999230861664, -0.046375591307878494, 0.05382188409566879, -0.13954982161521912, -0.07565425336360931, -0.33892542123794556, 0.3785014748573303, -0.3547716438770294, 0.14278718829154968, -0.3749859929084778, 0.10038818418979645, -0.1021675243973732, -0.07881089299917221, -0.16567334532737732, -0.33251771330833435, -0.4314310848712921, -0.08090963959693909, 0.08209717273712158, -0.1320538967847824, 0.1417292356491089, -0.04933590069413185, -0.05005814507603645, -0.30737370252609253, -0.21254844963550568, 0.37462931871414185, 0.1387745589017868, -0.0939265713095665, 0.20885059237480164, 0.12919281423091888, -0.011377617716789246, 0.10517069697380066, 0.13155797123908997, 0.49302127957344055, 0.10192923247814178, 0.0509277805685997, 0.05588288977742195, 0.24999886751174927, 0.004065275192260742, -0.06448455154895782, 0.03770715743303299, 0.1732744425535202, -0.12992805242538452, 0.2186545580625534, 0.18735776841640472, -0.1809583306312561, 0.06522616744041443, -0.13725340366363525, 0.40506675839424133, -0.27046385407447815, 0.38986921310424805, -0.2452196180820465, 0.07730066776275635, -0.20460444688796997, -0.11704239249229431, -0.450187087059021, -0.04382215812802315, 0.2173217087984085, -0.10652341693639755, 0.20024807751178741, -0.12050051242113113, 0.040553946048021317, -0.30747509002685547, 0.48374485969543457, 0.4572317898273468, 0.18218648433685303, -0.20987436175346375, -0.2897019386291504, -0.21205636858940125, 0.3256376385688782, -0.2234710454940796, -0.14590024948120117, 0.08975226432085037, -0.14592984318733215, -0.1510474979877472, 0.2013668417930603, 0.05730843544006348, 0.08326460421085358, 0.10529471188783646, 0.17277342081069946, -0.00508677214384079, -0.3372517228126526, 0.004558435641229153, 0.17573507130146027, 0.04430744796991348, -0.19905517995357513, 0.19938227534294128, 0.02212342619895935, -0.08233116567134857, 0.03870932385325432, -0.05869487673044205, 0.056329146027565, -0.4882327914237976, 0.4914519190788269, 0.16468532383441925, 0.5233277678489685, -0.047299306839704514, -0.4532271921634674, -0.25027644634246826, -0.444231241941452, 0.0693979561328888, 0.11737921833992004, -0.09710472822189331, 0.44784486293792725, -0.07648053765296936, -0.15122240781784058, -0.3198384642601013, 0.4637076258659363, 0.08205762505531311, -0.1800636649131775, 0.02706895023584366, -0.05993402376770973, -0.22194306552410126, 0.03532968834042549, 0.08754847943782806, 0.1173076331615448, 0.052503976970911026, 0.2522745132446289, -0.004700496792793274, -0.1229933351278305, 0.6923550367355347, -0.25362756848335266, -0.39205774664878845, 0.015155203640460968, 0.22806788980960846, 0.039252374321222305, -0.15069225430488586, -0.3789091408252716, 0.07279044389724731, 0.3544303774833679, 0.18795061111450195, -0.25323545932769775, 0.14158549904823303, -0.258924275636673, -0.06404466927051544, 0.05555666238069534, 0.2551468014717102, -0.069297194480896, -0.2830333709716797, 0.32673144340515137, -0.05671534687280655 ]
https://github.com/huggingface/datasets/issues/5987
Can you explain your use case for `max_shard_size`? On some systems, there is a limit to the size of a memory-mapped file, so we could consider exposing this parameter in `load_dataset`.
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare
### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1
31
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare ### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1 Can you explain your use case for `max_shard_size`? On some systems, there is a limit to the size of a memory-mapped file, so we could consider exposing this parameter in `load_dataset`.
[ -0.3037675619125366, -0.7298216223716736, -0.06928074359893799, 0.5111607909202576, 0.1843271255493164, -0.10994713008403778, 0.309076189994812, 0.018675237894058228, 0.10166899114847183, 0.26645544171333313, 0.028241507709026337, -0.14632511138916016, -0.0025963541120290756, 0.17893892526626587, 0.057092972099781036, -0.2780414819717407, -0.060062751173973083, -0.06695842742919922, -0.1595606803894043, 0.2683841586112976, -0.20223455131053925, 0.08674672991037369, -0.15522953867912292, -0.39063018560409546, -0.26022154092788696, 0.36226344108581543, -0.2618880867958069, 0.24805396795272827, -0.4302625358104706, -0.11502331495285034, 0.422432541847229, 0.016470275819301605, 0.12431411445140839, 0.29284605383872986, -0.0001154802885139361, 0.04472464323043823, 0.5764064192771912, -0.20890122652053833, -0.14684677124023438, -0.2601390480995178, -0.5297379493713379, -0.19587881863117218, -0.38734757900238037, -0.07787785679101944, 0.1655694544315338, 0.22522377967834473, -0.16950911283493042, -0.06170536205172539, 0.13884660601615906, 0.25192970037460327, 0.1932036131620407, 0.15629197657108307, 0.1994335800409317, -0.27533671259880066, 0.4266880750656128, 0.27399957180023193, -0.13451461493968964, 0.27071085572242737, 0.24913722276687622, 0.31926700472831726, -0.14891263842582703, -0.21613067388534546, 0.030726999044418335, -0.17256906628608704, 0.39436355233192444, -0.09073618054389954, -0.020497679710388184, -0.05038335174322128, 0.14071610569953918, 0.2775048613548279, 0.4168960452079773, -0.17273053526878357, -0.13898111879825592, -0.17238686978816986, -0.17846964299678802, -0.3842933773994446, 0.21206462383270264, 0.1309366524219513, -0.10563042759895325, 0.24660593271255493, -0.48011335730552673, -0.3193550109863281, -0.08492476493120193, -0.05431998148560524, -0.03822919726371765, -0.21329829096794128, -0.33666425943374634, 0.1778559684753418, 0.17263677716255188, -0.32833874225616455, -0.17826639115810394, -0.023767752572894096, -0.06322689354419708, -0.0032378844916820526, -0.5578321218490601, -0.10186299681663513, -0.04254164919257164, 0.36817339062690735, 0.6974232196807861, 0.33042019605636597, 0.04940257593989372, 0.07651722431182861, 0.2695399224758148, 0.25464168190956116, 0.16510528326034546, 0.3033890128135681, 0.011189911514520645, -0.1260441094636917, -0.010770311579108238, 0.23967880010604858, 0.011032775044441223, -0.05777544528245926, 0.19893036782741547, -0.4074176251888275, -0.20083361864089966, -0.2263568937778473, 0.20491257309913635, -0.1878439337015152, 0.25406432151794434, -0.10189343243837357, 0.3904273211956024, 0.03443954139947891, 0.05078795924782753, 0.47865667939186096, 0.21433287858963013, -0.21962912380695343, -0.28527122735977173, 0.09329687058925629, 0.02579396218061447, -0.4012407660484314, -0.18153728544712067, -0.04788919538259506, -0.17684823274612427, 0.05335678160190582, 0.24264848232269287, -0.19100432097911835, 0.12123576551675797, 0.12389655411243439, 0.5075117349624634, -0.056351758539676666, -0.19612723588943481, -0.26506394147872925, 0.026522044092416763, 0.4088163375854492, -0.14236992597579956, -0.326932430267334, -0.18210303783416748, 0.23701432347297668, -0.1023767739534378, 0.27469930052757263, -0.41961073875427246, -0.4372299313545227, 0.04626128822565079, 0.12884196639060974, -0.14093869924545288, 0.24924425780773163, -0.7396460175514221, 0.09248368442058563, 0.19320809841156006, -0.10477886348962784, -0.0001630745828151703, -0.11439340561628342, -0.4180169105529785, -0.45534515380859375, 0.36610448360443115, 0.2839338183403015, 0.019352741539478302, 0.053522057831287384, -0.08474729210138321, -0.2166394740343094, 0.03699292987585068, 0.23332378268241882, -0.195143461227417, -0.26902008056640625, -0.38670259714126587, 0.1488744020462036, 0.4029998779296875, -0.013365589082241058, -0.6267589926719666, 0.5122436285018921, -0.011296823620796204, 0.059810005128383636, 0.4250621795654297, -0.1472066342830658, 0.23599891364574432, -0.12036100029945374, -0.07595765590667725, 0.3869323432445526, 0.015949157997965813, -0.1823945939540863, -0.44785434007644653, -0.30563661456108093, -0.15672516822814941, 0.010700315237045288, -0.06916424632072449, 0.29933789372444153, 0.24482080340385437, 0.05014624446630478, 0.06952394545078278, 0.1795603483915329, 0.2525331974029541, 0.11659380048513412, -0.052189551293849945, -0.11055894196033478, 0.03874234855175018, -0.21051618456840515, -0.4932747781276703, 0.40316152572631836, -0.3264390528202057, -0.16920949518680573, 0.024540867656469345, -0.27021393179893494, -0.29581379890441895, 0.05336689203977585, 0.2187180370092392, -0.11835482716560364, -0.0016020871698856354, -0.012294460088014603, 0.2528442442417145, -0.028266508132219315, -0.03897776082158089, 0.023591885343194008, -0.47683942317962646, 0.1322544813156128, -0.27886104583740234, 0.11545582860708237, -0.04095593839883804, -0.04171048849821091, 0.05015222728252411, -0.07811146974563599, 0.051224980503320694, -0.09397471696138382, -0.0048079416155815125, 0.39588814973831177, 0.030704621225595474, 0.18167932331562042, -0.22169101238250732, 0.09601034224033356, 0.07602442055940628, 0.0033258870244026184, 0.14010849595069885, -0.19368059933185577, 0.009662620723247528, -0.20040830969810486, -0.13485273718833923, 0.2040148377418518, -0.05971862003207207, 0.11961761862039566, 0.23343314230442047, -0.11266839504241943, -0.15656158328056335, -0.15288463234901428, 0.042506441473960876, -0.3048335611820221, 0.09183105826377869, 0.03783996030688286, 0.3584655225276947, 0.11637767404317856, 0.038450002670288086, -0.21718819439411163, 0.4851667881011963, -0.041830919682979584, -0.13228590786457062, 0.4364604949951172, 0.16594545543193817, -0.12499523162841797, 0.09102747589349747, 0.3536524176597595, 0.5531808733940125, 0.2389077991247177, 0.2576364278793335, -0.004801388829946518, 0.12734076380729675, -0.0979839563369751, 0.08541656285524368, -0.010281797498464584, 0.02711346372961998, 0.159701868891716, 0.08219251036643982, -0.03218548744916916, -0.0489230714738369, -0.10229252278804779, -0.013506494462490082, 0.002835415303707123, -0.3013255000114441, -0.15247975289821625, -0.08639760315418243, -0.013204887509346008, -0.2399241328239441, 0.23781058192253113, -0.3801010549068451, -0.04556741565465927, -0.3215102255344391, 0.09259013831615448, 0.15557418763637543, -0.13685640692710876, 0.007208548486232758, 0.3326510190963745, -0.008752934634685516, 0.1949359029531479, -0.35858970880508423, 0.3413219153881073, 0.03041190654039383, 0.0432276651263237, 0.37482646107673645, -0.19963431358337402, 0.18893463909626007, -0.027381237596273422, 0.08921827375888824, -0.005884228274226189, -0.1484338641166687, 0.12231924384832382, -0.22573021054267883, 0.3358689844608307, 0.1484983116388321, -0.07545409351587296, 0.004289962351322174, 0.3460904061794281, 0.18947480618953705, -0.1621537208557129, 0.02582719177007675, 0.10348737239837646, 0.2684828042984009, 0.18490886688232422, -0.3420790135860443, 0.06095410883426666, 0.023364046588540077, -0.4332455098628998, 0.39504316449165344, 0.01467210054397583, 0.06615015864372253, -0.002748299390077591, 0.21968036890029907, 0.11635731905698776, -0.1755659282207489, 0.18934950232505798, -0.09729501605033875, -0.7795078754425049, 0.20682492852210999, -0.3149031102657318, -0.4584672152996063, -0.053647469729185104, 0.18729647994041443, 0.3284417986869812, 0.3902865946292877, -0.5711513161659241, 0.247228741645813, -0.28223347663879395, -0.06560400128364563, -0.18627507984638214, 0.015799270942807198, 0.1321704238653183, -0.2977710962295532, 0.0956047773361206, -0.14338833093643188, -0.04018884897232056, -0.11153698712587357, -0.2039867788553238, 0.18729083240032196, 0.5222948789596558, 0.2759225070476532, 0.33816251158714294, 0.8455045819282532, 0.18563289940357208, 0.13750316202640533, 0.32055044174194336, 0.06086672842502594, 0.305794358253479, -0.37473469972610474, -0.15419147908687592, 0.15735726058483124, -0.12627866864204407, 0.07066493481397629, 0.06468792259693146, 0.129934623837471, 0.32512137293815613, -0.04193331301212311, -0.283703088760376, 0.17365632951259613, -0.16783106327056885, 0.21065177023410797, 0.01617247983813286, 0.17174485325813293, -0.1558489352464676, -0.06409860402345657, 0.1785176694393158, 0.02799031510949135, -0.07298291474580765, 0.36631906032562256, 0.28244078159332275, 0.23133599758148193, -0.1453647017478943, 0.22200316190719604, -0.2233184278011322, 0.28977081179618835, -0.009511608630418777, 0.12498890608549118, -0.09910853207111359, 0.10188531875610352, 0.03812944144010544, 0.1135384812951088, 0.7157076001167297, -0.03480400890111923, 0.1274196356534958, 0.23415131866931915, -0.23238730430603027, -0.06082239747047424, 0.1444808393716812, 0.19630487263202667, 0.15521660447120667, 0.07814513146877289, 0.10987506806850433, -0.1801566779613495, -0.09865359961986542, -0.012465069070458412, 0.2644854784011841, -0.09572013467550278, -0.5172476768493652, -0.21988505125045776, 0.045084401965141296, -0.29422712326049805, -0.10191034525632858, 0.21582560241222382, 0.2225465029478073, -0.4526095390319824, -0.028133589774370193, -0.27273130416870117, -0.023479975759983063, 0.01955685392022133, -0.1303555965423584, 0.13553744554519653, -0.1517910659313202, 0.15006323158740997, -0.12605059146881104, -0.1178477555513382, 0.36817750334739685, 0.5415819883346558, 0.07627928256988525, -0.08728598058223724, -0.12060116976499557, -0.06996290385723114, 0.3144250512123108, 0.1373126059770584, -0.24756081402301788, 0.0780712142586708, -0.025789732113480568, 0.05408797413110733, -0.36921581625938416, -0.17900559306144714, 0.31257256865501404, -0.1937730610370636, -0.3351707458496094, -0.4346786439418793, 0.621757984161377, -0.059025391936302185, 0.19137582182884216, 0.30934715270996094, 0.40434029698371887, -0.23538847267627716, 0.23396378755569458, -0.1513659954071045, 0.9980396032333374, -0.010022806003689766, 0.1201239824295044, -0.06503956019878387, 0.2072415053844452, 0.08602003753185272, -0.07900431752204895, -0.05048441141843796, -0.13101167976856232, -0.1648644059896469, -0.0044469162821769714, -0.2768857479095459, 0.4923437535762787, 0.24333441257476807, -0.2947203516960144, 0.011902373284101486, 0.10215315222740173, 0.08974657952785492, -0.019251253455877304, 0.31770122051239014, -0.31851765513420105, -0.13619792461395264, -0.15929196774959564, 0.10304606705904007, -0.04658754542469978, -0.2225980907678604, -0.06049936264753342, 0.016521476209163666, 0.028808221220970154, -0.15124371647834778, -0.24633708596229553, -0.25871729850769043, -0.07210290431976318, 0.0279105082154274, -0.1422196328639984, -0.39050620794296265, 0.5492726564407349, 0.2552250325679779, -0.2300955206155777, 0.2386251538991928, -0.3772285580635071, 0.06674713641405106, -0.09377814829349518, 0.02239377796649933, 0.01234324648976326, -0.06801339238882065, 0.20008616149425507, -0.051594220101833344, -0.2598899006843567, 0.10069453716278076, 0.11119106411933899, -0.2792394161224365, -0.1910567283630371, -0.03963040933012962, 0.17553579807281494, -0.37198179960250854, -0.3992612361907959, -0.24089108407497406, 0.11609461903572083, -0.21940088272094727, 0.10308435559272766, 0.2971832752227783, 0.0719449371099472, -0.05594894289970398, -0.012340061366558075, -0.17721380293369293, -0.055961716920137405, 0.4799336791038513, -0.08097996562719345, -0.19207075238227844, 0.01696973294019699, 0.0995931401848793, -0.02214210107922554, -0.04069921374320984, 0.18941617012023926, -0.17268547415733337, -0.3785794973373413, 0.07503822445869446, -0.1362244039773941, 0.3648437559604645, -0.4129067361354828, 0.10342283546924591, 0.15373416244983673, -0.22307628393173218, 0.036128900945186615, -0.348132848739624, -0.4222946763038635, 0.11330269277095795, -0.21959251165390015, 0.17288845777511597, 0.09521202743053436, -0.3092481791973114, 0.09687303751707077, 0.3793655037879944, -0.2789487838745117, 0.17797043919563293, 0.16649305820465088, -0.12887221574783325, 0.31274574995040894, 0.009940819814801216, 0.12251174449920654, -0.06313332915306091, -0.03300704061985016, 0.22940866649150848, -0.21178632974624634, -0.15718437731266022, -0.07042425125837326, 0.14541685581207275, 0.0848681703209877, 0.05271740257740021, -0.37226763367652893, -0.31188443303108215, -0.2198243886232376, -0.010670358315110207, 0.27591294050216675, 0.16716422140598297, -0.014075972139835358, 0.2187291830778122, 0.15539461374282837, 0.24055615067481995, -0.2946128845214844, 0.0746082291007042, 0.28877729177474976, 0.32654979825019836, 0.050639182329177856, 0.1852191686630249, -0.05304184556007385, -0.05688270926475525, -0.17951974272727966, 0.10555829107761383, 0.07662111520767212, -0.07114629447460175, 0.555084228515625, -0.010892705991864204, 0.23770713806152344, -0.2335410863161087, 0.3877565264701843, 0.26904094219207764, -0.26183485984802246, 0.19807186722755432, 0.1309419423341751, 0.14029492437839508, 0.12734505534172058, 0.18156209588050842, 0.46855515241622925, 0.15358014404773712, -0.09004153311252594, 0.13045179843902588, 0.2278723120689392, 0.09183280169963837, -0.10617955029010773, 0.14033058285713196, 0.1669808328151703, -0.2882797122001648, -0.16658633947372437, 0.3286921977996826, -0.02554141730070114, 0.24152503907680511, 0.406952828168869, 0.49584102630615234, 0.4830811023712158, 0.40739503502845764, -0.13688340783119202, 0.6442693471908569, -0.6152061223983765, 0.024366557598114014, 0.1947770118713379, -0.6776174306869507, 0.2430768460035324, 0.3716723620891571, -0.25317564606666565, 0.10485745966434479, -0.26085710525512695, 0.5904415845870972, 0.20358259975910187, -0.004713505506515503, -0.18614643812179565, -0.21037161350250244, -0.22739921510219574, -0.2485530525445938, 0.27400219440460205, -0.1616508811712265, -0.1857537478208542, 0.14209578931331635, -0.03668328374624252, -0.036521732807159424, 0.46708470582962036, -0.11806119978427887, 0.010534930974245071, -0.026386698707938194, 0.20844580233097076, 0.2576836347579956, -0.12248066067695618, -0.34950175881385803, 0.2098887413740158, 0.24602390825748444, 0.10740640014410019, 0.32402005791664124, 0.1186533123254776, 0.4640929698944092, 0.1352325677871704, 0.15636153519153595, -0.11260440945625305, 0.13007915019989014, -0.04405808821320534, -0.3556506037712097, 0.38544464111328125, 0.13836580514907837, 0.2417750358581543, 0.49530598521232605, 0.14504492282867432, -0.1509450525045395, -0.20810829102993011, 0.23933786153793335, 0.23928675055503845, -0.5483613014221191, 0.22805555164813995, -0.23617863655090332, -0.2653457522392273, 0.02869453653693199, 0.2583156228065491, -0.46557652950286865, -0.10290299355983734, 0.49920305609703064, -0.029744239524006844, -0.021846938878297806, -0.2845516800880432, 0.03638928383588791, 0.10846269875764847, 0.3653968274593353, 0.2970554828643799, 0.03168162330985069, -0.24985896050930023, -0.1288072168827057, -0.46971970796585083, 0.08217144012451172, 0.10124377906322479, 0.17497074604034424, 0.03414716199040413, 0.17425400018692017, -0.07547946274280548, -0.1084602102637291, -0.07825039327144623, -0.24503256380558014, 0.09892193228006363, 0.09081636369228363, 0.14856654405593872, -0.33780285716056824, -0.21409642696380615, -0.20209647715091705, -0.013827502727508545, -0.21286432445049286, 0.3417029082775116, -0.25278061628341675, -0.06987278908491135, -0.4279560148715973, 0.2534940838813782, 0.23058287799358368, -0.0023285322822630405, 0.4534631073474884, 0.09327900409698486, 0.319234162569046, -0.023303963243961334, -0.16586488485336304, -0.43221238255500793, 0.1131325364112854, 0.09667779505252838, 0.12440793961286545, -0.08852598071098328, 0.14855235815048218, -0.2994629740715027, -0.3017139434814453, -0.20100200176239014, 0.2056165635585785, -0.20484431087970734, -0.29173335433006287, 0.05395081639289856, -0.09088977426290512, -0.1942155659198761, -0.03929830715060234, 0.27414175868034363, 0.3829704225063324, -0.16279704868793488, 0.07334796339273453, -0.10479015111923218, -0.08515825867652893, 0.3333044946193695, -0.2846679091453552, -0.2214859426021576, 0.04174582660198212, 0.09631061553955078, 0.019435852766036987, -0.2933328151702881, -0.8238465785980225, 0.05297897756099701, 0.30161169171333313, 0.07903742790222168, 0.09365517646074295, 0.3963223695755005, -0.08764485269784927, 0.14777731895446777, -0.03208719193935394, 0.32203570008277893, 0.012733668088912964, -0.20385953783988953, 0.05580627918243408, -0.16934379935264587 ]
https://github.com/huggingface/datasets/issues/5987
In my use case, users may choose a proper size to balance the cost and benefit of using large shard size. (On azure blob or hdfs which may automatically download the shard from background)
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare
### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1
34
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare ### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1 In my use case, users may choose a proper size to balance the cost and benefit of using large shard size. (On azure blob or hdfs which may automatically download the shard from background)
[ -0.36279332637786865, -0.6249353885650635, -0.04186156764626503, 0.4104877710342407, 0.08719819784164429, -0.13526828587055206, 0.3613433539867401, 0.0005356771871447563, 0.06673719733953476, 0.2791599631309509, -0.04848305508494377, -0.13423478603363037, 0.08890283107757568, 0.3084557354450226, 0.04632602259516716, -0.23880235850811005, -0.13023649156093597, -0.041833486407995224, -0.10687290132045746, 0.2517005205154419, -0.14901116490364075, 0.1260397732257843, -0.17558610439300537, -0.4193148612976074, -0.25966131687164307, 0.3601219058036804, -0.16235241293907166, 0.21230243146419525, -0.4938633441925049, -0.03226819634437561, 0.5251178741455078, -0.029107408598065376, 0.17333005368709564, 0.23081625998020172, -0.00011869394074892625, 0.05386117100715637, 0.5563426613807678, -0.22497740387916565, -0.08540162444114685, -0.2598312795162201, -0.3723580241203308, -0.18031123280525208, -0.30827075242996216, -0.04612793028354645, 0.16377325356006622, 0.20003846287727356, -0.20157791674137115, 0.07362700998783112, 0.06551269441843033, 0.2984471321105957, 0.1595068722963333, 0.16630473732948303, 0.25860100984573364, -0.2040501832962036, 0.3786604702472687, 0.18660353124141693, -0.2111232578754425, 0.20314142107963562, 0.29829010367393494, 0.4063515067100525, -0.2581676244735718, -0.20037433505058289, 0.028426624834537506, -0.019252976402640343, 0.37106019258499146, -0.04734862595796585, 0.10220487415790558, -0.061893217265605927, 0.15240401029586792, 0.2275635153055191, 0.3886951804161072, -0.09897913783788681, -0.10980841517448425, -0.21199876070022583, -0.16114872694015503, -0.2395576387643814, 0.3046538531780243, 0.14665234088897705, -0.10843484103679657, 0.16781334578990936, -0.44380584359169006, -0.3615742325782776, -0.1486627459526062, 0.06937893480062485, 0.01807074248790741, -0.15333740413188934, -0.2944982349872589, 0.12823614478111267, 0.11539620161056519, -0.25606346130371094, -0.016756338998675346, -0.05038806423544884, -0.1975063681602478, -0.0336657389998436, -0.7258872389793396, -0.07398249208927155, -0.14048220217227936, 0.3637641668319702, 0.7066553831100464, 0.44833093881607056, 0.14537206292152405, 0.11484536528587341, 0.17407387495040894, 0.22131027281284332, 0.10703032463788986, 0.3475821018218994, 0.06583277881145477, -0.22053879499435425, -0.009301846846938133, 0.26643335819244385, 0.1250043660402298, 0.010653555393218994, 0.29908889532089233, -0.4622850716114044, -0.2599397897720337, -0.24557742476463318, 0.27023768424987793, -0.1224089115858078, 0.15609049797058105, -0.15606391429901123, 0.41012731194496155, 0.13701695203781128, 0.1394231766462326, 0.4156845211982727, 0.20362724363803864, -0.2738044857978821, -0.3120299279689789, 0.15291254222393036, 0.036955684423446655, -0.544960618019104, -0.11526793986558914, -0.034858908504247665, -0.03710586577653885, 0.013828672468662262, 0.32549670338630676, -0.3417876958847046, 0.14012929797172546, 0.11305771768093109, 0.5565054416656494, -0.08050598949193954, -0.1931256204843521, -0.18835023045539856, 0.10202942788600922, 0.4673858880996704, -0.02634444460272789, -0.4339486062526703, -0.25122812390327454, 0.13494989275932312, -0.019707076251506805, 0.2396516352891922, -0.4569363296031952, -0.42559686303138733, -0.17793907225131989, 0.07731091231107712, -0.1571204960346222, 0.21316617727279663, -0.7801933288574219, 0.12246252596378326, 0.22411811351776123, -0.08807551860809326, -0.03968818858265877, -0.07044047117233276, -0.39283180236816406, -0.35046839714050293, 0.3908339738845825, 0.20242854952812195, -0.030338473618030548, 0.15405207872390747, -0.19616034626960754, -0.15209579467773438, 0.09049348533153534, 0.16713494062423706, -0.1490279734134674, -0.3141746520996094, -0.4153299927711487, 0.20915423333644867, 0.2709569036960602, 0.06792448461055756, -0.6676436066627502, 0.5640060305595398, -0.02566768229007721, -0.06365897506475449, 0.4053270220756531, -0.09550996124744415, 0.35662180185317993, -0.12677253782749176, -0.03523901104927063, 0.3932511508464813, 0.0016340352594852448, -0.16502204537391663, -0.4234071969985962, -0.4060610830783844, -0.323141872882843, 0.019642703235149384, -0.003777226433157921, 0.3302847445011139, 0.28129300475120544, 0.14805760979652405, 0.011249405331909657, 0.2113124579191208, 0.30618274211883545, 0.10536429286003113, -0.10261717438697815, -0.22115391492843628, 0.07207099348306656, -0.21716690063476562, -0.6982568502426147, 0.3804376423358917, -0.33113497495651245, -0.14237329363822937, 0.08052750676870346, -0.23998792469501495, -0.32006826996803284, -0.0018410533666610718, 0.1289278268814087, -0.03865746408700943, -0.018640168011188507, -0.12462373077869415, 0.2814139127731323, -0.058502644300460815, -0.010150402784347534, -0.040229231119155884, -0.5120617151260376, 0.1454954445362091, -0.20554997026920319, 0.2608260214328766, -0.050453267991542816, -0.10835111886262894, 0.15141871571540833, -0.07811528444290161, 0.08038774132728577, -0.11161978542804718, -0.03706849366426468, 0.38076162338256836, -0.05538584291934967, 0.20423555374145508, -0.27509045600891113, 0.04794187843799591, 0.1380731463432312, 0.14139024913311005, 0.08179185539484024, -0.1639573872089386, -0.031646326184272766, -0.2299501746892929, -0.04071171209216118, 0.1592966914176941, -0.16896900534629822, 0.1727190762758255, 0.12315939366817474, -0.048308271914720535, -0.14629310369491577, -0.15798024833202362, 0.12421156466007233, -0.3058725595474243, 0.15614786744117737, -0.055022887885570526, 0.3559735417366028, 0.04645756632089615, 0.05863189697265625, -0.20537060499191284, 0.46402615308761597, 0.024716511368751526, -0.05959185212850571, 0.4165840446949005, 0.19850608706474304, -0.15159191191196442, 0.20393215119838715, 0.3439105749130249, 0.5334140062332153, 0.1894790381193161, 0.18587720394134521, -0.012432786636054516, 0.09562140703201294, -0.20842866599559784, 0.02924242615699768, -0.01733344793319702, 0.08041887730360031, 0.25970715284347534, 0.19900932908058167, -0.10732904076576233, -0.24208559095859528, -0.03330846130847931, 0.1440710425376892, -0.0016365032643079758, -0.3112587034702301, -0.1884082853794098, -0.052376508712768555, 0.0700768530368805, -0.1267004758119583, 0.17882752418518066, -0.3728500008583069, -0.15954045951366425, -0.25619515776634216, 0.2150041162967682, 0.18083423376083374, -0.10965685546398163, 0.007172875106334686, 0.28737175464630127, 0.08627042919397354, 0.017051441594958305, -0.3857238292694092, 0.39219218492507935, -0.006712626200169325, -0.01157061755657196, 0.3628288209438324, -0.2198151797056198, 0.1164625808596611, 0.008574254810810089, 0.07972259819507599, -0.13461577892303467, -0.2326151579618454, 0.15737059712409973, -0.1003340631723404, 0.2737016975879669, 0.10300714522600174, -0.15737676620483398, 0.03706881403923035, 0.34094181656837463, 0.10803351551294327, -0.2020215541124344, 0.016644112765789032, 0.14678803086280823, 0.13604046404361725, 0.13173216581344604, -0.3383845090866089, 0.055582668632268906, -0.004082497209310532, -0.35480615496635437, 0.29822590947151184, 0.0559915155172348, 0.049770668148994446, -0.18984423577785492, 0.11852942407131195, 0.0353589802980423, -0.2325258105993271, 0.06035791337490082, -0.0496930293738842, -0.7956485152244568, 0.2746453881263733, -0.3263151943683624, -0.49221712350845337, 0.018902912735939026, 0.2027149796485901, 0.2927090525627136, 0.3189445734024048, -0.5230222940444946, 0.1883448362350464, -0.35997435450553894, -0.008794836699962616, -0.2385861724615097, -0.1048426553606987, 0.14648598432540894, -0.3512333035469055, 0.13900302350521088, -0.1297612488269806, 0.0730573982000351, 0.0649997740983963, -0.12769323587417603, 0.21981757879257202, 0.4680955111980438, 0.1715720146894455, 0.3542071580886841, 0.69862300157547, 0.1014481708407402, 0.04800717905163765, 0.35726627707481384, 0.019849063828587532, 0.1721167415380478, -0.33708178997039795, -0.08103812485933304, 0.24849319458007812, -0.15606456995010376, 0.0677330270409584, 0.04340515285730362, 0.09388008713722229, 0.3498639762401581, -0.004165567457675934, -0.24701283872127533, 0.20547190308570862, -0.1595558226108551, 0.07815136015415192, -0.069495290517807, 0.08272378146648407, -0.09585393965244293, 0.03035123646259308, 0.25193023681640625, -0.1267596185207367, -0.09213590621948242, 0.35417139530181885, 0.2384788990020752, 0.28676214814186096, -0.029812000691890717, 0.27440255880355835, -0.24061836302280426, 0.290065735578537, -0.04899296164512634, 0.15763860940933228, -0.08742509037256241, 0.30582714080810547, 0.08053416758775711, 0.1006971001625061, 0.627192497253418, -0.019199710339307785, 0.26368966698646545, 0.07878915965557098, -0.18324656784534454, 0.003978900611400604, 0.02857481688261032, 0.24384239315986633, 0.1711614727973938, 0.2225572168827057, 0.19294239580631256, -0.17557929456233978, -0.01367836445569992, 0.025648582726716995, 0.1614398956298828, -0.07806827127933502, -0.47163882851600647, -0.17256182432174683, -0.01028260588645935, -0.292569637298584, -0.10007670521736145, 0.27291548252105713, 0.28112509846687317, -0.42225879430770874, -0.028887905180454254, -0.3481614589691162, -0.04341200366616249, -0.01934581622481346, -0.1318715512752533, 0.09243761003017426, -0.1288686990737915, 0.2055743783712387, -0.1694883555173874, -0.12958060204982758, 0.3922457993030548, 0.549095630645752, 0.2144436538219452, -0.1997694969177246, -0.07658442854881287, -0.15455472469329834, 0.2801169455051422, 0.04102781414985657, -0.34580668807029724, 0.09633103013038635, -0.05966964736580849, 0.03190014138817787, -0.2918667197227478, -0.14767904579639435, 0.23685219883918762, -0.15607213973999023, -0.24721559882164001, -0.2667829990386963, 0.6853668689727783, -0.1823204755783081, 0.2970762550830841, 0.24057096242904663, 0.38624462485313416, -0.20132289826869965, 0.24360892176628113, -0.06137340888381004, 0.7177589535713196, -0.025463592261075974, 0.03805963695049286, -0.07124456763267517, 0.2984689772129059, 0.06601789593696594, -0.06034370884299278, 0.01715019717812538, -0.130597785115242, -0.1770191490650177, -0.03268283233046532, -0.24714376032352448, 0.4234693944454193, 0.30355769395828247, -0.24073490500450134, 0.00328880175948143, 0.12853112816810608, 0.16130754351615906, 0.0504910945892334, 0.36380213499069214, -0.3466092050075531, -0.2297629714012146, -0.12701764702796936, 0.08172214776277542, -0.14768560230731964, -0.13031619787216187, -0.013372033834457397, -0.05691773071885109, 0.05326322466135025, -0.12818710505962372, -0.2554675042629242, -0.07496131211519241, -0.09377153217792511, 0.02936561033129692, -0.1571303904056549, -0.48630082607269287, 0.6127074956893921, 0.26972058415412903, -0.23295272886753082, 0.2200900763273239, -0.38567495346069336, 0.09902341663837433, -0.09933160245418549, -0.07100246101617813, 0.027175892144441605, -0.06754431128501892, 0.11371056735515594, -0.06354894489049911, -0.2452065348625183, 0.04872129485011101, 0.12614785134792328, -0.296031653881073, -0.15977036952972412, -0.02240047976374626, 0.18100981414318085, -0.25843894481658936, -0.3791535496711731, -0.3121587038040161, 0.12079410254955292, -0.29292798042297363, 0.05771729350090027, 0.240602046251297, 0.07031186670064926, -0.04301547631621361, -0.026028310880064964, -0.1883087158203125, -0.03920885920524597, 0.48474210500717163, -0.11632408201694489, -0.16055083274841309, 0.09298451989889145, 0.13616009056568146, 0.05226990580558777, -0.013757400214672089, 0.17412328720092773, -0.3167845904827118, -0.4009374976158142, 0.13161644339561462, -0.23440735042095184, 0.3941589593887329, -0.3110290467739105, 0.20345857739448547, 0.1372995376586914, -0.1905757635831833, -0.04134245961904526, -0.4323655664920807, -0.34193354845046997, 0.010328959673643112, -0.2355026751756668, 0.07915164530277252, 0.11685138940811157, -0.1987365484237671, 0.1457570642232895, 0.3817148804664612, -0.20777979493141174, 0.1681288778781891, 0.10756749659776688, -0.15800152719020844, 0.16244833171367645, 0.01645239070057869, 0.1614326536655426, -0.06084686890244484, -0.11144480109214783, 0.22725462913513184, -0.15068012475967407, -0.1190900132060051, -0.12887492775917053, 0.1497090458869934, 0.13544148206710815, 0.15941743552684784, -0.48805832862854004, -0.32751983404159546, -0.45916563272476196, 0.003535546362400055, 0.3733461797237396, 0.1698577105998993, 0.010480765253305435, 0.1446535885334015, 0.21574456989765167, 0.17371539771556854, -0.31839293241500854, 0.020851299166679382, 0.2511656582355499, 0.3585836887359619, -0.0023948252201080322, 0.2703797519207001, -0.011554714292287827, 0.0442010760307312, -0.12716220319271088, 0.06951139867305756, 0.018144506961107254, -0.12826032936573029, 0.5173783302307129, -0.18112528324127197, 0.22226868569850922, -0.3543480336666107, 0.3373339772224426, 0.23633109033107758, -0.16987426578998566, 0.0818914845585823, -0.006635146215558052, 0.09306207299232483, 0.01637301594018936, 0.19826272130012512, 0.39191871881484985, 0.2646859288215637, -0.0631944090127945, 0.08228597790002823, 0.21586552262306213, 0.04262179136276245, -0.21715934574604034, 0.2495647668838501, 0.20727260410785675, -0.29429197311401367, -0.11550284922122955, 0.36597561836242676, -0.08157483488321304, 0.30774104595184326, 0.5387645363807678, 0.33394673466682434, 0.39329755306243896, 0.4255204498767853, -0.10134854167699814, 0.6689584851264954, -0.483730673789978, 0.07017026841640472, 0.25256016850471497, -0.6046139001846313, 0.14580965042114258, 0.35901129245758057, -0.19230520725250244, 0.05447372421622276, -0.21128377318382263, 0.5764557719230652, 0.2854715883731842, -0.011194847524166107, -0.3690985143184662, -0.21907387673854828, -0.2436288297176361, -0.16893446445465088, 0.16590413451194763, -0.1695944368839264, -0.03597542643547058, 0.16557355225086212, 0.058596327900886536, -0.0019314605742692947, 0.49501168727874756, -0.07395131140947342, -0.057654157280921936, -0.05844365432858467, 0.22011598944664001, 0.35305580496788025, -0.1930597722530365, -0.29928675293922424, 0.2533653676509857, 0.3046233654022217, 0.0736478790640831, 0.28593510389328003, 0.04168423265218735, 0.41530439257621765, 0.1586461365222931, 0.18524512648582458, -0.15331271290779114, 0.14561013877391815, -0.08065354824066162, -0.3505896329879761, 0.42646047472953796, 0.1976001262664795, 0.2212674915790558, 0.5854490399360657, 0.09975109994411469, -0.13024836778640747, -0.1683766096830368, 0.31786659359931946, 0.23741638660430908, -0.37086644768714905, 0.3804272413253784, -0.25921928882598877, -0.24045848846435547, -0.012728751637041569, 0.2226400226354599, -0.3483421206474304, -0.1835809051990509, 0.4854945242404938, -0.08113865554332733, 0.009663190692663193, -0.2786855101585388, 0.016415059566497803, 0.04199438542127609, 0.3607580065727234, 0.3019219934940338, -0.02064119279384613, -0.2708835303783417, -0.09809889644384384, -0.4422718286514282, 0.1135503351688385, 0.04983934387564659, 0.18555006384849548, 0.13660494983196259, 0.2387995719909668, -0.06372286379337311, -0.056447833776474, -0.0022324398159980774, -0.23210979998111725, 0.08426995575428009, 0.1277584582567215, 0.1115909069776535, -0.27300745248794556, -0.21575872600078583, -0.23798386752605438, -0.07149616628885269, -0.32215842604637146, 0.3688071370124817, -0.19567233324050903, -0.10346202552318573, -0.35591408610343933, 0.26224491000175476, 0.27029821276664734, -0.1483151614665985, 0.40600085258483887, 0.09942984580993652, 0.3600401282310486, -0.061898231506347656, -0.029455184936523438, -0.41824254393577576, 0.0776473805308342, -0.002717498689889908, 0.08335044980049133, -0.018199872225522995, 0.2064160704612732, -0.25667691230773926, -0.1599195897579193, -0.24052704870700836, 0.23082655668258667, -0.1916772425174713, -0.2883554995059967, -0.04716178774833679, 0.02918863296508789, -0.22799396514892578, 0.04018823429942131, 0.25687867403030396, 0.2818976640701294, -0.15227943658828735, 0.10328704118728638, -0.04715576767921448, -0.07828463613986969, 0.25925540924072266, -0.25392091274261475, -0.18536940217018127, 0.07286500930786133, 0.09743230044841766, 0.08999300748109818, -0.35059481859207153, -0.6529018878936768, 0.049696892499923706, 0.28681403398513794, -0.027153275907039642, 0.16714386641979218, 0.37720680236816406, -0.03539206087589264, 0.12514355778694153, -0.057145312428474426, 0.1783171445131302, 0.09558865427970886, -0.24210992455482483, -0.017371319234371185, -0.1581709384918213 ]
https://github.com/huggingface/datasets/issues/5987
But `load_dataset` doesn't support caching (and reading) Arrow datasets from remote storage. `load_datset_builder` + `download_and_prepare` is not equal to `load_dataset`. The latter has one more step, `builder.as_dataset`, that memory-maps Arrow files, which only works for local files.
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare
### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1
37
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare ### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1 But `load_dataset` doesn't support caching (and reading) Arrow datasets from remote storage. `load_datset_builder` + `download_and_prepare` is not equal to `load_dataset`. The latter has one more step, `builder.as_dataset`, that memory-maps Arrow files, which only works for local files.
[ -0.29973113536834717, -0.53922039270401, -0.03143972530961037, 0.4921461045742035, 0.06836811453104019, -0.1485273241996765, 0.3775423765182495, 0.06017141789197922, 0.1547858566045761, 0.19435280561447144, 0.05218140035867691, -0.0291878841817379, -0.027666974812746048, 0.11105683445930481, 0.056796252727508545, -0.27790388464927673, 0.03073575533926487, -0.02614789828658104, -0.23544560372829437, 0.07628475874662399, -0.16119515895843506, 0.0900888442993164, -0.13875050842761993, -0.3203096389770508, -0.16899436712265015, 0.28302282094955444, -0.1082661971449852, 0.22532349824905396, -0.43889302015304565, -0.18799805641174316, 0.447950154542923, -0.04521176964044571, 0.0854446142911911, 0.23340153694152832, -0.00012065313057973981, 0.12824802100658417, 0.5903948545455933, -0.16754715144634247, -0.13512861728668213, -0.21575146913528442, -0.44110727310180664, -0.20479415357112885, -0.15471668541431427, -0.03972461819648743, 0.21874304115772247, 0.026793256402015686, -0.18356280028820038, -0.19788843393325806, 0.19872720539569855, 0.2634105682373047, 0.1398421823978424, 0.2579207420349121, 0.20876257121562958, -0.16362035274505615, 0.5473006367683411, 0.22988687455654144, -0.2039652168750763, 0.28003236651420593, 0.11437192559242249, 0.28923577070236206, -0.3396817445755005, -0.03581416606903076, 0.06887587159872055, -0.026872215792536736, 0.4012163579463959, -0.051493629813194275, -0.11871430277824402, 0.02007952518761158, 0.11170937120914459, 0.1986171156167984, 0.4626038670539856, -0.20841571688652039, -0.264445960521698, -0.21340030431747437, -0.2742738127708435, -0.3544791042804718, 0.2915825843811035, 0.16888034343719482, -0.09739699214696884, 0.21522119641304016, -0.40619441866874695, -0.2443273514509201, -0.18938638269901276, 0.06995569914579391, 0.048558108508586884, -0.18140187859535217, -0.2851935625076294, 0.19574546813964844, 0.10027388483285904, -0.2938985228538513, 0.0333041213452816, 0.027417831122875214, -0.16168157756328583, 0.05073143541812897, -0.5555329918861389, 0.0014762133359909058, -0.030920755118131638, 0.3760639727115631, 0.6765164136886597, 0.4723375141620636, 0.1253378689289093, 0.157687708735466, 0.15274901688098907, 0.24750544130802155, 0.129940465092659, 0.4311214089393616, -0.002990949898958206, -0.08496704697608948, -0.1390053927898407, 0.17084357142448425, 0.015256322920322418, -0.06604400277137756, 0.1756310760974884, -0.5306065678596497, -0.1566150188446045, -0.1757810413837433, 0.14159676432609558, -0.19835463166236877, 0.3171357810497284, -0.052705034613609314, 0.41181695461273193, 0.07928463816642761, 0.062164440751075745, 0.47128570079803467, 0.19803237915039062, -0.06525805592536926, -0.342268705368042, 0.23342430591583252, 0.03950530290603638, -0.4183657765388489, -0.17610767483711243, -0.08976760506629944, -0.2029276043176651, 0.08304376155138016, 0.19049802422523499, -0.16959327459335327, 0.19251084327697754, 0.06009873002767563, 0.5454133749008179, 0.005023986101150513, -0.1326863169670105, -0.1943383514881134, 0.2239483743906021, 0.38386186957359314, -0.23578664660453796, -0.2652496099472046, -0.07806771993637085, 0.22130779922008514, -0.08183490484952927, 0.09992226958274841, -0.4360617399215698, -0.48468726873397827, -0.047577664256095886, 0.051721371710300446, -0.18511901795864105, 0.18353953957557678, -0.749133825302124, 0.017149681225419044, 0.2382979542016983, -0.17294320464134216, 0.10116779804229736, -0.08247396349906921, -0.34941166639328003, -0.43677037954330444, 0.38673079013824463, 0.32259976863861084, -0.07379481196403503, 0.07472147792577744, -0.1321045607328415, -0.09577310085296631, 0.1052856594324112, 0.2931109368801117, -0.31673991680145264, -0.3364408016204834, -0.36560308933258057, 0.1778126060962677, 0.47844821214675903, -0.09316259622573853, -0.7006282210350037, 0.5014479756355286, -0.0033796951174736023, -0.12609703838825226, 0.421368271112442, -0.18966270983219147, 0.2132359892129898, -0.0015788786113262177, -0.14504148066043854, 0.35742247104644775, 0.015517091378569603, -0.1858099102973938, -0.4319610893726349, -0.42816367745399475, -0.23615221679210663, -0.013144411146640778, -0.005771007388830185, 0.26378127932548523, 0.4080120921134949, -0.17220443487167358, 0.04510097950696945, 0.2125287652015686, 0.333695650100708, 0.19873549044132233, -0.12881237268447876, -0.21107710897922516, 0.12279964983463287, -0.14025042951107025, -0.6237327456474304, 0.41995668411254883, -0.33536797761917114, -0.24477434158325195, -0.13159310817718506, -0.14336462318897247, -0.3128286302089691, 0.14519661664962769, 0.07432791590690613, -0.02223910018801689, -0.03715489059686661, 0.015149484388530254, 0.28535783290863037, -0.024784065783023834, -0.11770414561033249, -0.0635528713464737, -0.3272269368171692, 0.10234419256448746, -0.31548985838890076, 0.14764517545700073, -0.03730464726686478, -0.09872525185346603, -0.03939896076917648, -0.0961349606513977, 0.053995680063962936, -0.11214271187782288, -0.08351123332977295, 0.37412500381469727, -0.06055314093828201, 0.33008497953414917, -0.18558263778686523, 0.018283315002918243, 0.10793802887201309, -0.12529605627059937, 0.1477556824684143, -0.18709132075309753, 0.00009725615382194519, -0.07857794314622879, -0.15682262182235718, 0.31266841292381287, -0.05466655641794205, 0.2400696724653244, 0.12246657907962799, -0.0638420507311821, -0.11326009035110474, -0.07308784127235413, 0.04264703392982483, -0.40304863452911377, 0.11395204067230225, -0.058339498937129974, 0.44476717710494995, 0.08519240468740463, -0.01773028075695038, -0.045630719512701035, 0.5462353229522705, 0.08172817528247833, -0.10246369242668152, 0.3645995557308197, 0.10184985399246216, -0.21524393558502197, 0.3191690146923065, 0.4634154438972473, 0.4290373921394348, 0.20238614082336426, 0.2581658661365509, -0.04368608444929123, 0.101220041513443, -0.1940891444683075, 0.09171117842197418, -0.1010245755314827, 0.08519011735916138, 0.22401796281337738, 0.11794131994247437, -0.10183204710483551, -0.0946291834115982, -0.05405193567276001, -0.011605169624090195, -0.011502809822559357, -0.2793653607368469, -0.06948931515216827, -0.163909912109375, 0.02774319052696228, -0.3037245273590088, 0.15813620388507843, -0.36241868138313293, -0.0906509980559349, -0.3103078603744507, 0.010297603905200958, 0.0028895437717437744, -0.060198329389095306, -0.19916042685508728, 0.22553420066833496, 0.06874494254589081, -0.04440730810165405, -0.3819342255592346, 0.18878549337387085, 0.019069017842411995, -0.060279253870248795, 0.32802170515060425, -0.12984229624271393, 0.10858634859323502, -0.006848018616437912, 0.13725785911083221, -0.15763357281684875, -0.051056720316410065, 0.156344935297966, -0.07278063893318176, 0.23089496791362762, 0.10435815900564194, -0.0625009685754776, -0.06244126707315445, 0.2804311513900757, 0.23719850182533264, -0.27950412034988403, -0.09618499130010605, 0.18504004180431366, 0.20549677312374115, 0.15284158289432526, -0.2785969376564026, 0.0359497107565403, -0.05268748849630356, -0.47780102491378784, 0.432049036026001, 0.15059137344360352, 0.08772477507591248, 0.0033546872437000275, 0.2810216546058655, 0.1159878522157669, -0.29491937160491943, 0.16343733668327332, -0.04867834597826004, -0.7478062510490417, 0.31062036752700806, -0.3143085837364197, -0.4510190188884735, -0.11687994003295898, 0.09411165118217468, 0.3713376522064209, 0.4653179943561554, -0.503116250038147, 0.27625060081481934, -0.378774493932724, 0.028311364352703094, -0.118049755692482, -0.0012347623705863953, 0.304218053817749, -0.1620260775089264, 0.06868536025285721, -0.17724473774433136, 0.037769243121147156, 0.07292959094047546, -0.2077566683292389, 0.11446541547775269, 0.5175451040267944, 0.33426398038864136, 0.2552598714828491, 1.0550893545150757, 0.1511000394821167, 0.13492237031459808, 0.46153590083122253, -0.02694534696638584, 0.3378092646598816, -0.39711993932724, -0.16495127975940704, 0.13172732293605804, -0.17341898381710052, 0.042528338730335236, -0.010942630469799042, 0.12785622477531433, 0.1623489409685135, -0.05592868849635124, -0.2988889217376709, 0.11813975125551224, -0.1884879171848297, 0.20678119361400604, -0.2059023529291153, 0.0700017511844635, -0.09910907596349716, -0.04607481509447098, 0.037955865263938904, -0.06409624218940735, 0.011098694056272507, 0.19855570793151855, 0.18999218940734863, 0.30238765478134155, -0.13213369250297546, 0.24754460155963898, -0.20595905184745789, 0.28317171335220337, 0.05450074374675751, 0.18307720124721527, -0.04546302929520607, -0.05573577061295509, 0.023867441341280937, 0.039918117225170135, 0.5342407822608948, -0.007632607594132423, 0.17106017470359802, 0.045694999396800995, -0.019252143800258636, -0.2970532178878784, 0.12869657576084137, 0.26513415575027466, 0.1268889605998993, -0.12327969074249268, 0.16108544170856476, -0.21015480160713196, -0.12079428881406784, -0.12395770102739334, 0.25113359093666077, -0.06583735346794128, -0.358672559261322, -0.25715598464012146, 0.1913895606994629, -0.35718971490859985, -0.1198582798242569, 0.19257940351963043, 0.12029402703046799, -0.33630865812301636, 0.040581271052360535, -0.30134543776512146, -0.03748971223831177, -0.1840030699968338, -0.1446211040019989, 0.311289519071579, -0.24453705549240112, 0.07083910703659058, -0.022320028394460678, 0.05055103823542595, 0.43172937631607056, 0.7621840834617615, 0.1351894587278366, -0.14792977273464203, -0.11691160500049591, -0.07091935724020004, 0.21365998685359955, 0.22905924916267395, -0.2683474123477936, 0.13584370911121368, 0.10729283094406128, 0.03854905068874359, -0.2526777982711792, -0.11605048179626465, 0.12780877947807312, -0.27521851658821106, -0.11086598038673401, -0.32573461532592773, 0.7016735672950745, -0.1208222508430481, 0.17610988020896912, 0.4007487893104553, 0.5362425446510315, -0.13236474990844727, 0.3922082781791687, -0.012374110519886017, 1.0244818925857544, 0.10856672376394272, 0.2632550597190857, 0.04795774444937706, 0.13115748763084412, 0.1697794497013092, 0.03101789951324463, -0.01585898920893669, -0.14322297275066376, 0.038362130522727966, -0.03978826105594635, -0.35206589102745056, 0.26884424686431885, 0.2101481705904007, -0.1662873923778534, 0.056992292404174805, -0.0018076300621032715, 0.19344258308410645, -0.07472308725118637, 0.2611256241798401, -0.29095253348350525, -0.15604163706302643, -0.04688948392868042, 0.05204065144062042, 0.020481131970882416, -0.18294523656368256, -0.002132941037416458, -0.14897774159908295, -0.10134302079677582, -0.19392913579940796, -0.2343478500843048, -0.08569358289241791, -0.1403397172689438, 0.1268063187599182, -0.07331787049770355, -0.575921356678009, 0.408538818359375, 0.22225549817085266, -0.13398392498493195, 0.030165206640958786, -0.3867586851119995, 0.06963260471820831, 0.04919135570526123, -0.006648167967796326, -0.06014297157526016, -0.1428389847278595, 0.19962845742702484, 0.0036659762263298035, -0.19825971126556396, -0.042001672089099884, -0.016179237514734268, -0.3802073895931244, -0.13229452073574066, 0.08970293402671814, 0.10550273954868317, -0.23815849423408508, -0.2963903546333313, -0.3079086244106293, 0.020983055233955383, -0.21781937777996063, 0.06756071001291275, 0.26138395071029663, 0.1719738394021988, -0.16562706232070923, 0.030646912753582, -0.16411848366260529, -0.04644463211297989, 0.5451043844223022, -0.17093822360038757, -0.13502898812294006, 0.22091451287269592, 0.04869315028190613, -0.06275077909231186, -0.04621715098619461, 0.1388094127178192, 0.12056813389062881, -0.7278212308883667, 0.04764959216117859, -0.3048965334892273, 0.24767236411571503, -0.3305302858352661, 0.11305515468120575, 0.2905932366847992, -0.14104190468788147, -0.023534245789051056, -0.28662145137786865, -0.4785754680633545, 0.19172680377960205, -0.41794541478157043, 0.1016601175069809, 0.0058138445019721985, -0.36028218269348145, 0.11655911058187485, 0.34831565618515015, -0.22602641582489014, 0.1330414116382599, 0.140001118183136, -0.1193724274635315, 0.18847697973251343, -0.016739852726459503, 0.22412869334220886, -0.0548577718436718, -0.08771514892578125, 0.15035897493362427, -0.307071715593338, -0.09399709850549698, -0.08726882934570312, 0.1672021597623825, 0.13023418188095093, -0.0005291551351547241, -0.44274285435676575, -0.314425528049469, -0.2622016966342926, -0.08175498247146606, 0.2207144796848297, 0.07762503623962402, -0.028082210570573807, 0.13377541303634644, 0.24439597129821777, 0.1551421731710434, -0.32739952206611633, 0.06365127861499786, 0.3026886582374573, 0.2889728844165802, -0.16846324503421783, 0.20177266001701355, -0.047476932406425476, -0.06933875381946564, -0.042486049234867096, 0.11641981452703476, 0.08080299198627472, -0.09961842000484467, 0.4800572395324707, -0.12114685028791428, 0.090970978140831, -0.2670878767967224, 0.485763818025589, 0.305430144071579, -0.12643520534038544, 0.08081039786338806, 0.21946752071380615, 0.09410159289836884, 0.04287225008010864, 0.05995690077543259, 0.3591928780078888, 0.24760529398918152, -0.04406239837408066, 0.04247869923710823, 0.2892274260520935, -0.015686161816120148, 0.03170175105333328, 0.16657854616641998, 0.12031403183937073, -0.35500749945640564, -0.1268816888332367, 0.2500095069408417, 0.03410007059574127, 0.21496765315532684, 0.466383695602417, 0.5405042767524719, 0.5852709412574768, 0.43997353315353394, -0.16188563406467438, 0.5419871211051941, -0.3522041440010071, 0.04751627519726753, 0.17739230394363403, -0.6309185028076172, 0.1749425083398819, 0.21509845554828644, -0.15950283408164978, 0.1172628253698349, -0.17764951288700104, 0.7758634090423584, 0.3301054537296295, -0.09184854477643967, -0.19375479221343994, -0.24800196290016174, -0.14705178141593933, -0.2708882689476013, 0.11116739362478256, -0.25345659255981445, -0.15018700063228607, 0.12478381395339966, -0.05672844499349594, 0.026381224393844604, 0.48623278737068176, -0.007199905812740326, 0.0734303742647171, -0.08333286643028259, 0.24105021357536316, 0.35619106888771057, -0.0750679075717926, -0.33748090267181396, 0.32377126812934875, 0.27820247411727905, -0.03272223845124245, 0.23809334635734558, 0.09869151562452316, 0.46133843064308167, 0.18739144504070282, 0.08581110090017319, -0.14997626841068268, 0.2661795914173126, -0.16161569952964783, -0.3878530263900757, 0.4313777685165405, 0.18092027306556702, 0.02567114681005478, 0.531490683555603, 0.08902925252914429, -0.12465547025203705, -0.06151124835014343, 0.1786682903766632, 0.2783716022968292, -0.3884808123111725, 0.1848352998495102, -0.31353434920310974, -0.24330388009548187, 0.01754622347652912, 0.141232430934906, -0.542768120765686, -0.005782760679721832, 0.5448876619338989, -0.06767626851797104, 0.02864249423146248, -0.35659778118133545, 0.005015254020690918, 0.13009075820446014, 0.5973284244537354, 0.3929383456707001, 0.19889743626117706, -0.15401464700698853, -0.10547688603401184, -0.4909420609474182, 0.206790953874588, 0.08042818307876587, 0.30122095346450806, 0.04418262839317322, 0.3688817620277405, -0.024236571043729782, 0.04263713210821152, 0.017238102853298187, -0.10265457630157471, 0.11649104952812195, 0.1521124392747879, 0.08218978345394135, -0.19614627957344055, 0.0016374923288822174, -0.18566589057445526, 0.02672048658132553, -0.31022733449935913, 0.31146934628486633, -0.23219074308872223, -0.06470971554517746, -0.27943480014801025, 0.12765586376190186, 0.19718782603740692, -0.10202398151159286, 0.4719427227973938, 0.1136130541563034, 0.2651388943195343, 0.033189378678798676, -0.17410343885421753, -0.5991047024726868, -0.061932265758514404, -0.007213950157165527, 0.041492290794849396, -0.07050815224647522, 0.22226476669311523, -0.3771851658821106, -0.2565371096134186, -0.3018714487552643, 0.0912991538643837, -0.18535609543323517, -0.15896475315093994, 0.10930895060300827, 0.01179531216621399, -0.21076059341430664, -0.07497944682836533, 0.20743398368358612, 0.26587238907814026, -0.07476454973220825, 0.07804539799690247, -0.11607415229082108, -0.17940732836723328, 0.41007721424102783, -0.3568306267261505, -0.16697688400745392, 0.24704194068908691, 0.06385538727045059, 0.2693379521369934, -0.3828970491886139, -0.7617350816726685, 0.07792237401008606, 0.21038800477981567, 0.06581437587738037, 0.11410556733608246, 0.17774361371994019, -0.04197896644473076, 0.15079821646213531, -0.09504033625125885, 0.45126453042030334, 0.07624100148677826, -0.1527010053396225, -0.007340654730796814, -0.23046767711639404 ]
https://github.com/huggingface/datasets/issues/5987
Thanks. So if I want to use `IterableDataset` and control the size of single arrow file, how should I organize the data loader? Maybe `load_dataset_build` + `download_and_prepare` + `builder.as_dataset` + `dataset.to_iterable_dataset`?
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare
### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1
31
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare ### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1 Thanks. So if I want to use `IterableDataset` and control the size of single arrow file, how should I organize the data loader? Maybe `load_dataset_build` + `download_and_prepare` + `builder.as_dataset` + `dataset.to_iterable_dataset`?
[ -0.39479708671569824, -0.5203035473823547, -0.08260675519704819, 0.4154074192047119, 0.12109225243330002, -0.10688042640686035, 0.4182496666908264, 0.002110140398144722, 0.04207978397607803, 0.20657119154930115, -0.006453279405832291, -0.10002326220273972, -0.12214703857898712, 0.3273206651210785, 0.039628058671951294, -0.1393546611070633, -0.12105608731508255, 0.04566553980112076, -0.213139146566391, 0.2703459560871124, -0.1523003876209259, 0.16107533872127533, -0.12313491851091385, -0.2438337653875351, -0.05888407304883003, 0.1645764410495758, -0.10859645903110504, 0.23274663090705872, -0.3673138916492462, -0.3056923747062683, 0.5316640138626099, 0.15184317529201508, 0.09969934076070786, 0.4086660146713257, -0.00012393224460538477, 0.10797016322612762, 0.4700174033641815, -0.1775946021080017, -0.14618746936321259, -0.13184118270874023, -0.43017858266830444, -0.207770437002182, -0.11204858124256134, -0.027511127293109894, 0.2574489712715149, -0.056447915732860565, -0.16907691955566406, -0.052730098366737366, 0.2440093755722046, 0.14061903953552246, 0.1094881072640419, 0.014903642237186432, 0.21351295709609985, -0.12968751788139343, 0.28103819489479065, 0.26409390568733215, -0.1398850381374359, 0.27123743295669556, 0.3543631434440613, 0.4239327311515808, -0.3127003014087677, -0.1497136354446411, 0.20035743713378906, 0.034937139600515366, 0.33321595191955566, -0.165187805891037, -0.05223379656672478, -0.12423867732286453, 0.15258286893367767, 0.2772916555404663, 0.5342510938644409, -0.32870155572891235, -0.1726779192686081, -0.3955730199813843, -0.08215698599815369, -0.36519360542297363, 0.22978681325912476, 0.10053322464227676, -0.08675796538591385, 0.1743583232164383, -0.2891632318496704, -0.29973459243774414, -0.2750142812728882, 0.09528566151857376, 0.016678020358085632, -0.1418033391237259, -0.40049517154693604, 0.18657943606376648, 0.18504326045513153, -0.30265215039253235, 0.05263419449329376, 0.08242031931877136, -0.17599418759346008, 0.050437022000551224, -0.5989404916763306, -0.13046345114707947, -0.1314888596534729, 0.24712257087230682, 0.7651262283325195, 0.4813186526298523, 0.23259302973747253, 0.10076557844877243, 0.1610252559185028, 0.06254476308822632, 0.3037450313568115, 0.34652256965637207, -0.018207188695669174, -0.06331855803728104, -0.021796545013785362, 0.3067602515220642, 0.15718039870262146, -0.05312347412109375, 0.09440436959266663, -0.4918956160545349, -0.1601043939590454, -0.2358580231666565, 0.2682897448539734, -0.0894087627530098, 0.24562469124794006, -0.24203693866729736, 0.3622380495071411, -0.00966668501496315, 0.10163725912570953, 0.35346564650535583, 0.26693207025527954, -0.0850624218583107, -0.3975134491920471, 0.17408668994903564, 0.12313378602266312, -0.38777998089790344, -0.07092312723398209, -0.08401466906070709, -0.08450347185134888, 0.13808149099349976, 0.17534199357032776, -0.2577439844608307, 0.1048765629529953, 0.12504109740257263, 0.4110928475856781, -0.08525840193033218, -0.09775318205356598, -0.2129095196723938, 0.15155771374702454, 0.3731215000152588, 0.030880160629749298, -0.14469560980796814, -0.2625652849674225, 0.04763774573802948, -0.16514676809310913, 0.16806411743164062, -0.4682765603065491, -0.5283671617507935, -0.026054352521896362, 0.07537832856178284, -0.21807128190994263, 0.2494318187236786, -0.8264216184616089, 0.1763494610786438, 0.2775522470474243, -0.18411993980407715, 0.0183878093957901, -0.08945048600435257, -0.2211836576461792, -0.43424153327941895, 0.30054908990859985, 0.28703758120536804, -0.23567362129688263, 0.07407710701227188, -0.3384133577346802, -0.12186303734779358, 0.03015364333987236, 0.265040785074234, -0.27375346422195435, -0.051196929067373276, -0.49841931462287903, 0.25960373878479004, 0.5543164610862732, -0.0019658952951431274, -0.7622241377830505, 0.5861805081367493, 0.023439660668373108, 0.031030714511871338, 0.46224865317344666, -0.22288954257965088, 0.2890703082084656, -0.10576781630516052, -0.21484126150608063, 0.300127238035202, -0.07202041894197464, -0.2689482867717743, -0.21515625715255737, -0.3399989604949951, -0.2635870575904846, 0.01902853697538376, -0.03971526771783829, 0.2533644437789917, 0.27850285172462463, -0.12598349153995514, 0.22956377267837524, 0.13280567526817322, 0.2888683080673218, 0.22744616866111755, -0.17005091905593872, -0.22626163065433502, 0.2087208330631256, -0.22337555885314941, -0.6536928415298462, 0.23749834299087524, -0.2470347136259079, -0.4060278832912445, -0.14500544965267181, -0.19760096073150635, -0.3840005397796631, 0.11170429736375809, -0.10011550039052963, -0.04924221336841583, -0.04964279755949974, 0.050997160375118256, 0.19699060916900635, -0.190497487783432, -0.28158271312713623, 0.057253122329711914, -0.4267461895942688, 0.08558616042137146, -0.41058674454689026, 0.027317680418491364, 0.12289796024560928, -0.13101564347743988, 0.0939914733171463, -0.06803710758686066, -0.15184614062309265, -0.19551272690296173, 0.011728532612323761, 0.40925970673561096, -0.019907666370272636, 0.2145458161830902, -0.13487336039543152, 0.18885239958763123, 0.12245392054319382, 0.0403873473405838, -0.02467500977218151, -0.1297597438097, -0.04570162296295166, -0.18429195880889893, -0.10213835537433624, 0.31707653403282166, -0.35317549109458923, 0.33897140622138977, 0.2308717519044876, -0.08703677356243134, 0.018840663135051727, -0.032392531633377075, -0.08522716164588928, -0.30746889114379883, 0.08129007369279861, 0.04312968626618385, 0.5025842189788818, 0.15495315194129944, 0.0005115792155265808, -0.059068091213703156, 0.558244526386261, -0.0009869113564491272, -0.12522779405117035, 0.4531805217266083, 0.06343217939138412, -0.07757379859685898, 0.16087087988853455, 0.5119163990020752, 0.5055263638496399, 0.1405625343322754, 0.24558812379837036, -0.09521771967411041, 0.2503785490989685, -0.1705748736858368, 0.004531946033239365, 0.06499089300632477, 0.21435949206352234, 0.39960962533950806, 0.062016651034355164, -0.13927803933620453, -0.15422141551971436, -0.22000914812088013, -0.0951639711856842, 0.08654145896434784, -0.29308366775512695, -0.07054910808801651, -0.050495754927396774, 0.0531071275472641, -0.22068838775157928, 0.05351082235574722, -0.4009462594985962, -0.17772826552391052, -0.28732722997665405, 0.1585732400417328, 0.21034592390060425, -0.051364220678806305, -0.13349594175815582, 0.2976609468460083, 0.05843242257833481, 0.1627933382987976, -0.37386977672576904, 0.30302485823631287, -0.009362427517771721, -0.05045235902070999, 0.3519447445869446, -0.28757116198539734, 0.16410501301288605, 0.019543014466762543, 0.11849569529294968, -0.036047808825969696, -0.05775463581085205, 0.23693478107452393, -0.06294205784797668, 0.17259149253368378, 0.305339515209198, 0.021193383261561394, 0.019623182713985443, 0.2347428947687149, 0.0793178528547287, -0.053283028304576874, -0.029221992939710617, 0.14114722609519958, -0.017870966345071793, 0.21407142281532288, -0.13742482662200928, 0.11381649225950241, -0.11340247839689255, -0.46071499586105347, 0.5254039764404297, 0.17663276195526123, 0.15388372540473938, 0.004182439297437668, 0.16795650124549866, 0.10368908941745758, -0.08181949704885483, 0.08495762199163437, 0.011782698333263397, -0.6056602597236633, 0.2545483112335205, -0.33289140462875366, -0.3416798412799835, -0.13126206398010254, -0.011718880385160446, 0.4503055214881897, 0.40116214752197266, -0.41763266921043396, 0.26004865765571594, -0.3400922417640686, -0.12765054404735565, -0.2377547025680542, 0.019119424745440483, 0.24828939139842987, -0.15381686389446259, 0.1239318922162056, -0.08177418261766434, 0.14556652307510376, 0.13518378138542175, -0.3050837814807892, 0.09672446548938751, 0.5731116533279419, 0.2910284996032715, 0.32400599122047424, 0.9444133639335632, 0.3280099034309387, 0.18526622653007507, 0.2823186218738556, -0.07269205152988434, 0.1668815314769745, -0.30865949392318726, -0.1651797592639923, 0.07867547869682312, -0.07462003082036972, 0.17686110734939575, 0.11256316304206848, 0.13333165645599365, 0.29583218693733215, 0.1048484742641449, -0.24382607638835907, 0.12241419404745102, -0.2589343190193176, 0.19801785051822662, -0.11853419244289398, 0.11487400531768799, -0.30589818954467773, -0.14181065559387207, 0.10870612412691116, -0.06979098916053772, 0.023161791265010834, 0.23788891732692719, 0.10633312165737152, 0.19139280915260315, -0.11528537422418594, 0.1755916327238083, -0.1926383376121521, 0.26600053906440735, -0.05796448141336441, 0.18305253982543945, 0.05709835886955261, -0.04836529865860939, 0.15125802159309387, 0.00971885398030281, 0.7215015888214111, 0.10025884211063385, 0.029633838683366776, 0.08751600235700607, -0.10067283362150192, -0.24248924851417542, 0.14334595203399658, 0.17332568764686584, 0.4503978192806244, 0.1282757818698883, 0.24447521567344666, -0.3014029264450073, -0.14661437273025513, -0.01060444675385952, 0.26069706678390503, -0.16873061656951904, -0.42531901597976685, -0.17006374895572662, -0.0483773797750473, -0.3360721170902252, -0.10507828742265701, 0.20689387619495392, 0.1187145784497261, -0.3464268445968628, -0.040580205619335175, -0.4143005311489105, -0.32472851872444153, -0.11976490169763565, -0.017370842397212982, 0.20256254076957703, -0.20347635447978973, 0.05180296301841736, 0.03682726249098778, -0.021546700969338417, 0.3675343990325928, 0.6507942080497742, 0.2982279062271118, -0.22496138513088226, -0.011380858719348907, -0.18677842617034912, 0.29083701968193054, 0.16826389729976654, -0.36158180236816406, 0.12365376949310303, 0.05413985624909401, 0.007959539070725441, -0.19985193014144897, -0.15830649435520172, 0.212539404630661, -0.25001075863838196, -0.3673495948314667, -0.3876425623893738, 0.61465984582901, -0.04649671912193298, 0.0954708456993103, 0.6221742630004883, 0.46515053510665894, -0.14464536309242249, 0.2648240625858307, -0.1347474753856659, 0.9746041297912598, -0.019900158047676086, 0.15102991461753845, 0.07225209474563599, 0.22382183372974396, -0.06276202946901321, -0.04282117635011673, 0.020709283649921417, -0.24392206966876984, -0.11180107295513153, -0.03193878382444382, -0.2623363435268402, 0.406356543302536, 0.37710538506507874, -0.1477850079536438, 0.061187438666820526, 0.10544978082180023, 0.025140084326267242, -0.06570225208997726, 0.3106265962123871, -0.3942231237888336, -0.22649134695529938, -0.19104881584644318, -0.012503214180469513, -0.1179114356637001, -0.22297503054141998, 0.04164625331759453, -0.15626297891139984, 0.11299100518226624, -0.08484003692865372, -0.2013576179742813, -0.16658660769462585, -0.221616730093956, 0.02194419875741005, -0.021828051656484604, -0.6205594539642334, 0.44360774755477905, 0.3002057671546936, -0.17796924710273743, 0.006821868941187859, -0.3320513367652893, 0.13571539521217346, 0.05233510583639145, -0.01308700442314148, -0.05951156094670296, -0.015499807894229889, 0.15999829769134521, -0.03419065475463867, -0.08268866688013077, 0.10537564754486084, 0.15059597790241241, -0.3759043216705322, -0.08646239340305328, -0.015454113483428955, 0.18422123789787292, -0.3838024139404297, -0.27224475145339966, -0.25515976548194885, 0.0444006472826004, -0.1858820915222168, -0.008249485865235329, 0.28392767906188965, 0.14680422842502594, -0.0030120592564344406, -0.054783448576927185, -0.20553818345069885, -0.04209806025028229, 0.4003506302833557, -0.048781465739011765, -0.06169787049293518, 0.3194841742515564, 0.10795213282108307, 0.03765970468521118, -0.024762678891420364, 0.15028002858161926, 0.10204474627971649, -0.6188825368881226, 0.14192208647727966, -0.23682749271392822, 0.38756152987480164, -0.23736995458602905, 0.12313253432512283, 0.2428227961063385, -0.09063051640987396, -0.17358876764774323, -0.3258937895298004, -0.47071418166160583, 0.0642613023519516, -0.2007092535495758, 0.2148989588022232, -0.036597203463315964, -0.44106462597846985, 0.08468393236398697, 0.39613980054855347, -0.17460289597511292, 0.006252046674489975, 0.12735752761363983, -0.2101316750049591, 0.3213939666748047, 0.07565227150917053, 0.1663537323474884, 0.07029256224632263, -0.1095518171787262, 0.12451022118330002, -0.18679149448871613, -0.08221655339002609, -0.12078258395195007, 0.19108490645885468, 0.04977589473128319, 0.05803202837705612, -0.356304794549942, -0.2982769012451172, -0.3277284502983093, -0.13346782326698303, 0.333633691072464, -0.09961535781621933, 0.027690298855304718, 0.1524227410554886, 0.31265881657600403, 0.02813020534813404, -0.4345923662185669, 0.05107634887099266, 0.22681604325771332, 0.2763794958591461, 0.05972881242632866, 0.32490602135658264, 0.03496434539556503, -0.0627434104681015, -0.14401927590370178, 0.19153070449829102, 0.255534827709198, -0.1033935695886612, 0.38934385776519775, -0.2082630842924118, 0.1532597541809082, -0.19667096436023712, 0.47633135318756104, 0.49297428131103516, -0.2129242718219757, 0.1025552898645401, -0.022920310497283936, 0.03912932425737381, 0.039489805698394775, 0.08003528416156769, 0.3279344439506531, 0.15614601969718933, -0.1538354605436325, 0.1612076759338379, 0.17497268319129944, 0.0066573768854141235, 0.026952603831887245, 0.21167945861816406, 0.051070503890514374, -0.37658587098121643, -0.1258815973997116, 0.391509473323822, -0.09793213754892349, 0.15239286422729492, 0.4963069558143616, 0.42970824241638184, 0.4807053804397583, 0.4899212718009949, -0.2695951759815216, 0.5758867263793945, -0.2996963560581207, -0.05368601530790329, 0.2620990574359894, -0.7417905926704407, 0.017924239858984947, 0.16212275624275208, -0.16658493876457214, -0.01289353147149086, 0.02681194245815277, 0.633005678653717, 0.3622235655784607, -0.10441939532756805, -0.11789301037788391, -0.32334548234939575, -0.09860073775053024, -0.2698785364627838, 0.059983015060424805, -0.27317702770233154, -0.17966288328170776, 0.06401142477989197, -0.06916403770446777, -0.03836645185947418, 0.5280494093894958, -0.014969147741794586, 0.058118779212236404, -0.36568954586982727, 0.33478206396102905, 0.27387017011642456, -0.036128539592027664, -0.3172574043273926, 0.31116819381713867, 0.2595900297164917, 0.08185873925685883, 0.2204933762550354, 0.06950825452804565, 0.35965731739997864, 0.1460794061422348, 0.11836977303028107, -0.1056976318359375, 0.15231184661388397, -0.15505054593086243, -0.31870102882385254, 0.29315605759620667, 0.06979090720415115, 0.15182696282863617, 0.46499520540237427, 0.06161267310380936, -0.07384492456912994, -0.09735892713069916, 0.22053544223308563, 0.14796152710914612, -0.451183557510376, 0.17230568826198578, -0.2197912335395813, -0.3521157205104828, 0.03061165288090706, 0.20237356424331665, -0.43910908699035645, -0.14321677386760712, 0.6146395802497864, -0.1398993730545044, -0.01692172884941101, -0.38356783986091614, -0.013273797929286957, 0.08015762269496918, 0.3861224055290222, 0.3662400245666504, 0.1897038370370865, -0.13347060978412628, -0.10508641600608826, -0.39981016516685486, 0.13042283058166504, 0.11951930820941925, 0.1086653470993042, 0.0803695023059845, 0.35086682438850403, -0.07117004692554474, -0.04402412846684456, 0.17748621106147766, -0.227291077375412, 0.1542782485485077, 0.34890323877334595, 0.13953237235546112, -0.3245348334312439, -0.021599750965833664, -0.047640733420848846, -0.10151693224906921, -0.3178038001060486, 0.20484864711761475, -0.203535258769989, -0.11380819231271744, -0.16973482072353363, 0.09561160206794739, 0.300653338432312, -0.15632984042167664, 0.36126184463500977, 0.10051292181015015, 0.1423283964395523, -0.11558154225349426, -0.028354469686746597, -0.47727689146995544, 0.11899834126234055, -0.10184948146343231, 0.3216785788536072, 0.009697215631604195, 0.09205709397792816, -0.3923394978046417, -0.18812742829322815, -0.2737176716327667, 0.025509610772132874, -0.13954457640647888, -0.0609760656952858, 0.05560760945081711, 0.12810057401657104, -0.17673158645629883, 0.08526299148797989, 0.21805916726589203, 0.30417418479919434, -0.11143282055854797, 0.08098557591438293, -0.05617076903581619, -0.04872578755021095, 0.28147608041763306, -0.30108508467674255, -0.21150529384613037, 0.27945277094841003, 0.05503866821527481, 0.252817839384079, -0.29170283675193787, -0.6236252188682556, 0.04408140480518341, 0.37080636620521545, -0.05580902099609375, 0.059474214911460876, 0.22502002120018005, 0.0061326660215854645, 0.1459648311138153, -0.1296045482158661, 0.5035663843154907, 0.11611738801002502, -0.2791285216808319, -0.06136762350797653, -0.17410647869110107 ]
https://github.com/huggingface/datasets/issues/5987
Yes, this should work. I think we can expose `max_shard_size` in `load_dataset`, so feel free to open a PR.
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare
### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1
19
Why max_shard_size is not supported in load_dataset and passed to download_and_prepare ### Describe the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 What I can to is break the `load_dataset` and use `load_datset_builder` + `download_and_prepare` instead. ### Steps to reproduce the bug https://github.com/huggingface/datasets/blob/a8a797cc92e860c8d0df71e0aa826f4d2690713e/src/datasets/load.py#L1809 ### Expected behavior Users can define the max shard size. ### Environment info datasets==2.13.1 Yes, this should work. I think we can expose `max_shard_size` in `load_dataset`, so feel free to open a PR.
[ -0.31491613388061523, -0.7279372215270996, -0.04494934901595116, 0.4540124833583832, 0.2202315777540207, -0.13597308099269867, 0.30974528193473816, 0.026850003749132156, 0.13989853858947754, 0.24466417729854584, -0.044594064354896545, -0.1049724593758583, 0.028704285621643066, 0.3151349425315857, 0.09893305599689484, -0.3186929225921631, -0.07611975073814392, -0.07990071177482605, -0.2209300547838211, 0.23974327743053436, -0.14927799999713898, 0.15449637174606323, -0.15014740824699402, -0.3766663670539856, -0.19611209630966187, 0.34974896907806396, -0.22297760844230652, 0.23607736825942993, -0.4573141634464264, -0.1284298598766327, 0.5216808915138245, 0.07682293653488159, 0.12528404593467712, 0.28301072120666504, -0.00011506949522299692, 0.09612596035003662, 0.5956639051437378, -0.2144809365272522, -0.0666436180472374, -0.28497833013534546, -0.3889366388320923, -0.1772489845752716, -0.25546687841415405, -0.004835844039916992, 0.08935230225324631, 0.18559812009334564, -0.2604615092277527, 0.054358646273612976, 0.15051501989364624, 0.23016980290412903, 0.20368000864982605, 0.2275320589542389, 0.2706291079521179, -0.26139169931411743, 0.3992869257926941, 0.2820385694503784, -0.14494803547859192, 0.26394981145858765, 0.15779194235801697, 0.3563336133956909, -0.16710159182548523, -0.1563158631324768, 0.07888750731945038, -0.1320338249206543, 0.3805086016654968, -0.10019370913505554, -0.03162011876702309, -0.06201746687293053, 0.09252619743347168, 0.3021276891231537, 0.3441729247570038, -0.19057145714759827, -0.19593089818954468, -0.22546163201332092, -0.17832641303539276, -0.39112597703933716, 0.28572291135787964, 0.09555206447839737, -0.11741763353347778, 0.24824321269989014, -0.42340952157974243, -0.29386675357818604, -0.08573709428310394, -0.016078125685453415, 0.015884652733802795, -0.1417236179113388, -0.28836050629615784, 0.10866362601518631, 0.19124022126197815, -0.31177783012390137, -0.17911557853221893, 0.0378800630569458, -0.11325057595968246, -0.047506384551525116, -0.606747567653656, -0.09659647196531296, -0.020924486219882965, 0.38187384605407715, 0.7130289077758789, 0.4140236973762512, 0.02513449639081955, 0.14018581807613373, 0.21921777725219727, 0.2249455749988556, 0.14141450822353363, 0.3309701681137085, 0.05651015043258667, -0.1587596833705902, -0.042626745998859406, 0.3425331115722656, 0.06506627798080444, -0.00034576375037431717, 0.2724871039390564, -0.4778468906879425, -0.32241275906562805, -0.1718682050704956, 0.2514958381652832, -0.15762262046337128, 0.26885366439819336, -0.1311655342578888, 0.45745620131492615, 0.08755671977996826, 0.07799988985061646, 0.48374003171920776, 0.19392023980617523, -0.16287387907505035, -0.25805649161338806, 0.1948823779821396, -0.007913544774055481, -0.4800778925418854, -0.18840786814689636, -0.03022059239447117, -0.14778664708137512, 0.030168689787387848, 0.24520599842071533, -0.2542048692703247, 0.13146182894706726, 0.15435895323753357, 0.6003406643867493, -0.07314364612102509, -0.20466604828834534, -0.09607191383838654, 0.008116204291582108, 0.46850261092185974, -0.11871489137411118, -0.321505069732666, -0.1237451434135437, 0.1584295928478241, -0.053178541362285614, 0.19291731715202332, -0.36756354570388794, -0.415331095457077, -0.024684986099600792, 0.11753186583518982, -0.18009944260120392, 0.1825883388519287, -0.7355443835258484, 0.101291723549366, 0.20307272672653198, -0.09557632356882095, -0.02313363179564476, -0.09661416709423065, -0.36993467807769775, -0.4011532664299011, 0.45597317814826965, 0.2550015151500702, 0.053509555757045746, 0.023294225335121155, -0.10079390555620193, -0.22308529913425446, 0.08119586110115051, 0.19507667422294617, -0.1610792875289917, -0.2771604061126709, -0.3948318362236023, 0.17440401017665863, 0.36290550231933594, 0.02239134907722473, -0.6342776417732239, 0.5064722895622253, 0.007749095559120178, 0.03301716595888138, 0.4069094657897949, -0.26190370321273804, 0.19456493854522705, -0.048249781131744385, -0.07991567254066467, 0.40758150815963745, -0.023124556988477707, -0.17442592978477478, -0.48594191670417786, -0.3421715795993805, -0.16458915174007416, -0.010768719017505646, -0.017303969711065292, 0.34626418352127075, 0.2500736713409424, -0.019419003278017044, 0.07261780649423599, 0.22794172167778015, 0.2244408130645752, 0.15764854848384857, -0.043931443244218826, -0.1238485723733902, 0.021501734852790833, -0.20962509512901306, -0.4723082482814789, 0.38081103563308716, -0.32162463665008545, -0.10971059650182724, 0.015214111655950546, -0.2840280532836914, -0.3830575942993164, 0.07339954376220703, 0.16919244825839996, -0.16575846076011658, 0.025850117206573486, -0.01033041626214981, 0.2689278721809387, -0.04032908007502556, -0.026497192680835724, 0.0029629897326231003, -0.43066951632499695, 0.18059910833835602, -0.35449761152267456, 0.13972491025924683, -0.0810752734541893, -0.06617240607738495, 0.09571069478988647, -0.035073649138212204, 0.0629153698682785, -0.12787598371505737, -0.01278563030064106, 0.4046857953071594, 0.0026899240911006927, 0.17428885400295258, -0.2231835573911667, 0.007767640054225922, 0.11537276953458786, 0.04522387683391571, -0.013316746801137924, -0.2022141069173813, -0.06478996574878693, -0.13377068936824799, -0.08210371434688568, 0.27672863006591797, -0.11929836869239807, 0.14344850182533264, 0.16602452099323273, -0.04389212280511856, -0.05645695701241493, -0.12222997844219208, 0.04811251908540726, -0.30946657061576843, 0.11905061453580856, -0.021054912358522415, 0.3450274169445038, 0.03390328586101532, -0.004928469657897949, -0.17827673256397247, 0.40036389231681824, 0.030964702367782593, -0.055002838373184204, 0.4246992766857147, 0.21160972118377686, -0.1292160004377365, 0.1448461264371872, 0.3438640832901001, 0.5069720149040222, 0.23131787776947021, 0.21737709641456604, 0.01201588287949562, 0.11422117054462433, -0.16244924068450928, 0.04070146381855011, -0.029238227754831314, -0.03369694948196411, 0.2127716988325119, 0.12676842510700226, -0.10453266650438309, -0.15385451912879944, 0.00464852899312973, -0.0024557560682296753, 0.03754096478223801, -0.3440401554107666, -0.16660228371620178, -0.12993793189525604, 0.05506153404712677, -0.17296798527240753, 0.15174001455307007, -0.39062610268592834, -0.12246173620223999, -0.255816787481308, 0.1396939754486084, 0.12442396581172943, -0.030902553349733353, 0.032957300543785095, 0.241539865732193, 0.02896220237016678, 0.22561953961849213, -0.4259125590324402, 0.31182795763015747, 0.02939363569021225, 0.02040603756904602, 0.35865098237991333, -0.20469121634960175, 0.1701485514640808, -0.03475155308842659, 0.05852452665567398, 0.01775512471795082, -0.25355708599090576, 0.16108107566833496, -0.2072552740573883, 0.3165842294692993, 0.15686354041099548, -0.06491616368293762, 0.04627688229084015, 0.3233768939971924, 0.21194933354854584, -0.22732794284820557, -0.04496701434254646, 0.19251133501529694, 0.22339186072349548, 0.18807968497276306, -0.383392870426178, 0.021019412204623222, -0.0142577039077878, -0.4402233064174652, 0.36284467577934265, 0.04831230640411377, 0.017666837200522423, -0.03030255250632763, 0.2119216024875641, 0.04489823803305626, -0.2390851378440857, 0.1432512402534485, -0.1029527336359024, -0.7922938466072083, 0.24160444736480713, -0.37275004386901855, -0.4914364218711853, -0.07490335404872894, 0.1541525423526764, 0.3381649851799011, 0.29317474365234375, -0.5020034909248352, 0.19840827584266663, -0.3371128439903259, -0.0365523137152195, -0.16164495050907135, -0.025775982066988945, 0.18225513398647308, -0.2807301878929138, 0.08068572729825974, -0.15835538506507874, -0.016460757702589035, -0.00625300407409668, -0.22793962061405182, 0.1705368012189865, 0.3967323899269104, 0.30154284834861755, 0.29900652170181274, 0.7883574962615967, 0.1427941620349884, 0.10166305303573608, 0.36239975690841675, -0.016398722305893898, 0.30621567368507385, -0.3611893355846405, -0.17280469834804535, 0.14488795399665833, -0.10221289098262787, 0.1557168960571289, 0.07149000465869904, 0.13017240166664124, 0.318608820438385, -0.06425254791975021, -0.24470457434654236, 0.1553436517715454, -0.1994728296995163, 0.13916334509849548, -0.02011367306113243, 0.07021959125995636, -0.12245039641857147, -0.009710922837257385, 0.16023853421211243, -0.0013605877757072449, -0.05371439456939697, 0.36080580949783325, 0.16777046024799347, 0.25232401490211487, -0.1203717365860939, 0.24050602316856384, -0.23398104310035706, 0.3029427230358124, -0.03618752211332321, 0.17419907450675964, -0.07971042394638062, 0.06812015175819397, 0.04552527517080307, 0.14393697679042816, 0.7181299328804016, -0.026170682162046432, 0.10081979632377625, 0.16472838819026947, -0.23812054097652435, -0.1142800897359848, 0.07985258102416992, 0.23158854246139526, 0.08996045589447021, 0.1338927447795868, 0.13568519055843353, -0.2559206783771515, -0.1057475358247757, 0.020501505583524704, 0.1954205334186554, -0.11843139678239822, -0.5138055086135864, -0.2818904221057892, 0.02204236388206482, -0.30695316195487976, -0.054001081734895706, 0.22528623044490814, 0.2395869940519333, -0.4760618805885315, 0.005602650344371796, -0.2666577100753784, -0.0835675373673439, -0.025129083544015884, -0.1240263357758522, 0.17384833097457886, -0.12532731890678406, 0.12290692329406738, -0.11399215459823608, -0.07367630302906036, 0.3027062714099884, 0.5811296105384827, 0.13535922765731812, -0.17482487857341766, -0.09592508524656296, -0.09535639733076096, 0.23954889178276062, 0.1537838876247406, -0.2932444214820862, 0.1310558170080185, -0.042111366987228394, 0.09317710995674133, -0.3122265636920929, -0.14834754168987274, 0.24220125377178192, -0.20126864314079285, -0.25238171219825745, -0.3645639419555664, 0.5949624180793762, -0.14987504482269287, 0.21155358850955963, 0.2682267427444458, 0.39679548144340515, -0.2188614457845688, 0.2769339680671692, -0.15640835464000702, 0.9931721091270447, -0.013261210173368454, 0.08225665986537933, 0.03916459530591965, 0.18449470400810242, 0.1710205376148224, -0.07068780809640884, -0.015380047261714935, -0.17477256059646606, -0.20004022121429443, 0.01192166656255722, -0.24044105410575867, 0.42584359645843506, 0.17409327626228333, -0.29155364632606506, 0.009707998484373093, 0.015392094850540161, 0.0713418498635292, -0.032930996268987656, 0.3373408913612366, -0.3156440258026123, -0.13947714865207672, -0.1990104466676712, 0.10408508777618408, -0.08554892241954803, -0.1372411549091339, -0.022912010550498962, -0.05795560032129288, 0.04405435919761658, -0.2131393700838089, -0.26674288511276245, -0.15737956762313843, -0.0240391306579113, 0.05937692150473595, -0.03333127871155739, -0.4387674927711487, 0.4873514771461487, 0.2470652014017105, -0.09389731287956238, 0.18852803111076355, -0.3936864733695984, 0.08108362555503845, -0.12021251767873764, -0.03848717734217644, 0.0065233297646045685, -0.03110847808420658, 0.19458627700805664, -0.06310741603374481, -0.24434903264045715, -0.014309834688901901, 0.15312011539936066, -0.279623419046402, -0.20625421404838562, -0.02075934037566185, 0.16248075664043427, -0.3860441744327545, -0.34326133131980896, -0.28486067056655884, 0.16578887403011322, -0.2923515737056732, 0.10605490207672119, 0.2932332754135132, 0.003652963787317276, -0.10493822395801544, 0.018755365163087845, -0.15807002782821655, -0.07537522912025452, 0.549791157245636, -0.10193167626857758, -0.19818958640098572, 0.0463709756731987, 0.19767801463603973, -0.01721508428454399, -0.0573461577296257, 0.18127743899822235, -0.13929684460163116, -0.46620070934295654, 0.09136328101158142, -0.16413375735282898, 0.29198363423347473, -0.3989708125591278, 0.1416642814874649, 0.14820191264152527, -0.2302781492471695, 0.0503876656293869, -0.35355812311172485, -0.42796599864959717, 0.09894589334726334, -0.26849398016929626, 0.11898407340049744, 0.1030554324388504, -0.1929590106010437, 0.09597772359848022, 0.4334689974784851, -0.27679958939552307, 0.104647196829319, 0.1559353917837143, -0.18192875385284424, 0.3124914765357971, -0.028056997805833817, 0.1699969321489334, -0.08661799132823944, -0.02479240670800209, 0.2070089876651764, -0.22838681936264038, -0.15246525406837463, -0.12431958317756653, 0.13683155179023743, 0.05576435849070549, 0.13025839626789093, -0.35356035828590393, -0.20852909982204437, -0.30687737464904785, -0.0075879283249378204, 0.2950199246406555, 0.1527530699968338, 0.014694086275994778, 0.20148615539073944, 0.20116305351257324, 0.21387331187725067, -0.28490927815437317, 0.015630492940545082, 0.24492061138153076, 0.2978197932243347, 0.004675827920436859, 0.13002687692642212, -0.04163695499300957, -0.037860505282878876, -0.09774002432823181, 0.10196474194526672, 0.05399268865585327, -0.045478373765945435, 0.5143769383430481, -0.1155068650841713, 0.2199493646621704, -0.26180776953697205, 0.42509427666664124, 0.23688764870166779, -0.19168251752853394, 0.181815043091774, 0.08363356441259384, 0.14367318153381348, 0.016009241342544556, 0.19649265706539154, 0.47208523750305176, 0.253578782081604, -0.09748263657093048, 0.08274209499359131, 0.18825113773345947, 0.08544526994228363, -0.07527706027030945, 0.21709536015987396, 0.14511215686798096, -0.2790186107158661, -0.10572684556245804, 0.32505926489830017, -0.09636452049016953, 0.2142825871706009, 0.42904824018478394, 0.44505855441093445, 0.4663044810295105, 0.397098183631897, -0.1564449965953827, 0.6594341993331909, -0.6322693228721619, 0.034508928656578064, 0.21149694919586182, -0.7041150331497192, 0.21154236793518066, 0.2862498462200165, -0.17008844017982483, 0.0854455828666687, -0.2526140809059143, 0.6917452812194824, 0.22537054121494293, -0.054101213812828064, -0.2914423942565918, -0.16269047558307648, -0.22593820095062256, -0.24514618515968323, 0.19679217040538788, -0.1798529326915741, -0.17583201825618744, 0.08816749602556229, 0.014107970520853996, -0.03734905645251274, 0.4880540370941162, -0.08291508257389069, 0.011535163968801498, -0.1523808389902115, 0.14031626284122467, 0.2860258221626282, -0.1276453286409378, -0.3131524324417114, 0.2596476972103119, 0.29061707854270935, 0.011705522425472736, 0.3197421133518219, 0.07804327458143234, 0.4436263144016266, 0.14632616937160492, 0.14989641308784485, -0.14666412770748138, 0.17483289539813995, -0.07736267894506454, -0.3578932583332062, 0.41448473930358887, 0.20893354713916779, 0.2975321412086487, 0.5285722017288208, 0.14745090901851654, -0.16531948745250702, -0.17661461234092712, 0.26680004596710205, 0.30609697103500366, -0.49745821952819824, 0.3245323896408081, -0.25427424907684326, -0.2082143872976303, -0.01770397275686264, 0.2068212628364563, -0.4923509359359741, -0.08637086302042007, 0.455576628446579, 0.007712997496128082, -0.0011079050600528717, -0.35978859663009644, 0.03442791476845741, 0.1161355972290039, 0.40379366278648376, 0.32519254088401794, -0.012408610433340073, -0.20941340923309326, -0.0760643482208252, -0.4632644057273865, 0.17733852565288544, 0.144597128033638, 0.23344576358795166, 0.05739092454314232, 0.21185845136642456, -0.01775623857975006, -0.031029876321554184, -0.08952353894710541, -0.23187629878520966, 0.09743896126747131, 0.10260410606861115, 0.13477621972560883, -0.2954256534576416, -0.2807871103286743, -0.24679484963417053, -0.005245670676231384, -0.18072889745235443, 0.32499098777770996, -0.22354330122470856, -0.04341496527194977, -0.34442493319511414, 0.2501654326915741, 0.19860221445560455, -0.09764398634433746, 0.3926132321357727, 0.15412504971027374, 0.37631380558013916, -0.06282779574394226, -0.130757674574852, -0.44274047017097473, -0.029020238667726517, 0.011357292532920837, 0.1771046370267868, -0.11867230385541916, 0.19772541522979736, -0.2735369801521301, -0.3280326724052429, -0.29892534017562866, 0.242513045668602, -0.17171767354011536, -0.2706100344657898, 0.01089787483215332, -0.008839398622512817, -0.17441868782043457, -0.013632278889417648, 0.29219865798950195, 0.34453386068344116, -0.1716752052307129, 0.12509778141975403, -0.0599198117852211, -0.15441548824310303, 0.37381982803344727, -0.3030197024345398, -0.23623424768447876, 0.042699459940195084, 0.11229930818080902, 0.10148660838603973, -0.3811703026294708, -0.7468526363372803, 0.09690771996974945, 0.22871403396129608, 0.059093598276376724, 0.15303920209407806, 0.4038107693195343, -0.09560918807983398, 0.14941972494125366, -0.05461641401052475, 0.30531418323516846, 0.09763562679290771, -0.19616881012916565, 0.023053176701068878, -0.14144757390022278 ]
https://github.com/huggingface/datasets/issues/5985
This is a known issue: https://github.com/huggingface/datasets/issues/3847. Fixing this requires significant work - rewriting the `tokenizers` lib to make them immutable. The current solution is to pass `cache_file_name` to `map` to use that file for caching or calling a tokenizer before `map` (with the same set of parameters as the ones in the map transform)
Cannot reuse tokenizer object for dataset map
### Describe the bug Related to https://github.com/huggingface/transformers/issues/24441. Not sure if this is a tokenizer issue or caching issue, so filing in both. Passing the tokenizer to the dataset map function causes the tokenizer to be fingerprinted weirdly. After calling the tokenizer with arguments like padding and truncation the tokenizer object changes interanally, even though the hash remains the same. But dumps is able to detect that internal change which causes the tokenizer object's fingerprint to change. ### Steps to reproduce the bug ```python from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets t = AutoTokenizer.from_pretrained('bert-base-uncased') t.save_pretrained("tok1") th1 = hash(dumps(t)) text = "This is an example text" ttext = t(text, max_length=512, padding="max_length", truncation=True) t.save_pretrained("tok2") th2 = hash(dumps(t)) assert th1 == th2 # Assertion Error ``` But if you use just the hash of the object without dumps, the hashes don't change ```python from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets t = AutoTokenizer.from_pretrained('bert-base-uncased') th1 = hash(t) # Just hash no dumps text = "This is an example text" ttext = t(text, max_length=512, padding="max_length", truncation=True) th2 = hash(t) # Just hash no dumps assert th1 == th2 # This is OK ``` This causes situations such as the following 1. Create a text file like this `yes "This is an example text" | head -n 10000 > lines.txt` ```python from transformers import AutoTokenizer import datasets class TokenizeMapper(object): """Mapper for tokenizer. This is needed because the caching mechanism of HuggingFace does not work on lambdas. Each time a new lambda will be created by a new process which will lead to a different hash. This way we can have a universal mapper object in init and reuse it with the same hash for each process. """ def __init__(self, tokenizer): """Initialize the tokenizer.""" self.tokenizer = tokenizer def __call__(self, examples, **kwargs): """Run the mapper.""" texts = examples["text"] tt = self.tokenizer(texts, max_length=256, padding="max_length", truncation=True) batch_outputs = { "input_ids": tt.input_ids, "attention_mask": tt.attention_mask, } return batch_outputs t = AutoTokenizer.from_pretrained('bert-base-uncased') mapper = TokenizeMapper(t) ds = datasets.load_dataset("text", data_files="lines.txt") mds1 = ds.map( mapper, batched=False, remove_columns=["text"], ).with_format("torch") mds2 = ds.map( mapper, batched=False, remove_columns=["text"], ).with_format("torch") ``` The second call to map should reuse the cached processed dataset from mds1, but it instead it redoes the tokenization because of the behavior of dumps. ### Expected behavior We should be able to initialize a tokenizer. And reusing it should let us reuse the same map computation for the same dataset. The second call to map should reuse the cached processed dataset from mds1, but it instead it redoes the tokenization because of the behavior of dumps. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-6.1.31_1-x86_64-with-glibc2.36 - Python version: 3.9.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2
54
Cannot reuse tokenizer object for dataset map ### Describe the bug Related to https://github.com/huggingface/transformers/issues/24441. Not sure if this is a tokenizer issue or caching issue, so filing in both. Passing the tokenizer to the dataset map function causes the tokenizer to be fingerprinted weirdly. After calling the tokenizer with arguments like padding and truncation the tokenizer object changes interanally, even though the hash remains the same. But dumps is able to detect that internal change which causes the tokenizer object's fingerprint to change. ### Steps to reproduce the bug ```python from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets t = AutoTokenizer.from_pretrained('bert-base-uncased') t.save_pretrained("tok1") th1 = hash(dumps(t)) text = "This is an example text" ttext = t(text, max_length=512, padding="max_length", truncation=True) t.save_pretrained("tok2") th2 = hash(dumps(t)) assert th1 == th2 # Assertion Error ``` But if you use just the hash of the object without dumps, the hashes don't change ```python from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets t = AutoTokenizer.from_pretrained('bert-base-uncased') th1 = hash(t) # Just hash no dumps text = "This is an example text" ttext = t(text, max_length=512, padding="max_length", truncation=True) th2 = hash(t) # Just hash no dumps assert th1 == th2 # This is OK ``` This causes situations such as the following 1. Create a text file like this `yes "This is an example text" | head -n 10000 > lines.txt` ```python from transformers import AutoTokenizer import datasets class TokenizeMapper(object): """Mapper for tokenizer. This is needed because the caching mechanism of HuggingFace does not work on lambdas. Each time a new lambda will be created by a new process which will lead to a different hash. This way we can have a universal mapper object in init and reuse it with the same hash for each process. """ def __init__(self, tokenizer): """Initialize the tokenizer.""" self.tokenizer = tokenizer def __call__(self, examples, **kwargs): """Run the mapper.""" texts = examples["text"] tt = self.tokenizer(texts, max_length=256, padding="max_length", truncation=True) batch_outputs = { "input_ids": tt.input_ids, "attention_mask": tt.attention_mask, } return batch_outputs t = AutoTokenizer.from_pretrained('bert-base-uncased') mapper = TokenizeMapper(t) ds = datasets.load_dataset("text", data_files="lines.txt") mds1 = ds.map( mapper, batched=False, remove_columns=["text"], ).with_format("torch") mds2 = ds.map( mapper, batched=False, remove_columns=["text"], ).with_format("torch") ``` The second call to map should reuse the cached processed dataset from mds1, but it instead it redoes the tokenization because of the behavior of dumps. ### Expected behavior We should be able to initialize a tokenizer. And reusing it should let us reuse the same map computation for the same dataset. The second call to map should reuse the cached processed dataset from mds1, but it instead it redoes the tokenization because of the behavior of dumps. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-6.1.31_1-x86_64-with-glibc2.36 - Python version: 3.9.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2 This is a known issue: https://github.com/huggingface/datasets/issues/3847. Fixing this requires significant work - rewriting the `tokenizers` lib to make them immutable. The current solution is to pass `cache_file_name` to `map` to use that file for caching or calling a tokenizer before `map` (with the same set of parameters as the ones in the map transform)
[ 0.056222617626190186, -0.2532831132411957, 0.16724401712417603, 0.24009664356708527, 0.31940531730651855, -0.15103591978549957, 0.43399614095687866, -0.1082683876156807, -0.0809454694390297, 0.011936616152524948, -0.17815035581588745, 0.34636059403419495, -0.10086217522621155, -0.057456616312265396, 0.07201854884624481, 0.061274658888578415, 0.028258778154850006, 0.13909202814102173, -0.053588345646858215, -0.02605554461479187, 0.0588124543428421, 0.07392360270023346, -0.21467384696006775, 0.013768428936600685, -0.5248546004295349, 0.1827419102191925, -0.06622601300477982, -0.2950442135334015, -0.13928210735321045, -0.5672507882118225, 0.23230403661727905, 0.24627859890460968, 0.13447576761245728, 0.4663935899734497, -0.00012221412907820195, 0.15989577770233154, 0.021506477147340775, 0.12461080402135849, 0.1190490648150444, -0.2334246039390564, -0.057590510696172714, -0.12612375617027283, -0.09388341009616852, -0.18586194515228271, 0.06012670695781708, -0.12282264232635498, -0.009288789704442024, 0.049280762672424316, 0.70786052942276, 0.1505921632051468, 0.12822288274765015, 0.3867967128753662, 0.08516144752502441, -0.006298720836639404, -0.13893459737300873, 0.27934086322784424, 0.026571504771709442, -0.2697612941265106, -0.053137559443712234, 0.0045995935797691345, -0.2977520823478699, 0.19999712705612183, 0.035335347056388855, -0.22018343210220337, 0.4552901089191437, 0.0015296787023544312, -0.08364643156528473, -0.02515614964067936, 0.22330507636070251, 0.12458103895187378, 0.2960343360900879, -0.4018999934196472, -0.3457897901535034, -0.2580636739730835, -0.3075491786003113, 0.0686393529176712, 0.13289210200309753, -0.30182331800460815, 0.24588288366794586, 0.19567272067070007, -0.5123327374458313, -0.1421932727098465, 0.016852527856826782, 0.018181361258029938, -0.060597945004701614, 0.19874361157417297, -0.1807517111301422, 0.22322647273540497, -0.021713491529226303, -0.22361993789672852, -0.15964554250240326, -0.3305783271789551, -0.09771111607551575, 0.23013892769813538, -0.07985842227935791, -0.15027177333831787, 0.1115913987159729, -0.15481451153755188, 0.16878008842468262, 0.16108202934265137, -0.04976658523082733, 0.3228413164615631, -0.17080290615558624, -0.05597362667322159, 0.30081284046173096, 0.4374883770942688, 0.20502649247646332, 0.4491433799266815, 0.0010929196141660213, -0.00442124530673027, -0.3609374761581421, -0.25069132447242737, -0.010258745402097702, 0.09034347534179688, 0.5473470687866211, -0.19746874272823334, 0.1808757781982422, -0.10203094035387039, 0.20047436654567719, 0.09156385064125061, -0.42398717999458313, 0.0696699321269989, 0.28630051016807556, 0.24631813168525696, -0.028760641813278198, 0.17433014512062073, -0.09248074144124985, 0.033167432993650436, -0.10141735523939133, 0.057920727878808975, -0.28793737292289734, -0.09104937314987183, -0.3911207914352417, 0.09421668201684952, -0.05863242596387863, -0.039884328842163086, 0.20200076699256897, 0.33241134881973267, 0.12628774344921112, -0.1964702606201172, 0.17626765370368958, 0.07213617861270905, 0.2559354305267334, -0.13688138127326965, -0.2351861298084259, 0.3754453659057617, 0.09869275987148285, -0.007882997393608093, -0.18258777260780334, -0.043555039912462234, -0.2497425377368927, -0.2702156901359558, 0.16855673491954803, 0.09973149746656418, -0.46237507462501526, 0.11324810981750488, -0.010265853255987167, -0.03264937549829483, 0.24100764095783234, -0.005968846380710602, 0.09115421772003174, -0.18133001029491425, -0.4317280948162079, -0.16962218284606934, 0.21394038200378418, 0.30069810152053833, 0.1360846608877182, -0.4235875606536865, -0.1612887680530548, 0.07817196846008301, 0.10175850987434387, 0.2952398955821991, -0.3600962162017822, 0.29026320576667786, -0.3546449840068817, 0.4715253710746765, 0.08550575375556946, -0.4459192752838135, -0.684228777885437, -0.03429049998521805, 0.0036477893590927124, 0.39429569244384766, -0.07613661885261536, -0.1666247844696045, 0.2128201723098755, -0.18729513883590698, -0.11642933636903763, -0.031228085979819298, 0.18537825345993042, -0.027580425143241882, -0.2420947402715683, -0.17148353159427643, 0.05985764414072037, -0.3322196304798126, 0.11884591728448868, 0.15598952770233154, -0.07141947001218796, 0.3153696656227112, 0.0056485384702682495, -0.007727945223450661, 0.1747255027294159, 0.07754144817590714, 0.4062173366546631, 0.12810707092285156, 0.04617536440491676, -0.1748056858778, -0.17164888978004456, 0.2558078169822693, -0.015369541943073273, 0.03881355747580528, -0.06841827183961868, -0.35124728083610535, -0.20868273079395294, 0.020477294921875, -0.2014177441596985, -0.17622308433055878, 0.08250515162944794, 0.14015601575374603, 0.29516148567199707, 0.0932701826095581, 0.13448446989059448, -0.11120877414941788, 0.3828687071800232, 0.23827841877937317, -0.15632154047489166, 0.03373253345489502, 0.01784748211503029, -0.02155613712966442, -0.22840487957000732, 0.16883189976215363, 0.3150661587715149, 0.026250924915075302, 0.04099687188863754, 0.1342053860425949, -0.0530775748193264, 0.15415142476558685, -0.3587566316127777, 0.36726751923561096, 0.2828315794467926, -0.17853772640228271, 0.03758089989423752, 0.010440953075885773, 0.12544043362140656, -0.21124011278152466, 0.12767718732357025, 0.4793667793273926, 0.221445232629776, -0.01116829365491867, -0.09322929382324219, 0.07552386075258255, 0.03072737157344818, -0.2828812301158905, -0.23702126741409302, -0.27814820408821106, -0.22770506143569946, 0.22996783256530762, 0.24910728633403778, 0.29958581924438477, 0.16623958945274353, 0.13287948071956635, 0.4707728624343872, 0.02497931569814682, -0.07076366245746613, 0.09912781417369843, -0.42376837134361267, -0.13528376817703247, 0.014465222135186195, -0.03976915776729584, 0.21266087889671326, 0.05539146438241005, 0.08485296368598938, 0.0731392353773117, 0.07457900047302246, -0.010511692613363266, 0.10882692039012909, 0.035578370094299316, -0.2146572321653366, 0.17667655646800995, 0.09422518312931061, 0.032201774418354034, -0.16042578220367432, 0.07314734160900116, 0.06679116934537888, 0.13854128122329712, -0.20682701468467712, 0.15710285305976868, -0.42763882875442505, 0.17402678728103638, -0.26496291160583496, -0.35298633575439453, -0.19875028729438782, -0.24804508686065674, -0.07796710729598999, 0.22821083664894104, -0.08758586645126343, 0.3658953607082367, 0.017065629363059998, 0.14894817769527435, -0.01580144092440605, 0.11477729678153992, -0.2696874737739563, -0.10928763449192047, -0.3221456706523895, -0.11767061054706573, 0.2489369511604309, -0.1815102994441986, 0.1080329418182373, 0.08340025693178177, 0.03999047726392746, -0.43465399742126465, -0.48408883810043335, 0.22075863182544708, 0.012759016826748848, 0.2152499258518219, 0.17706336081027985, -0.3097807765007019, -0.20016781985759735, -0.17663323879241943, 0.25693070888519287, -0.3556770086288452, -0.18397429585456848, 0.11565813422203064, 0.024238750338554382, -0.06270890682935715, 0.07136479020118713, 0.06231766566634178, -0.0032626185566186905, 0.04529131203889847, 0.378237783908844, -0.11445282399654388, -0.08576516807079315, 0.3541880249977112, -0.07665656507015228, 0.16030484437942505, -0.4057087302207947, -0.032511547207832336, -0.28896287083625793, -0.3546183407306671, 0.31846773624420166, -0.022213617339730263, -0.22702434659004211, -0.1614179015159607, -0.21733543276786804, 0.13116303086280823, 0.10948190093040466, -0.28227511048316956, -0.3325505256652832, -0.36330363154411316, 0.10657607018947601, -0.011097733862698078, 0.19066587090492249, 0.24744968116283417, 0.10910230875015259, 0.06256207078695297, -0.04755118861794472, -0.17429515719413757, 0.1696273684501648, -0.198862224817276, 0.09564265608787537, 0.04694989323616028, 0.20313280820846558, 0.3304530382156372, 0.7922287583351135, 0.18397487699985504, -0.32070621848106384, 0.26389092206954956, -0.13839033246040344, 0.17210064828395844, -0.07724045217037201, -0.5471531748771667, -0.07629132270812988, -0.12885378301143646, -0.01256219670176506, 0.07813030481338501, -0.03124786727130413, 0.32362520694732666, 0.275826096534729, -0.07249775528907776, -0.12780040502548218, -0.5932344198226929, 0.031253017485141754, 0.004899195395410061, 0.1331396996974945, 0.23718728125095367, 0.17863911390304565, -0.4238685965538025, -0.14333148300647736, 0.1838511824607849, -0.09172827005386353, 0.1300562620162964, 0.08912976086139679, -0.6237891912460327, 0.20412468910217285, -0.41871529817581177, 0.21694770455360413, 0.0026204101741313934, 0.4350830614566803, 0.1119244247674942, -0.12403309345245361, 0.0748877301812172, 0.020691581070423126, 0.572737991809845, 0.1407051831483841, 0.1337587833404541, 0.06599646061658859, -0.6292654871940613, -0.05257963389158249, 0.04229860007762909, 0.013234473764896393, 0.2657030522823334, 0.28770512342453003, 0.7374491691589355, -0.3361368775367737, -0.08449539542198181, -0.2632158398628235, 0.06488758325576782, -0.12748385965824127, -0.03227471932768822, -0.010098107159137726, -0.13370230793952942, -0.40289878845214844, -0.039470165967941284, 0.11586661636829376, 0.22092795372009277, 0.30335646867752075, 0.10192705690860748, -0.3169245719909668, -0.305621862411499, 0.15076512098312378, 0.17065253853797913, 0.35039013624191284, -0.19825977087020874, 0.4152173399925232, 0.3804110288619995, -0.20672938227653503, 0.12497192621231079, 0.2780876159667969, 0.025052975863218307, -0.6633126139640808, -0.20349237322807312, 0.3246740698814392, 0.10638387501239777, 0.2659150958061218, -0.015943247824907303, 0.2847340404987335, -0.049431927502155304, 0.014401767402887344, -0.40832915902137756, 0.2653871178627014, 0.20414038002490997, 0.29831939935684204, -0.41862183809280396, -0.11691980063915253, 0.08562478423118591, 0.13086076080799103, -0.0812930166721344, 0.26882827281951904, 0.32293808460235596, -0.3752133548259735, 0.40341055393218994, -0.06506170332431793, 1.1430524587631226, -0.039565492421388626, 0.20891547203063965, -0.06296457350254059, 0.21795761585235596, 0.4873281717300415, 0.035957179963588715, -0.00941041111946106, -0.4600948095321655, -0.07352235913276672, 0.085391566157341, -0.08945652842521667, 0.17126256227493286, 0.10352732241153717, -0.24535350501537323, 0.04223744571208954, 0.1649475395679474, 0.5919778347015381, -0.06446284800767899, 0.37957167625427246, -0.11080407351255417, -0.09533169120550156, 0.2284213751554489, 0.09799017757177353, 0.22742867469787598, 0.33515220880508423, 0.026250172406435013, -0.024909287691116333, 0.06045927107334137, -0.4159291684627533, -0.3389911651611328, -0.14877158403396606, -0.3173597753047943, 0.25592783093452454, 0.5608839392662048, 0.07153268158435822, 0.32827651500701904, 0.15269078314304352, 0.29404592514038086, 0.33123382925987244, -0.23256872594356537, 0.22657710313796997, -0.1614563763141632, 0.12686148285865784, -0.10714362561702728, -0.16442963480949402, 0.1383206695318222, 0.2616017758846283, -0.17808052897453308, 0.0781497210264206, 0.1823642998933792, -0.19917087256908417, -0.4131086468696594, -0.10311546921730042, 0.04364681988954544, -0.5685125589370728, 0.024372536689043045, -0.08613915741443634, 0.0324271097779274, -0.20811763405799866, 0.08525652438402176, -0.013871360570192337, -0.24343281984329224, 0.1350376009941101, -0.04827756807208061, -0.10654029995203018, 0.08046822249889374, 0.5738261938095093, -0.035332292318344116, 0.0015482380986213684, 0.41276875138282776, -0.10676891356706619, -0.09080047905445099, -0.06351440399885178, 0.009418487548828125, 0.2948145866394043, -0.35366395115852356, 0.1251177191734314, -0.24944879114627838, -0.0219457745552063, -0.06579024344682693, 0.23526188731193542, 0.0899733379483223, -0.11850527673959732, -0.060848355293273926, -0.17128533124923706, -0.33344927430152893, 0.10103929042816162, 0.1293153017759323, 0.32536476850509644, 0.0745002031326294, 0.43992677330970764, -0.4637761116027832, 0.38556477427482605, -0.2583162188529968, 0.22373323142528534, -0.036742061376571655, 0.14439871907234192, -0.307373046875, -0.5573264956474304, -0.013857841491699219, -0.3652063310146332, 0.05963107943534851, 0.41526734828948975, -0.15714886784553528, -0.10524621605873108, -0.37860724329948425, 0.14182941615581512, 0.34812024235725403, -0.2225627303123474, -0.12770822644233704, 0.21754595637321472, 0.29014909267425537, -0.3400189280509949, 0.24304428696632385, 0.5508389472961426, 0.013277394697070122, 0.14480355381965637, 0.35258522629737854, -0.02808406949043274, 0.03431031107902527, -0.10086405277252197, 0.12730178236961365, 0.11102750897407532, 0.32917678356170654, 0.27998748421669006, -0.15427502989768982, 0.041262999176979065, 0.009498175233602524, 0.3180760145187378, 0.503892183303833, -0.0876045674085617, 0.18607577681541443, 0.08907760679721832, -0.18877914547920227, 0.27184486389160156, 0.09151290357112885, 0.34927281737327576, -0.23248660564422607, -0.2666473686695099, 0.4175214469432831, 0.1361144781112671, -0.08075020462274551, -0.22520089149475098, 0.26969075202941895, -0.1392277032136917, 0.006587415933609009, 0.19077593088150024, -0.03807500749826431, 0.017909884452819824, 0.07002465426921844, -0.02456827461719513, 0.6027137041091919, -0.06985267996788025, 0.2687775492668152, 0.10663018375635147, -0.20943912863731384, 0.052053432911634445, 0.5045725107192993, 0.25344765186309814, 0.3417781591415405, 0.16454868018627167, -0.23630626499652863, 0.2886882424354553, -0.40695157647132874, 0.29469865560531616, 0.25559672713279724, -0.34030675888061523, -0.1500036120414734, 0.18088333308696747, -0.030727002769708633, 0.20832011103630066, -0.2548145353794098, 0.3365156054496765, 0.15995469689369202, -0.12811881303787231, -0.13717961311340332, 0.5331591963768005, -0.34751492738723755, -0.39878666400909424, 0.029502905905246735, -0.20215749740600586, -0.1730765402317047, 0.12037988007068634, -0.0313674733042717, -0.1530393362045288, 0.1568075269460678, -0.06609940528869629, -0.29880380630493164, -0.2600526809692383, -0.24986538290977478, -0.04643761366605759, 0.2479725182056427, -0.22160808742046356, 0.16584788262844086, -0.15062130987644196, -0.05579373240470886, 0.05275588110089302, 0.2722432613372803, 0.3314628601074219, 0.10165926814079285, 0.12063728272914886, 0.24649326503276825, -0.29363885521888733, 0.10332140326499939, -0.18387624621391296, 0.3989434242248535, -0.1444491446018219, -0.04019734263420105, -0.16517850756645203, 0.011949043720960617, -0.14943760633468628, -0.4360014796257019, -0.14902599155902863, 0.10989688336849213, -0.28376504778862, 0.5075976848602295, -0.062258075922727585, -0.03727129101753235, 0.1344631165266037, 0.1797122359275818, -0.2131958156824112, -0.16676388680934906, 0.5329217910766602, 0.09376855939626694, 0.2519274353981018, -0.3705342411994934, 0.05109201371669769, 0.05692220479249954, 0.12721040844917297, 0.24462848901748657, -0.36792969703674316, -0.2813507318496704, 0.11000470817089081, -0.5641725063323975, 0.2548857033252716, -0.007548990193754435, 0.1055784821510315, 0.010202325880527496, -0.10575546324253082, -0.08971963822841644, 0.04244602471590042, -0.038979098200798035, 0.18493813276290894, -0.11717769503593445, -0.06493651866912842, 0.0031636133790016174, 0.1551988422870636, -0.14771932363510132, -0.15830838680267334, 0.19171854853630066, -0.21231552958488464, 0.3719440698623657, 0.10355956852436066, 0.03554343432188034, -0.18642771244049072, 0.032973602414131165, -0.17363348603248596, -0.24225196242332458, 0.4609389007091522, 0.3441343307495117, 0.08669836074113846, -0.017894405871629715, 0.13435208797454834, -0.2900218963623047, -0.05997759848833084, -0.16890336573123932, -0.05452641844749451, -0.12047949433326721, 0.061381980776786804, -0.23291964828968048, 0.02173466607928276, -0.40294349193573, -0.27791908383369446, 0.16907770931720734, -0.3825909495353699, -0.2789783179759979, 0.2473183572292328, -0.3383095860481262, 0.18445000052452087, -0.07841946184635162, 0.655331015586853, 0.007547784596681595, 0.42974919080734253, -0.23048605024814606, -0.3368872106075287, 0.6993773579597473, -0.7566093802452087, -0.32468247413635254, -0.0216611810028553, -0.03489920496940613, 0.09452642500400543, -0.4970178008079529, -0.647731602191925, -0.08974570035934448, 0.2756539583206177, -0.061041317880153656, -0.19154523313045502, -0.05716957524418831, 0.06338782608509064, 0.006393805146217346, -0.12586143612861633, 0.6619148254394531, 0.25768205523490906, -0.08427689969539642, 0.4240943193435669, -0.006645217537879944 ]
https://github.com/huggingface/datasets/issues/5984
For this to be possible, we would have to switch from the "Streaming" Arrow format to the "Random Access" (IPC/Feather) format, which allows reading arbitrary record batches (explained [here](https://arrow.apache.org/docs/python/ipc.html)). We could then use these batches to construct shards. @lhoestq @albertvillanova Do you think this use case is worth the switch? Also, we currently shard files, not inner row groups/chunks. Should we also support sharding row groups (e.g. if the number of input files is 1)? PS: I don't expect significant speed-up for local, uncompressed Arrow files.
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
86
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. For this to be possible, we would have to switch from the "Streaming" Arrow format to the "Random Access" (IPC/Feather) format, which allows reading arbitrary record batches (explained [here](https://arrow.apache.org/docs/python/ipc.html)). We could then use these batches to construct shards. @lhoestq @albertvillanova Do you think this use case is worth the switch? Also, we currently shard files, not inner row groups/chunks. Should we also support sharding row groups (e.g. if the number of input files is 1)? PS: I don't expect significant speed-up for local, uncompressed Arrow files.
[ -0.41809478402137756, -0.10188451409339905, -0.1456300914287567, 0.07439666986465454, -0.303873747587204, -0.1833363175392151, 0.6748954653739929, 0.1863306760787964, -0.15313678979873657, 0.19728778302669525, 0.06172633171081543, 0.15588393807411194, -0.30952349305152893, -0.26801833510398865, -0.10588079690933228, -0.31012967228889465, -0.05462805926799774, -0.01684434711933136, 0.019290730357170105, 0.05132962763309479, -0.09513579308986664, 0.15321724116802216, -0.102780282497406, -0.24563711881637573, -0.4000505805015564, 0.009230412542819977, 0.0071947574615478516, 0.16237808763980865, 0.14685499668121338, -0.26032769680023193, 0.11384227871894836, 0.41362711787223816, 0.40486860275268555, 0.3920946717262268, -0.00012678706843871623, -0.09417706727981567, 0.2051485925912857, 0.035636790096759796, -0.1409217268228531, 0.2021360993385315, 0.027537338435649872, -0.2864729166030884, 0.12099795043468475, -0.33061182498931885, 0.047409579157829285, -0.22210675477981567, 0.1936524510383606, -0.37012919783592224, 0.333795428276062, -0.05678490549325943, -0.03919314965605736, 0.13735929131507874, -0.19031134247779846, 0.24026228487491608, 0.29159384965896606, 0.018994564190506935, -0.1264267861843109, 0.15527302026748657, 0.4718416929244995, 0.02971678227186203, -0.5759143233299255, 0.3164946138858795, -0.039607707411050797, 0.2824573814868927, 0.25420019030570984, -0.07730968296527863, -0.6629828810691833, -0.4130013585090637, -0.24249985814094543, 0.19749999046325684, -0.08601611852645874, -0.20833329856395721, -0.2379780411720276, -0.6421171426773071, -0.14768697321414948, -0.1957327127456665, -0.004915593191981316, 0.10365967452526093, -0.18617096543312073, -0.10543740540742874, 0.14726456999778748, 0.0643010213971138, -0.26693516969680786, 0.18628481030464172, 0.32476523518562317, 0.17177405953407288, -0.06975826621055603, 0.1729232221841812, 0.4674033522605896, 0.09684064984321594, 0.33905142545700073, 0.129924014210701, 0.17486169934272766, 0.1833486407995224, -0.2784176170825958, -0.08155634999275208, -0.0957719087600708, -0.15199989080429077, 0.1144212931394577, 0.39883822202682495, 0.2482290416955948, 0.14535142481327057, 0.13246142864227295, 0.15227854251861572, 0.12195120751857758, -0.3173045814037323, 0.030185328796505928, -0.08471332490444183, 0.09740406274795532, -0.015833262354135513, -0.007141903042793274, 0.009127743542194366, -0.04613962769508362, -0.6856764554977417, 0.15645058453083038, 0.22717560827732086, -0.026565510779619217, 0.14803193509578705, 0.027140140533447266, -0.18157148361206055, 0.13091614842414856, -0.32722657918930054, 0.09127563238143921, 0.089689701795578, 0.17044611275196075, 0.002196023240685463, -0.25802987813949585, 0.3114488422870636, -0.21666434407234192, -0.443847119808197, 0.10042257606983185, -0.1546095311641693, -0.07115371525287628, 0.2710862457752228, 0.26790350675582886, 0.03580522537231445, -0.03129205107688904, -0.0746038407087326, 0.3320016860961914, 0.09251324832439423, 0.1486223340034485, -0.25425127148628235, 0.12529772520065308, 0.019068533554673195, -0.08453023433685303, -0.14669859409332275, 0.02198171615600586, 0.2867432236671448, -0.18513906002044678, 0.13181105256080627, -0.08925623446702957, -0.4128146171569824, -0.010885708965361118, -0.09289760887622833, 0.014152981340885162, 0.05233088508248329, -0.41500771045684814, 0.051712628453969955, 0.47732821106910706, -0.22400179505348206, 0.17268455028533936, -0.21024632453918457, -0.14679616689682007, -0.16126862168312073, -0.008558079600334167, 0.5362057685852051, 0.07554483413696289, -0.01556340605020523, -0.08236370980739594, 0.01666342467069626, 0.28553929924964905, 0.3201570510864258, -0.17813119292259216, -0.07293941080570221, -0.10637367516756058, 0.5128928422927856, 0.3232145309448242, 0.05212198197841644, -0.43191954493522644, 0.5253543853759766, -0.03772439807653427, -0.011805780231952667, 0.6261827945709229, 0.23128747940063477, 0.4878210723400116, -0.10098299384117126, 0.10943552851676941, 0.19434383511543274, -0.04500337317585945, -0.07100144773721695, -0.34943461418151855, -0.10040438920259476, -0.13008280098438263, 0.3271668553352356, 0.26308345794677734, -0.013416767120361328, 0.22699961066246033, -0.5249658823013306, 0.5289516448974609, -0.03499481827020645, 0.20477575063705444, -0.11359164118766785, -0.0638725757598877, 0.0025449786335229874, 0.3096318542957306, -0.2596912086009979, -0.3243785500526428, 0.14791730046272278, -0.07426290959119797, -0.18953031301498413, -0.2628949284553528, -0.15518386662006378, 0.26207059621810913, -0.14430946111679077, -0.28198128938674927, 0.15124905109405518, -0.19804714620113373, -0.09895877540111542, 0.061389364302158356, -0.3528025448322296, -0.36742153763771057, 0.02439497783780098, -0.614615797996521, 0.018106311559677124, -0.3752525746822357, 0.23380114138126373, 0.30590665340423584, -0.2306082844734192, -0.06198501959443092, 0.0806235522031784, -0.11969982832670212, -0.3002886474132538, 0.046068526804447174, 0.17816834151744843, 0.11900594830513, 0.198455348610878, 0.044648606330156326, 0.4549581706523895, 0.17814205586910248, 0.017727434635162354, 0.11541684716939926, 0.09652648121118546, -0.12812036275863647, -0.10649947077035904, -0.007595395669341087, 0.5443090200424194, -0.44028598070144653, 0.3806763291358948, -0.10226687043905258, -0.08165914565324783, 0.24117660522460938, 0.09633418917655945, -0.3025221824645996, 0.13811849057674408, 0.0731470137834549, -0.11191314458847046, 0.19135162234306335, -0.011456149630248547, -0.28139930963516235, 0.3309469223022461, 0.03090755082666874, -0.05830509960651398, -0.08084563165903091, 0.021167004480957985, -0.010211747139692307, 0.07542700320482254, 0.3796873986721039, 0.4992295801639557, 0.3080965280532837, 0.14157608151435852, 0.04303256422281265, -0.2878754436969757, 0.19324760138988495, -0.17912748456001282, -0.026864439249038696, 0.15056797862052917, 0.1791572868824005, 0.2381281554698944, -0.18868404626846313, 0.02239251509308815, -0.26582980155944824, -0.6430710554122925, -0.11291700601577759, 0.07499709725379944, -0.14722977578639984, 0.12261869758367538, 0.09565667808055878, 0.10513213276863098, -0.2716953158378601, 0.0003199651837348938, -0.048036664724349976, -0.13586649298667908, -0.0212811641395092, 0.5858293175697327, -0.09629303961992264, 0.06520107388496399, -0.07219946384429932, 0.4321025311946869, 0.02609030157327652, -0.15031640231609344, -0.2417653352022171, 0.06341621279716492, 0.19763138890266418, -0.09680865705013275, 0.4045330882072449, -0.05558132752776146, 0.1873968094587326, 0.06229273974895477, -0.013365723192691803, -0.31601008772850037, 0.27576497197151184, -0.04470614343881607, -0.037441954016685486, -0.12399385869503021, -0.051684342324733734, -0.054589107632637024, -0.009080864489078522, -0.3572985529899597, -0.02583800069987774, -0.04932933300733566, 0.14956048130989075, 0.14806526899337769, -0.00015899911522865295, -0.019493671134114265, 0.17387843132019043, -0.07135846465826035, -0.40749794244766235, -0.2945406436920166, 0.32470157742500305, 0.2814399302005768, 0.3620144724845886, -0.1678248792886734, 0.2828628718852997, -0.09234316647052765, 0.1482921689748764, -0.1730058193206787, 0.13215193152427673, -0.5065521001815796, 0.42614760994911194, -0.15880419313907623, -0.17407235503196716, -0.25257909297943115, -0.0926833301782608, -0.019273579120635986, 0.524115264415741, -0.17007438838481903, 0.07559236139059067, -0.15804225206375122, 0.37024441361427307, 0.00005413312464952469, -0.023694772273302078, 0.47810399532318115, 0.2825809121131897, 0.1340932548046112, 0.11514435708522797, 0.47305139899253845, 0.13352814316749573, -0.3186502754688263, -0.12095357477664948, 0.3456070125102997, 0.282713383436203, 0.25442570447921753, 1.4203405380249023, 0.18028879165649414, -0.08646833151578903, 0.25546661019325256, -0.10612166672945023, -0.33063286542892456, 0.01154443807899952, -0.4002487063407898, 0.17255331575870514, -0.2922126054763794, 0.008713357150554657, 0.14798131585121155, -0.12833485007286072, -0.15966838598251343, 0.08198290318250656, -0.176478311419487, -0.09006209671497345, -0.43860942125320435, 0.5040240287780762, -0.26410573720932007, 0.28565019369125366, -0.28358110785484314, 0.030750706791877747, -0.13038355112075806, -0.18988332152366638, -0.1003582775592804, 0.26668643951416016, 0.5507080554962158, -0.11299674212932587, -0.005791902542114258, 0.32428619265556335, -0.435980886220932, 0.24864310026168823, 0.10025298595428467, 0.2011147141456604, 0.30785080790519714, -0.38092342019081116, 0.2360135316848755, -0.013882752507925034, 0.39082926511764526, 0.2086489498615265, -0.11239877343177795, -0.10810153186321259, -0.1530207395553589, -0.09266312420368195, 0.003977753221988678, -0.02357509732246399, 0.4467816650867462, 0.0657644271850586, 0.20336776971817017, -0.23042082786560059, -0.18877306580543518, 0.1498289704322815, -0.1029963493347168, -0.15554222464561462, -0.2179730385541916, -0.22501260042190552, 0.22796104848384857, -0.3786792755126953, 0.31218433380126953, 0.16476202011108398, 0.03854796662926674, -0.20384596288204193, -0.0787259191274643, -0.25133776664733887, -0.3699685335159302, 0.24165253341197968, 0.09786844253540039, 0.008467186242341995, -0.20925700664520264, 0.11707963794469833, 0.18632157146930695, -0.02254781499505043, 0.25714433193206787, 0.15665856003761292, -0.07047000527381897, -0.23645605146884918, 0.11281120777130127, -0.02610282599925995, 0.3481347858905792, 0.3173186480998993, -0.1254802793264389, 0.10002908110618591, 0.17818602919578552, 0.34684866666793823, -0.26805293560028076, -0.04851411283016205, 0.05165231227874756, -0.005896691232919693, -0.1842900961637497, -0.41760188341140747, 0.5490477681159973, -0.12057475745677948, -0.00734981894493103, 0.5192598700523376, 0.07306178659200668, -0.057519882917404175, 0.41150712966918945, 0.1549798995256424, 1.1354053020477295, -0.18021459877490997, 0.1173853874206543, 0.0006762947887182236, 0.4563016891479492, -0.009175028651952744, -0.44143643975257874, 0.26536810398101807, -0.19897058606147766, -0.17095381021499634, -0.0822281539440155, -0.02061859518289566, 0.15322193503379822, 0.39328575134277344, 0.1261821836233139, 0.03742389753460884, 0.06616076827049255, -0.27087122201919556, -0.23233269155025482, 0.3017122745513916, -0.44420796632766724, -0.3189603090286255, 0.18935459852218628, -0.1304098665714264, 0.06318099796772003, 0.16208934783935547, 0.036118339747190475, -0.06431475281715393, 0.1606476604938507, 0.08003877848386765, -0.13364847004413605, -0.11240056902170181, -0.043721091002225876, 0.31411507725715637, 0.040121812373399734, -0.61238032579422, 0.042675502598285675, 0.17719751596450806, -0.183443084359169, -0.49852514266967773, 0.0873049944639206, -0.0959610641002655, 0.1427171677350998, -0.2020282745361328, -0.11955970525741577, -0.13840351998806, 0.2588149905204773, -0.06927580386400223, -0.15155866742134094, -0.16083240509033203, 0.28829729557037354, -0.8112599849700928, -0.1590690016746521, 0.3366856575012207, 0.20673023164272308, -0.339322954416275, -0.07356634736061096, 0.2203010469675064, -0.43681296706199646, -0.13574132323265076, -0.050669193267822266, 0.33414334058761597, -0.1723787784576416, 0.2941129803657532, -0.1946917176246643, -0.07671456038951874, -0.03670860826969147, 0.22005993127822876, 0.04668812453746796, 0.07638699561357498, 0.2948065400123596, 0.13083288073539734, -0.2357366979122162, -0.1392723023891449, 0.025819256901741028, 0.3689576983451843, -0.5975260138511658, 0.0624934583902359, -0.1870541274547577, 0.17345313727855682, -0.1433723419904709, -0.1706486940383911, 0.20719361305236816, 0.12927629053592682, -0.155147522687912, -0.370108962059021, -0.25690779089927673, 0.19500654935836792, -0.08537829667329788, 0.26496413350105286, -0.1614018678665161, -0.16734790802001953, -0.03681143745779991, 0.30518969893455505, -0.13373732566833496, 0.19802388548851013, 0.2118074893951416, 0.011382769793272018, 0.2544102668762207, -0.03589850291609764, 0.01542704552412033, 0.10267865657806396, -0.1111409142613411, 0.1975964605808258, -0.007339004427194595, -0.03169593960046768, -0.10634540766477585, 0.20259647071361542, -0.046203870326280594, -0.09407365322113037, -0.18632100522518158, -0.13069215416908264, -0.2251698523759842, -0.26930221915245056, 0.05102778971195221, -0.07577323168516159, -0.10088574886322021, 0.05074232816696167, 0.7681761980056763, -0.028102312237024307, -0.27859801054000854, 0.14752937853336334, -0.054054245352745056, 0.09597577154636383, -0.06037250533699989, 0.3817688524723053, 0.237554669380188, 0.02134588360786438, 0.14403310418128967, 0.23867809772491455, 0.7026711106300354, 0.0433332696557045, 0.2903507649898529, -0.1006690263748169, 0.012138962745666504, -0.3175353705883026, 0.431467205286026, 0.4617253541946411, 0.10567156970500946, -0.22782397270202637, 0.13914723694324493, 0.08676838874816895, -0.10947685688734055, -0.0992685854434967, 0.07060493528842926, 0.20910854637622833, 0.10003291815519333, 0.3907879889011383, 0.0068114399909973145, 0.008541315793991089, 0.09923961013555527, 0.12679161131381989, 0.05647994950413704, -0.5252482891082764, -0.005278941243886948, -0.06816428154706955, 0.15504507720470428, -0.1575157344341278, 0.4113064110279083, -0.13826383650302887, 0.20103248953819275, 0.2544858753681183, -0.2877112030982971, 0.7972638010978699, 0.26147952675819397, 0.004137529991567135, 0.003972422331571579, -0.48738348484039307, -0.30251792073249817, -0.014445878565311432, 0.07338712364435196, 0.21001510322093964, 0.17768874764442444, 0.6834643483161926, 0.00884908065199852, 0.11485878378152847, 0.05110349506139755, 0.11490944027900696, 0.09908647835254669, -0.21152181923389435, -0.017089731991291046, -0.332413911819458, -0.23017725348472595, 0.008245758712291718, -0.04571830481290817, 0.00585964135825634, 0.47539398074150085, 0.25560805201530457, 0.10842818021774292, -0.10383156687021255, 0.3280452787876129, 0.014132939279079437, 0.4320729672908783, -0.3184630274772644, -0.12014317512512207, 0.12141920626163483, 0.11182168126106262, 0.023310787975788116, 0.04611695557832718, 0.20585086941719055, 0.2185361087322235, -0.1421356499195099, 0.1643984019756317, -0.21874958276748657, 0.026013337075710297, -0.2070111185312271, 0.22750388085842133, -0.15629221498966217, 0.10624207556247711, 0.26699912548065186, -0.03751793131232262, -0.05715370178222656, 0.00141933374106884, 0.13569647073745728, -0.27925631403923035, -0.21654962003231049, 0.30035024881362915, -0.07730616629123688, -0.5221888422966003, 0.02511877566576004, -0.12241841852664948, -0.20978610217571259, -0.1710456907749176, 0.328461617231369, -0.5246769785881042, -0.005183596163988113, -0.11463554203510284, -0.029512811452150345, -0.13526222109794617, 0.41080015897750854, 0.04778646305203438, 0.3818293511867523, -0.2313702404499054, -0.08325406908988953, -0.1898072510957718, -0.025748256593942642, -0.19484052062034607, 0.13356399536132812, 0.027249407023191452, 0.5043751001358032, -0.0812341570854187, 0.252507746219635, 0.050354503095149994, -0.27456241846084595, -0.059026461094617844, 0.753327488899231, -0.2597295045852661, 0.28162962198257446, -0.08350424468517303, 0.13250692188739777, 0.025096572935581207, -0.44308000802993774, 0.2119264304637909, -0.037989482283592224, -0.1540507674217224, 0.09651841223239899, -0.2459072768688202, 0.4382445812225342, -0.11848236620426178, 0.3612561821937561, -0.008631588891148567, 0.09685742110013962, 0.044562287628650665, 0.1287367045879364, -0.38743558526039124, 0.086578868329525, -0.20898456871509552, 0.17901793122291565, 0.3118334710597992, 0.27496394515037537, -0.06374657154083252, -0.17170481383800507, -0.40181872248649597, 0.3659839630126953, -0.15421178936958313, 0.13361917436122894, -0.12684251368045807, 0.04061954468488693, -0.21828117966651917, 0.39652127027511597, -0.17919862270355225, 0.31607532501220703, 0.010678247548639774, 0.09660320729017258, -0.28533583879470825, -0.08938413113355637, 0.13985632359981537, -0.4790739119052887, -0.14951825141906738, -0.20757220685482025, 0.2224147617816925, 0.37465983629226685, 0.258821576833725, -0.3587632179260254, -0.35474294424057007, 0.17456601560115814, -0.15916769206523895, 0.1957187056541443, 0.1787661612033844, 0.45005902647972107, -0.3068171441555023, -0.08847635239362717, 0.061696529388427734, 0.03020690754055977, -0.02728479728102684, -0.1628321409225464, -0.6532184481620789 ]
https://github.com/huggingface/datasets/issues/5984
Alternatively we could support multiprocessing map for iterable datasets and let the user do the CPU intensive task there ? This way it would work on arrow data but also on any iterable dataset
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
34
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. Alternatively we could support multiprocessing map for iterable datasets and let the user do the CPU intensive task there ? This way it would work on arrow data but also on any iterable dataset
[ -0.40869325399398804, -0.1982613503932953, -0.14433178305625916, 0.12288518249988556, -0.23263713717460632, -0.10178466141223907, 0.5957220196723938, 0.1270076036453247, -0.023237287998199463, 0.24934904277324677, 0.12391463667154312, 0.3039184510707855, -0.30772465467453003, -0.14949290454387665, -0.13273359835147858, -0.20209062099456787, -0.1467915028333664, -0.010909374803304672, 0.06673265993595123, 0.056052833795547485, -0.10264451056718826, 0.17645174264907837, -0.05694776028394699, -0.302644282579422, -0.3027738332748413, 0.057922832667827606, 0.03004949539899826, 0.04633622616529465, 0.2683165669441223, -0.2059001922607422, 0.14427831768989563, 0.396034300327301, 0.4547594487667084, 0.40370774269104004, -0.00012300012167543173, -0.1235572099685669, 0.09716133028268814, 0.10268166661262512, -0.11947038769721985, 0.1109023243188858, 0.11776137351989746, -0.3443601727485657, 0.17295438051223755, -0.3108590245246887, 0.14778441190719604, -0.13689041137695312, 0.2128373086452484, -0.25962018966674805, 0.27884724736213684, -0.2180667519569397, 0.014167474582791328, 0.2748742401599884, -0.2200956642627716, 0.23708269000053406, 0.00918947160243988, 0.03883054852485657, -0.11883677542209625, 0.03221961110830307, 0.425979346036911, -0.051442570984363556, -0.5139763355255127, 0.3151145577430725, 0.008911147713661194, 0.3032161593437195, 0.17035332322120667, -0.1188211664557457, -0.5731508135795593, -0.5339156985282898, -0.14577840268611908, 0.23070324957370758, -0.0865277498960495, -0.2585236430168152, -0.1822895109653473, -0.7031617164611816, -0.1721203327178955, -0.17031243443489075, 0.03916033357381821, 0.036182209849357605, -0.19127920269966125, -0.18470193445682526, 0.04492739960551262, 0.08190937340259552, -0.17051909863948822, 0.17450037598609924, 0.3390601575374603, 0.34283334016799927, -0.0927371233701706, 0.1750391125679016, 0.5841151475906372, 0.036973096430301666, 0.1712915152311325, 0.15372386574745178, 0.3227381706237793, 0.2478495091199875, -0.49958866834640503, -0.10037831962108612, -0.10012662410736084, -0.20221710205078125, 0.22495046257972717, 0.25131046772003174, 0.10381455719470978, 0.160475492477417, 0.12677745521068573, 0.1582200676202774, 0.29259413480758667, -0.2555953562259674, 0.0025412440299987793, -0.054408568888902664, 0.04890233650803566, -0.09604939818382263, 0.006796583533287048, 0.0017005521804094315, -0.05308254063129425, -0.7183883190155029, 0.40303319692611694, 0.15870901942253113, 0.07131116092205048, 0.05976220220327377, -0.0607159398496151, -0.17790792882442474, 0.06160616874694824, -0.2754935026168823, 0.1724705547094345, 0.12746337056159973, 0.0672028660774231, 0.07528895884752274, -0.3245829939842224, 0.254645437002182, -0.3382178246974945, -0.33796900510787964, 0.0921953022480011, -0.08416751772165298, -0.04183458909392357, 0.33697450160980225, 0.37996089458465576, -0.012466007843613625, 0.018453672528266907, 0.005913536995649338, 0.38106250762939453, -0.10272842645645142, 0.31445980072021484, -0.30372875928878784, 0.06048094481229782, 0.09725919365882874, 0.0087437704205513, 0.0376800000667572, -0.009498298168182373, 0.33796000480651855, -0.19530931115150452, 0.19891789555549622, -0.15383067727088928, -0.4458587169647217, 0.03807758539915085, 0.002987912856042385, -0.13818290829658508, -0.02490895800292492, -0.4038667380809784, 0.06918395310640335, 0.643281102180481, -0.08179433643817902, 0.16563868522644043, -0.18929991126060486, -0.24850313365459442, -0.053750332444906235, 0.05842976272106171, 0.5386551022529602, 0.23596617579460144, -0.11490683257579803, -0.19414423406124115, -0.1301823854446411, 0.2865060567855835, 0.27227136492729187, -0.1270887702703476, 0.07651759684085846, -0.07599624246358871, 0.504062294960022, 0.24539291858673096, 0.012019060552120209, -0.3989579677581787, 0.5190487504005432, -0.07867799699306488, 0.1628255695104599, 0.4184974133968353, 0.31373846530914307, 0.34058064222335815, -0.1022210642695427, -0.01028519868850708, 0.18625158071517944, -0.06496919691562653, -0.00823095440864563, -0.3011714518070221, -0.07369019091129303, 0.07017681747674942, 0.4836048483848572, 0.41284674406051636, -0.0571177676320076, 0.031702920794487, -0.38903573155403137, 0.4961411952972412, -0.010071735829114914, 0.23738877475261688, 0.019673652946949005, -0.06425844132900238, 0.0021091029047966003, 0.3664602041244507, -0.3767611086368561, -0.32813993096351624, 0.2860746383666992, -0.024909742176532745, -0.1805618554353714, -0.2806483507156372, -0.04345673695206642, 0.3421327769756317, -0.15447425842285156, -0.40125763416290283, 0.02551427111029625, -0.11231408268213272, -0.020223282277584076, -0.07250452041625977, -0.4303390681743622, -0.3463822305202484, 0.13034379482269287, -0.529191255569458, -0.025537915527820587, -0.3930312395095825, 0.17527875304222107, 0.28938060998916626, -0.1705610156059265, -0.1514895260334015, 0.09397463500499725, -0.041427820920944214, -0.32038387656211853, 0.05362262576818466, 0.13408789038658142, 0.1688096821308136, 0.2274826616048813, -0.09472928941249847, 0.4486503005027771, 0.1604616343975067, 0.029164090752601624, -0.07862831652164459, 0.07486607879400253, -0.1794033646583557, -0.16395312547683716, 0.09048645198345184, 0.3290810286998749, -0.45172199606895447, 0.38274404406547546, -0.13539917767047882, -0.07560957223176956, 0.257461816072464, -0.004844367504119873, -0.2203952968120575, 0.05722089111804962, 0.16124358773231506, -0.12803100049495697, 0.19965848326683044, 0.01173369586467743, -0.26759588718414307, 0.25604748725891113, -0.028263118118047714, -0.001355588436126709, -0.0312759131193161, 0.030747586861252785, 0.018347010016441345, 0.08733107894659042, 0.3071903884410858, 0.2970365285873413, 0.2770342528820038, 0.056942347437143326, 0.04107419401407242, -0.21177615225315094, 0.19544334709644318, -0.08497505635023117, -0.11779192090034485, 0.20111706852912903, 0.30633026361465454, 0.28714367747306824, -0.19545477628707886, 0.10691455751657486, -0.2826949954032898, -0.5162252187728882, 0.012665048241615295, 0.09350474923849106, -0.14022359251976013, 0.11377253383398056, 0.0449632853269577, 0.2080090492963791, -0.1882905513048172, 0.0388234481215477, -0.11555144190788269, -0.09527163207530975, -0.04197610169649124, 0.6098244786262512, -0.08718264102935791, 0.1464221179485321, 0.07989093661308289, 0.2862396240234375, -0.0001571550965309143, -0.24562318623065948, -0.14384520053863525, -0.07917511463165283, 0.26284143328666687, -0.0637502446770668, 0.231259286403656, -0.26435720920562744, 0.22038808465003967, 0.011576741933822632, -0.05502287670969963, -0.4045509397983551, 0.1585342288017273, -0.012220673263072968, -0.016908351331949234, -0.20483267307281494, -0.04720226302742958, -0.060582030564546585, 0.08836229145526886, -0.292228102684021, -0.025981344282627106, -0.09274812042713165, 0.1037851870059967, 0.15793833136558533, 0.060929179191589355, -0.0806097760796547, 0.14079640805721283, 0.004206202924251556, -0.4144015908241272, -0.2510705590248108, 0.2651539146900177, 0.23673349618911743, 0.386231005191803, -0.14852161705493927, 0.14861448109149933, -0.14619439840316772, 0.1929061859846115, -0.14367669820785522, 0.05635396018624306, -0.5015797019004822, 0.37807419896125793, -0.20631858706474304, -0.1475018560886383, -0.20785115659236908, -0.004011273384094238, 0.12493863701820374, 0.4182577133178711, -0.19927231967449188, 0.05993218719959259, -0.23654218018054962, 0.3490293025970459, -0.14128200709819794, -0.032115526497364044, 0.46456050872802734, 0.3326219320297241, 0.1503075808286667, 0.10122940689325333, 0.27577754855155945, 0.1680997759103775, -0.2649226784706116, -0.0908399224281311, 0.14497721195220947, 0.23725374042987823, 0.33031290769577026, 1.1837143898010254, 0.1255485564470291, -0.14755496382713318, 0.2931651473045349, -0.09601595252752304, -0.3991025686264038, 0.13648903369903564, -0.5351923704147339, 0.19840192794799805, -0.3538708984851837, 0.015576623380184174, 0.14856240153312683, -0.1769264191389084, -0.19410797953605652, 0.10053428262472153, -0.38636696338653564, -0.10019814223051071, -0.32502809166908264, 0.360969215631485, -0.2347215712070465, 0.31531572341918945, -0.21998116374015808, 0.010545030236244202, -0.2633403241634369, -0.13982179760932922, -0.05535922944545746, 0.2835165858268738, 0.44516241550445557, -0.1304556131362915, -0.030470460653305054, 0.3303613066673279, -0.37538495659828186, 0.19336551427841187, 0.031244676560163498, 0.16816183924674988, 0.24806717038154602, -0.3133718967437744, 0.1509747952222824, -0.03657844662666321, 0.47981882095336914, 0.30244073271751404, -0.029979603365063667, -0.13574965298175812, -0.38887590169906616, 0.004291072487831116, 0.02725382149219513, 0.026330746710300446, 0.5839136838912964, 0.11926877498626709, 0.2560257017612457, -0.22824552655220032, -0.22700458765029907, 0.1964624971151352, -0.03502988442778587, -0.25471118092536926, -0.3905041217803955, -0.24455109238624573, 0.13228967785835266, -0.29444947838783264, 0.3565714955329895, 0.15227466821670532, 0.1537989228963852, -0.19876925647258759, -0.05324510857462883, -0.2915421724319458, -0.35284101963043213, 0.22019287943840027, 0.17582650482654572, -0.114087775349617, -0.2414829581975937, 0.2236754596233368, 0.17691770195960999, -0.016848115250468254, 0.17253831028938293, 0.10968579351902008, -0.17351758480072021, -0.37185153365135193, 0.135320782661438, 0.03330213204026222, 0.38664811849594116, 0.04566047340631485, -0.11814400553703308, 0.07727697491645813, 0.18306869268417358, 0.35992276668548584, -0.414962500333786, -0.007585346698760986, 0.10993468016386032, 0.09689465165138245, -0.35726824402809143, -0.3815913200378418, 0.5145564675331116, -0.071305051445961, -0.005715981125831604, 0.4700966775417328, -0.1007610559463501, -0.03776799514889717, 0.21158333122730255, 0.27511152625083923, 0.9098135828971863, -0.3650648891925812, -0.07714661955833435, -0.08776339143514633, 0.5812366008758545, 0.1811126470565796, -0.5212216973304749, 0.2928331792354584, -0.17349842190742493, -0.3388209640979767, -0.003484562039375305, 0.020822979509830475, 0.09737230092287064, 0.43661558628082275, 0.07033712416887283, 0.07063300907611847, 0.1056714653968811, -0.17825204133987427, -0.12570028007030487, 0.4100963771343231, -0.29998648166656494, -0.41346505284309387, 0.1403309404850006, -0.03931868076324463, 0.03964191675186157, 0.3454820215702057, -0.10297693312168121, -0.0382651686668396, 0.5136814713478088, 0.016864538192749023, -0.13687770068645477, -0.04901077598333359, -0.13057541847229004, 0.30291154980659485, 0.011395733803510666, -0.44687098264694214, 0.13060471415519714, 0.2193886637687683, 0.04753723368048668, -0.43198296427726746, 0.08627287298440933, -0.023329725489020348, 0.024832727387547493, -0.1502215713262558, -0.15368589758872986, -0.08808577060699463, 0.16400034725666046, -0.15548855066299438, -0.16194717586040497, -0.2510493993759155, 0.3384791612625122, -0.72716224193573, -0.10295236110687256, 0.35197436809539795, 0.05576116591691971, -0.2689565420150757, 0.030712205916643143, 0.2356949746608734, -0.3195152282714844, -0.1929992139339447, -0.002609036862850189, 0.409097820520401, -0.23061104118824005, 0.33287113904953003, -0.33512312173843384, -0.12590660154819489, -0.07129569351673126, 0.22061306238174438, 0.05297437682747841, 0.050879836082458496, 0.3485654890537262, 0.17493221163749695, -0.16635283827781677, -0.22519665956497192, -0.1194719597697258, 0.25166162848472595, -0.4776865243911743, 0.07512741535902023, -0.1799878180027008, 0.18195247650146484, -0.15944957733154297, -0.13147291541099548, 0.11247341334819794, 0.004674240946769714, -0.10713624954223633, -0.41795411705970764, -0.40218114852905273, 0.04940526559948921, -0.15516649186611176, 0.20599141716957092, -0.06071197986602783, -0.05733070150017738, 0.0046495795249938965, 0.4504784941673279, -0.1913011372089386, 0.09422115981578827, 0.017617270350456238, 0.01587599888443947, 0.3464592695236206, -0.08337671309709549, 0.08523645997047424, 0.06780332326889038, -0.06854870170354843, 0.1692921370267868, 0.06556707620620728, -0.10905404388904572, -0.1775103211402893, 0.15474781394004822, -0.045930661261081696, -0.02128048613667488, -0.2030794471502304, -0.05866342410445213, -0.12044129520654678, -0.30530470609664917, 0.17779074609279633, 0.04019865393638611, -0.09146738052368164, 0.24390609562397003, 0.6351056098937988, -0.048219602555036545, -0.36059296131134033, 0.07186786830425262, -0.059354353696107864, -0.010467655956745148, -0.009648919105529785, 0.3963339030742645, 0.3495904803276062, 0.09936097264289856, 0.15875913202762604, 0.07439713925123215, 0.8183064460754395, -0.09966878592967987, 0.18524038791656494, -0.14389127492904663, -0.019510984420776367, -0.31859979033470154, 0.3792480230331421, 0.41895201802253723, 0.04208701103925705, -0.10838623344898224, 0.10603967308998108, 0.14995408058166504, -0.14887738227844238, -0.1158413290977478, 0.1326054036617279, 0.17276249825954437, 0.0978860855102539, 0.466304749250412, -0.012394100427627563, 0.11491937935352325, 0.27067893743515015, 0.12169447541236877, 0.15467478334903717, -0.5098341107368469, 0.07244791090488434, -0.07012656331062317, 0.0499885231256485, -0.14270037412643433, 0.3394717872142792, 0.0007356908172369003, 0.14710751175880432, 0.09334462881088257, -0.3196823000907898, 0.8409628868103027, 0.16904373466968536, -0.042349666357040405, 0.08606906980276108, -0.499126136302948, -0.3496185839176178, -0.0033335238695144653, 0.01329299807548523, 0.08014710992574692, 0.04869478568434715, 0.5395015478134155, 0.0703200027346611, 0.0536363385617733, -0.057989850640296936, 0.2368285059928894, -0.04181703180074692, -0.18265089392662048, 0.08802054822444916, -0.27033066749572754, -0.2429618388414383, -0.05154595896601677, 0.03860033303499222, -0.16783583164215088, 0.49232378602027893, 0.16195298731327057, -0.027506455779075623, -0.1265057772397995, 0.2510221004486084, 0.18880660831928253, 0.35497719049453735, -0.27877336740493774, -0.11347828060388565, 0.06981406360864639, -0.0026716645807027817, -0.17224940657615662, 0.11730757355690002, 0.18858814239501953, 0.31217944622039795, -0.2506192624568939, 0.15895003080368042, -0.17993947863578796, 0.08839260041713715, -0.28489094972610474, 0.24355588853359222, -0.31633397936820984, 0.16435043513774872, 0.29742565751075745, -0.03895256668329239, -0.07971464842557907, 0.05230399966239929, 0.22192329168319702, -0.18016445636749268, -0.28460025787353516, 0.3868778944015503, 0.00012365169823169708, -0.4384778141975403, 0.03547285497188568, -0.01548786461353302, -0.11696193367242813, -0.2593972682952881, 0.3436836302280426, -0.4574962258338928, 0.009162381291389465, -0.17376193404197693, 0.010972563177347183, -0.144496887922287, 0.4575640857219696, 0.02149469405412674, 0.2959793508052826, -0.3643343150615692, 0.054695576429367065, -0.28302326798439026, 0.06631907820701599, -0.2521620988845825, 0.08888977020978928, 0.08112163096666336, 0.4237458407878876, -0.17580477893352509, 0.2871766984462738, 0.041027218103408813, -0.2968407869338989, 0.05906442552804947, 0.6924171447753906, -0.26322975754737854, 0.20358961820602417, -0.21628327667713165, 0.10123957693576813, 0.18458151817321777, -0.33622482419013977, 0.22843286395072937, -0.1487206518650055, -0.08097966015338898, 0.00740424357354641, -0.1597033143043518, 0.34444665908813477, -0.19531217217445374, 0.4300207197666168, 0.0440836101770401, 0.10007396340370178, 0.005096927285194397, 0.15937373042106628, -0.31713175773620605, 0.1366252303123474, -0.21158643066883087, 0.09207986295223236, 0.33067432045936584, 0.14343440532684326, -0.07421299070119858, 0.002491176128387451, -0.5097653269767761, 0.26166683435440063, -0.11930668354034424, 0.10249263793230057, -0.11033931374549866, 0.08620890974998474, -0.06195768713951111, 0.4069450795650482, -0.0696830227971077, 0.4759637117385864, -0.008924778550863266, 0.11201716959476471, -0.3490362763404846, -0.07464554160833359, 0.10261805355548859, -0.526252269744873, -0.21476000547409058, -0.31927210092544556, 0.24749450385570526, 0.3319704532623291, 0.11297386139631271, -0.3835216462612152, -0.2557063102722168, 0.2460799217224121, -0.1261969804763794, 0.11353716254234314, 0.18967419862747192, 0.37755221128463745, -0.35480064153671265, -0.03404688835144043, 0.027428898960351944, 0.0757967159152031, 0.05800960958003998, 0.022567935287952423, -0.5760604739189148 ]
https://github.com/huggingface/datasets/issues/5984
> For this to be possible, we would have to switch from the "Streaming" Arrow format to the "Random Access" (IPC/Feather) format, which allows reading arbitrary record batches (explained [here](https://arrow.apache.org/docs/python/ipc.html)). We could then use these batches to construct shards. > > @lhoestq @albertvillanova Do you think this use case is worth the switch? Also, we currently shard files, not inner row groups/chunks. Should we also support sharding row groups (e.g. if the number of input files is 1)? > > PS: I don't expect significant speed-up for local, uncompressed Arrow files. Could you explain why you'd need to change the arrow format? When we use streaming datasets we simply determine the number of worker shards and then add some modulo logic at the appropriate place. Worst case scenario, you'd skip streaming entries according to the number of shards. For PyTorch, I'd be happy to provide an implementation or a sketch thereof, if you point me toward what the testing requirements would be for such a PR.
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
166
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. > For this to be possible, we would have to switch from the "Streaming" Arrow format to the "Random Access" (IPC/Feather) format, which allows reading arbitrary record batches (explained [here](https://arrow.apache.org/docs/python/ipc.html)). We could then use these batches to construct shards. > > @lhoestq @albertvillanova Do you think this use case is worth the switch? Also, we currently shard files, not inner row groups/chunks. Should we also support sharding row groups (e.g. if the number of input files is 1)? > > PS: I don't expect significant speed-up for local, uncompressed Arrow files. Could you explain why you'd need to change the arrow format? When we use streaming datasets we simply determine the number of worker shards and then add some modulo logic at the appropriate place. Worst case scenario, you'd skip streaming entries according to the number of shards. For PyTorch, I'd be happy to provide an implementation or a sketch thereof, if you point me toward what the testing requirements would be for such a PR.
[ -0.41506555676460266, -0.11562855541706085, -0.14575722813606262, 0.08082820475101471, -0.29021868109703064, -0.17778001725673676, 0.6815129518508911, 0.202985480427742, -0.1653580367565155, 0.19864985346794128, 0.050410643219947815, 0.16098478436470032, -0.2835122346878052, -0.28057730197906494, -0.09504712373018265, -0.3223939836025238, -0.06563989818096161, -0.022616568952798843, 0.026082122698426247, 0.05423194169998169, -0.09020870178937912, 0.18194887042045593, -0.09504073858261108, -0.2522926926612854, -0.42113736271858215, 0.013568567112088203, -0.0002846270799636841, 0.17423312366008759, 0.14680245518684387, -0.2695401608943939, 0.10631132870912552, 0.42406827211380005, 0.4071293771266937, 0.4010786712169647, -0.00012549020175356418, -0.1024235188961029, 0.20637214183807373, 0.021922580897808075, -0.15463273227214813, 0.19912245869636536, 0.03517413139343262, -0.2996492385864258, 0.09975088387727737, -0.3415411412715912, 0.026187896728515625, -0.20901234447956085, 0.18012350797653198, -0.3768199384212494, 0.3285844922065735, -0.03313099965453148, -0.027625665068626404, 0.14993777871131897, -0.18254810571670532, 0.2272268831729889, 0.2751046419143677, 0.004156328737735748, -0.10355999320745468, 0.14785568416118622, 0.46384677290916443, 0.04897394776344299, -0.5701155662536621, 0.3172677755355835, -0.05149400234222412, 0.27925682067871094, 0.24503779411315918, -0.08534158766269684, -0.6744166612625122, -0.41318732500076294, -0.22590140998363495, 0.17708034813404083, -0.08485879749059677, -0.2105911523103714, -0.22107085585594177, -0.6246175169944763, -0.1599426418542862, -0.18915362656116486, 0.0041213128715753555, 0.10406460613012314, -0.19001522660255432, -0.11540119349956512, 0.11974698305130005, 0.09337954968214035, -0.25881022214889526, 0.1956380009651184, 0.3199886977672577, 0.17760947346687317, -0.07523493468761444, 0.17057111859321594, 0.4486639201641083, 0.09937337040901184, 0.3157416880130768, 0.10817128419876099, 0.19159352779388428, 0.180302232503891, -0.2800896465778351, -0.09168333560228348, -0.08752362430095673, -0.14501091837882996, 0.11982768774032593, 0.3868023753166199, 0.24145075678825378, 0.12887200713157654, 0.143154114484787, 0.14970263838768005, 0.09806963056325912, -0.30461984872817993, 0.05233830213546753, -0.07011160999536514, 0.08480874449014664, -0.024031996726989746, 0.002848289906978607, 0.013573890551924706, -0.034731410443782806, -0.6897640228271484, 0.17860902845859528, 0.2471218705177307, -0.018174462020397186, 0.12264469265937805, 0.017585352063179016, -0.18582220375537872, 0.12716473639011383, -0.3277627229690552, 0.08692780882120132, 0.07713022828102112, 0.14793123304843903, -0.019118307158350945, -0.24236223101615906, 0.29887863993644714, -0.24657396972179413, -0.4480724632740021, 0.09128229320049286, -0.13398396968841553, -0.06780936568975449, 0.2926332950592041, 0.26973700523376465, 0.017743274569511414, -0.023028379306197166, -0.06622820347547531, 0.3209187090396881, 0.0756964236497879, 0.14035916328430176, -0.25606465339660645, 0.1271846741437912, 0.011601489037275314, -0.08396101742982864, -0.1461365967988968, 0.03954416513442993, 0.2836829721927643, -0.18102873861789703, 0.13484151661396027, -0.0805491954088211, -0.40640097856521606, -0.030923428013920784, -0.07897159457206726, 0.0027544796466827393, 0.0599023774266243, -0.3928926885128021, 0.06377367675304413, 0.48352447152137756, -0.21743953227996826, 0.15221571922302246, -0.22080501914024353, -0.1649462878704071, -0.16634050011634827, 0.014044858515262604, 0.5452674031257629, 0.06470389664173126, -0.026934228837490082, -0.06419118493795395, 0.021185342222452164, 0.31020742654800415, 0.314316064119339, -0.16159501671791077, -0.06390257179737091, -0.10735905915498734, 0.5402750968933105, 0.30753666162490845, 0.06408711522817612, -0.4448132812976837, 0.5294626355171204, -0.056627385318279266, 0.000912301242351532, 0.6265668272972107, 0.2205410897731781, 0.49746444821357727, -0.0936848595738411, 0.10686644911766052, 0.20081500709056854, -0.04647425562143326, -0.06773076206445694, -0.3687962591648102, -0.08729410171508789, -0.13847561180591583, 0.3213670253753662, 0.2532029151916504, 0.0047267526388168335, 0.21412399411201477, -0.5102078914642334, 0.5317637324333191, -0.03628580644726753, 0.19592323899269104, -0.07924290001392365, -0.06927383691072464, 0.0026093292981386185, 0.3277013301849365, -0.2629411816596985, -0.3297680914402008, 0.15802305936813354, -0.07360173016786575, -0.16974887251853943, -0.29275617003440857, -0.1520482897758484, 0.23145170509815216, -0.16962653398513794, -0.28465649485588074, 0.12028241902589798, -0.18328556418418884, -0.07804489880800247, 0.07808981835842133, -0.3622303605079651, -0.33367782831192017, 0.02964393049478531, -0.603277862071991, 0.01077267900109291, -0.4031811058521271, 0.24237433075904846, 0.3023087680339813, -0.25116923451423645, -0.0530770979821682, 0.07501242309808731, -0.0902174562215805, -0.3037640154361725, 0.026781868189573288, 0.19608977437019348, 0.1309089958667755, 0.19243493676185608, 0.025824762880802155, 0.4537985026836395, 0.16684746742248535, 0.04915042966604233, 0.1180666908621788, 0.12323559075593948, -0.13840536773204803, -0.1018102765083313, -0.03231685608625412, 0.5415441989898682, -0.43546733260154724, 0.37554582953453064, -0.11097527295351028, -0.09975755214691162, 0.2479248344898224, 0.09175402671098709, -0.30079132318496704, 0.14237017929553986, 0.08264908194541931, -0.09257110953330994, 0.19898156821727753, -0.01837833784520626, -0.2847555875778198, 0.3399491310119629, 0.01981196179986, -0.07207725942134857, -0.08542443811893463, 0.039791446179151535, -0.026011765003204346, 0.06411360949277878, 0.3902057707309723, 0.4892542064189911, 0.3244932293891907, 0.14594757556915283, 0.04403078556060791, -0.2808491289615631, 0.17902225255966187, -0.17965683341026306, -0.02899617701768875, 0.14422470331192017, 0.15278036892414093, 0.24057114124298096, -0.1892123818397522, 0.01934536173939705, -0.28911131620407104, -0.6409367918968201, -0.12237557768821716, 0.08717278391122818, -0.15710893273353577, 0.1329444944858551, 0.07925253361463547, 0.11929090321063995, -0.2867143452167511, 0.02110007405281067, -0.057748209685087204, -0.14068686962127686, -0.016398640349507332, 0.597798764705658, -0.07322246581315994, 0.07336686551570892, -0.028087299317121506, 0.41705459356307983, 0.051099710166454315, -0.13434749841690063, -0.23554004728794098, 0.06613433361053467, 0.18660148978233337, -0.09469512104988098, 0.38908621668815613, -0.06871843338012695, 0.2065211832523346, 0.041257090866565704, -0.01024853065609932, -0.3416638970375061, 0.27599143981933594, -0.04656408354640007, -0.04402514174580574, -0.11481010168790817, -0.03745422512292862, -0.022693462669849396, -0.005672872066497803, -0.36285001039505005, -0.012801188975572586, -0.025112856179475784, 0.15569722652435303, 0.15240289270877838, -0.010037228465080261, -0.027241408824920654, 0.16696223616600037, -0.08521987497806549, -0.39468589425086975, -0.29341161251068115, 0.31899961829185486, 0.2562793493270874, 0.3640204071998596, -0.1560928374528885, 0.27891290187835693, -0.09323837608098984, 0.15655255317687988, -0.16884157061576843, 0.10782147198915482, -0.539289116859436, 0.435091495513916, -0.16600428521633148, -0.18540556728839874, -0.2500106990337372, -0.08360335230827332, 0.008006871677935123, 0.4952833652496338, -0.16526618599891663, 0.06470774859189987, -0.16696697473526, 0.36805880069732666, -0.011275261640548706, -0.0233243890106678, 0.4725116491317749, 0.2804100215435028, 0.1244383156299591, 0.11662875860929489, 0.4517418146133423, 0.11305855214595795, -0.32477137446403503, -0.10700227320194244, 0.32735466957092285, 0.3035474717617035, 0.2556224465370178, 1.403691053390503, 0.19273436069488525, -0.10405054688453674, 0.24512477219104767, -0.11108900606632233, -0.3477437198162079, 0.008730897679924965, -0.4116593599319458, 0.18192067742347717, -0.3078441023826599, 0.024445712566375732, 0.167321115732193, -0.13045206665992737, -0.15242892503738403, 0.09944935142993927, -0.19898739457130432, -0.08839327841997147, -0.4383670687675476, 0.49494078755378723, -0.25484779477119446, 0.2817716896533966, -0.2830674946308136, 0.035076238214969635, -0.15901412069797516, -0.19475355744361877, -0.09669177234172821, 0.28057146072387695, 0.5436875820159912, -0.1163564920425415, -0.021119125187397003, 0.3447618782520294, -0.43840283155441284, 0.261990487575531, 0.09683036804199219, 0.19742915034294128, 0.28803616762161255, -0.35571110248565674, 0.23369304835796356, 0.006187707185745239, 0.40936294198036194, 0.20886379480361938, -0.11834391206502914, -0.09209397435188293, -0.18411561846733093, -0.08305323123931885, -0.005568370223045349, -0.020055651664733887, 0.4514945149421692, 0.0744549036026001, 0.2148248255252838, -0.240223228931427, -0.18857747316360474, 0.15318210422992706, -0.09545917809009552, -0.14733968675136566, -0.24862655997276306, -0.2411607950925827, 0.2187754362821579, -0.394513338804245, 0.31789276003837585, 0.16007336974143982, 0.0676875188946724, -0.19631922245025635, -0.08583026379346848, -0.22728198766708374, -0.38564813137054443, 0.246696338057518, 0.09934528172016144, 0.00948258489370346, -0.19503581523895264, 0.09859173744916916, 0.19706833362579346, -0.01785607635974884, 0.23315885663032532, 0.1406751275062561, -0.09342697262763977, -0.24296291172504425, 0.11956368386745453, -0.028591519221663475, 0.348895400762558, 0.3189529478549957, -0.12762776017189026, 0.09862327575683594, 0.17994315922260284, 0.3621477484703064, -0.2819629907608032, -0.04227596893906593, 0.06284886598587036, 0.010808024555444717, -0.1990830898284912, -0.4271671175956726, 0.5480889081954956, -0.11451761424541473, 0.005760550498962402, 0.5341792106628418, 0.046391140669584274, -0.06276106834411621, 0.39394280314445496, 0.17053832113742828, 1.1382527351379395, -0.2118176370859146, 0.10182146728038788, 0.005953816697001457, 0.47837674617767334, 0.0029557235538959503, -0.44645625352859497, 0.2734861373901367, -0.20231939852237701, -0.1968236267566681, -0.08034960180521011, -0.01671985536813736, 0.1758006513118744, 0.39236980676651, 0.08703693002462387, 0.04411683231592178, 0.0541873574256897, -0.26026034355163574, -0.22624504566192627, 0.32212117314338684, -0.43640264868736267, -0.3243273198604584, 0.16383901238441467, -0.11289980262517929, 0.0508606843650341, 0.17866462469100952, 0.04115329310297966, -0.06099336966872215, 0.17841681838035583, 0.06879406422376633, -0.12358036637306213, -0.10122929513454437, -0.051448021084070206, 0.32294487953186035, 0.033198680728673935, -0.6011415719985962, 0.04067922383546829, 0.19139304757118225, -0.1801963746547699, -0.4813329577445984, 0.08665946125984192, -0.09726104885339737, 0.13049036264419556, -0.20782987773418427, -0.11983692646026611, -0.14480261504650116, 0.2570003271102905, -0.07750479876995087, -0.1413964182138443, -0.16729678213596344, 0.3050694167613983, -0.7965348362922668, -0.17653204500675201, 0.3272407054901123, 0.2376091182231903, -0.3639126420021057, -0.07890836894512177, 0.19330020248889923, -0.4356928765773773, -0.14299514889717102, -0.03878413513302803, 0.3518310487270355, -0.18489781022071838, 0.2850149869918823, -0.19496536254882812, -0.0895751416683197, -0.04614320397377014, 0.24761848151683807, 0.040803637355566025, 0.06892066448926926, 0.30704066157341003, 0.14520198106765747, -0.25247594714164734, -0.1430501639842987, 0.024061277508735657, 0.36524319648742676, -0.5947428941726685, 0.05735195428133011, -0.19286760687828064, 0.1890038251876831, -0.1594548374414444, -0.1557803899049759, 0.20129823684692383, 0.12437041848897934, -0.15696069598197937, -0.3686162233352661, -0.2636992037296295, 0.1599690318107605, -0.09859864413738251, 0.2700827121734619, -0.14362016320228577, -0.15763261914253235, -0.042151182889938354, 0.3178618848323822, -0.15264993906021118, 0.1821010559797287, 0.18769437074661255, 0.023960117250680923, 0.2614282965660095, -0.03919430077075958, 0.014471173286437988, 0.10426751524209976, -0.09330178052186966, 0.1994410902261734, -0.0119202621281147, -0.04783877730369568, -0.12251158058643341, 0.19506308436393738, -0.05204092711210251, -0.0974699854850769, -0.17870312929153442, -0.11022820323705673, -0.2184903472661972, -0.2715665102005005, 0.05749320983886719, -0.06815431267023087, -0.09864923357963562, 0.0623796321451664, 0.7646512389183044, -0.049104414880275726, -0.2636698782444, 0.11381841450929642, -0.07752867043018341, 0.0929834172129631, -0.06727301329374313, 0.3828035295009613, 0.21792499721050262, 0.02026556432247162, 0.13025382161140442, 0.2525660991668701, 0.7097482085227966, 0.05497792735695839, 0.28788983821868896, -0.09830824285745621, 0.017967484891414642, -0.3231910765171051, 0.41602662205696106, 0.437796413898468, 0.09907479584217072, -0.2264251410961151, 0.13644111156463623, 0.10072856396436691, -0.09261183440685272, -0.1052028089761734, 0.06661202013492584, 0.20266824960708618, 0.10377486795186996, 0.3909813165664673, -0.005348563194274902, 0.026262477040290833, 0.12265191227197647, 0.12354349344968796, 0.08153149485588074, -0.5287001132965088, -0.01706305705010891, -0.05511169135570526, 0.1654604822397232, -0.1498623937368393, 0.41792550683021545, -0.12957537174224854, 0.1764952838420868, 0.22202971577644348, -0.2761693298816681, 0.8016802072525024, 0.24542050063610077, 0.019850410521030426, -0.005429230630397797, -0.4902379512786865, -0.2989808917045593, -0.006963595747947693, 0.05551239103078842, 0.19380469620227814, 0.17585605382919312, 0.6641222238540649, -0.002766445279121399, 0.12882865965366364, 0.07699836790561676, 0.1365225911140442, 0.08128607273101807, -0.20019683241844177, -0.010105550289154053, -0.31846192479133606, -0.25292113423347473, -0.005769982933998108, -0.03578663244843483, 0.00209770817309618, 0.4678138792514801, 0.24066460132598877, 0.0989067405462265, -0.0999363586306572, 0.3038191497325897, 0.012007007375359535, 0.4260834753513336, -0.3287997245788574, -0.11992017179727554, 0.10960859060287476, 0.11615267395973206, 0.018086250871419907, 0.047890231013298035, 0.22908179461956024, 0.2344837486743927, -0.1354050189256668, 0.1580541580915451, -0.20986133813858032, 0.025405116379261017, -0.18758466839790344, 0.22188696265220642, -0.18162350356578827, 0.08868932723999023, 0.27278614044189453, -0.02536952868103981, -0.06493335962295532, -0.011864807456731796, 0.1537891924381256, -0.29833805561065674, -0.20049269497394562, 0.3157925605773926, -0.06784014403820038, -0.5097526907920837, 0.017130047082901, -0.14168691635131836, -0.23529626429080963, -0.17446160316467285, 0.3279344439506531, -0.4973403811454773, -0.003864448517560959, -0.11705819517374039, -0.019841192290186882, -0.13628633320331573, 0.40898147225379944, 0.044475652277469635, 0.3687483072280884, -0.2594119608402252, -0.0829576849937439, -0.1794377863407135, -0.028428640216588974, -0.19719789922237396, 0.1133330687880516, 0.026825398206710815, 0.4978739619255066, -0.08967386186122894, 0.25392913818359375, 0.02204328030347824, -0.271371990442276, -0.0695594772696495, 0.7498657703399658, -0.2664780616760254, 0.28567078709602356, -0.0929436981678009, 0.13599292933940887, 0.03255842626094818, -0.42875438928604126, 0.23342686891555786, -0.04309722036123276, -0.13286858797073364, 0.08295735716819763, -0.23504453897476196, 0.44535544514656067, -0.11009116470813751, 0.33876803517341614, -0.009523345157504082, 0.12403928488492966, 0.03412001579999924, 0.1198977530002594, -0.3852521777153015, 0.11182588338851929, -0.2013196051120758, 0.18331129848957062, 0.32573336362838745, 0.29929912090301514, -0.04828929901123047, -0.19190944731235504, -0.41875845193862915, 0.41303500533103943, -0.15845294296741486, 0.12590476870536804, -0.11509017646312714, 0.05737517029047012, -0.20819596946239471, 0.40456080436706543, -0.16856782138347626, 0.3361702859401703, 0.018805889412760735, 0.12935787439346313, -0.30376899242401123, -0.10437005758285522, 0.15817703306674957, -0.49689415097236633, -0.1673029065132141, -0.2128092348575592, 0.21426868438720703, 0.3608732521533966, 0.2614152729511261, -0.3646862506866455, -0.3395006060600281, 0.18209445476531982, -0.16300584375858307, 0.18328672647476196, 0.1951640546321869, 0.4801536798477173, -0.2823580503463745, -0.08099814504384995, 0.04185640066862106, 0.05386245623230934, -0.025311414152383804, -0.15390373766422272, -0.6559443473815918 ]
https://github.com/huggingface/datasets/issues/5984
> Could you explain why you'd need to change the arrow format? This way workers have random access to the location of the file where its dataset subset starts. Currently we're using the Arrow streaming format which doesn't include the metadata of the record batches offsets. This is needed here to efficiently split a dataset made of one single file.
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
60
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. > Could you explain why you'd need to change the arrow format? This way workers have random access to the location of the file where its dataset subset starts. Currently we're using the Arrow streaming format which doesn't include the metadata of the record batches offsets. This is needed here to efficiently split a dataset made of one single file.
[ -0.44266700744628906, -0.20271021127700806, -0.12075897306203842, 0.07688800990581512, -0.2469574511051178, -0.19033944606781006, 0.677727222442627, 0.15579548478126526, -0.08213454484939575, 0.2221689075231552, 0.1517815887928009, 0.2422218918800354, -0.303825706243515, -0.15542393922805786, -0.08632038533687592, -0.32383376359939575, -0.10458610206842422, 0.05800328776240349, 0.04037795215845108, -0.010944679379463196, -0.05777014046907425, 0.15162819623947144, -0.05303678661584854, -0.3277015686035156, -0.3972371816635132, 0.07221582531929016, -0.0774984061717987, 0.09501588344573975, 0.1354050636291504, -0.2133406102657318, 0.06895997375249863, 0.3788779377937317, 0.39832156896591187, 0.472117155790329, -0.00012581722694449127, -0.1336233764886856, 0.08507790416479111, -0.022145342081785202, -0.20807097852230072, 0.10223431140184402, -0.060314856469631195, -0.35959985852241516, 0.12455160170793533, -0.2925664186477661, 0.08365868031978607, -0.22842027246952057, 0.2117304801940918, -0.392509400844574, 0.3172159492969513, -0.12718498706817627, -0.027234043926000595, 0.2446882575750351, -0.23460401594638824, 0.22239592671394348, 0.11972283571958542, 0.09025681018829346, -0.09154649823904037, 0.04685932397842407, 0.3886268436908722, 0.04831601679325104, -0.548535943031311, 0.36919116973876953, -0.017976518720388412, 0.33151009678840637, 0.2793229818344116, -0.07694204151630402, -0.6023032665252686, -0.49316704273223877, -0.21841269731521606, 0.18902748823165894, 0.016865072771906853, -0.2516956925392151, -0.21976745128631592, -0.7078968286514282, -0.22182674705982208, -0.20336493849754333, 0.001754285767674446, 0.16616301238536835, -0.1642552614212036, -0.15943388640880585, 0.059423819184303284, 0.06392650306224823, -0.20562982559204102, 0.2350202053785324, 0.30832794308662415, 0.38298577070236206, -0.08768229186534882, 0.1341273933649063, 0.47232580184936523, 0.12454937398433685, 0.26127326488494873, 0.10560727119445801, 0.23440617322921753, 0.20955418050289154, -0.36118367314338684, -0.09189483523368835, -0.16468161344528198, -0.19159875810146332, 0.17786243557929993, 0.3438758850097656, 0.17225004732608795, 0.079701267182827, 0.14181546866893768, 0.10242395102977753, 0.28476226329803467, -0.20213663578033447, 0.06763571500778198, 0.016014162451028824, -0.03549390658736229, -0.08402639627456665, 0.0380793958902359, -0.016532767564058304, -0.036121249198913574, -0.7313732504844666, 0.30814415216445923, 0.21831640601158142, 0.08338801562786102, 0.10943849384784698, 0.05168275535106659, -0.20492005348205566, 0.053013868629932404, -0.3079575002193451, 0.07285001873970032, 0.07174812257289886, 0.06428368389606476, 0.03820750117301941, -0.3158872127532959, 0.3228416442871094, -0.3111131191253662, -0.35982269048690796, 0.05998644977807999, -0.09725050628185272, -0.042228419333696365, 0.3074735105037689, 0.28521469235420227, -0.032539501786231995, 0.0755789652466774, -0.04621695354580879, 0.34952306747436523, -0.07169033586978912, 0.2429129034280777, -0.2265210896730423, 0.22713711857795715, 0.04680682718753815, 0.011641740798950195, -0.0027896687388420105, -0.034280434250831604, 0.3416895270347595, -0.175065279006958, 0.14877189695835114, -0.12642428278923035, -0.4379073977470398, -0.08611598610877991, -0.040317602455616, -0.11912544071674347, 0.047679174691438675, -0.4260862171649933, 0.023439237847924232, 0.5834333300590515, -0.1383151113986969, 0.23460949957370758, -0.17105691134929657, -0.21020470559597015, -0.09496137499809265, 0.03373947739601135, 0.5945022106170654, 0.12016057968139648, -0.12921461462974548, -0.14640861749649048, -0.05094635486602783, 0.3389601409435272, 0.2334749847650528, -0.11478468775749207, -0.006579115986824036, -0.09171944111585617, 0.5893861055374146, 0.29136359691619873, 0.023910582065582275, -0.43439266085624695, 0.5746409296989441, -0.2146424651145935, 0.07573935389518738, 0.5191310048103333, 0.22865907847881317, 0.48014509677886963, -0.08882062137126923, -0.05636759474873543, 0.2085539847612381, -0.09130285680294037, -0.008052781224250793, -0.32110947370529175, -0.11440607905387878, -0.04301413521170616, 0.38487136363983154, 0.26480379700660706, -0.04558299481868744, 0.07480137795209885, -0.34766626358032227, 0.5390466451644897, -0.0029213465750217438, 0.264085054397583, -0.009487539529800415, -0.05583365634083748, 0.01745934784412384, 0.37173742055892944, -0.2904634177684784, -0.36497947573661804, 0.17556673288345337, -0.0028874650597572327, -0.23557545244693756, -0.3561166226863861, -0.08073874562978745, 0.28145676851272583, -0.1865682601928711, -0.4024438261985779, 0.0352056622505188, -0.17682600021362305, 0.015524566173553467, 0.024152211844921112, -0.4610942006111145, -0.3150482177734375, 0.08514371514320374, -0.47522208094596863, 0.028561461716890335, -0.41865789890289307, 0.15415094792842865, 0.31459930539131165, -0.1912262737751007, -0.08934734761714935, 0.08577427268028259, 0.021509189158678055, -0.3003169298171997, 0.023164425045251846, 0.25098463892936707, 0.17052032053470612, 0.31846994161605835, -0.07530369609594345, 0.38146641850471497, 0.19433607161045074, -0.034244224429130554, 0.06294035911560059, 0.0900842547416687, -0.1748112440109253, -0.12032878398895264, -0.05549924075603485, 0.3590362071990967, -0.4731273055076599, 0.3783584237098694, -0.14814746379852295, -0.050886042416095734, 0.2382293939590454, 0.044584378600120544, -0.3009781539440155, -0.0055196285247802734, 0.14439716935157776, -0.17058973014354706, 0.1508726179599762, 0.017101826146245003, -0.3092041611671448, 0.37094101309776306, 0.08430083096027374, -0.05287476256489754, -0.06534074246883392, 0.016496924683451653, -0.04399103671312332, 0.04275476932525635, 0.32053342461586, 0.41848912835121155, 0.2814282774925232, 0.060213200747966766, 0.07517560571432114, -0.26446717977523804, 0.2456488162279129, -0.15865923464298248, -0.02508852630853653, 0.17756393551826477, 0.19432640075683594, 0.2926126718521118, -0.23495566844940186, 0.0198393315076828, -0.22933600842952728, -0.517370879650116, -0.06257426738739014, 0.1030818298459053, -0.16520705819129944, 0.14635594189167023, 0.028839111328125, 0.13741180300712585, -0.3639114797115326, -0.09279686957597733, -0.058563023805618286, -0.07888497412204742, -0.01856248266994953, 0.5197208523750305, -0.11361593008041382, 0.1710207760334015, 0.06518089771270752, 0.33815905451774597, -0.0168917253613472, -0.16144423186779022, -0.14112506806850433, -0.050663385540246964, 0.2732684910297394, -0.11194878816604614, 0.20397767424583435, -0.08554479479789734, 0.16484999656677246, -0.010707665234804153, -0.02619745582342148, -0.4349170923233032, 0.27070483565330505, -0.015897514298558235, 0.011955063790082932, -0.19785736501216888, 0.020534377545118332, 0.02176583744585514, 0.05612807720899582, -0.37700191140174866, -0.10258965194225311, -0.07284371554851532, 0.14621129631996155, 0.16160017251968384, 0.009137805551290512, -0.042141206562519073, 0.11785110086202621, -0.0780915915966034, -0.4351046085357666, -0.2581844925880432, 0.27179965376853943, 0.26521429419517517, 0.3793899416923523, -0.09567375481128693, 0.18684351444244385, -0.20475462079048157, 0.1638832539319992, -0.16398738324642181, 0.0881543904542923, -0.549439549446106, 0.45596587657928467, -0.2450510561466217, -0.13503654301166534, -0.20413656532764435, -0.056309595704078674, -0.01003599539399147, 0.4737080931663513, -0.14749883115291595, 0.08430697023868561, -0.16551493108272552, 0.21102681756019592, -0.04571129381656647, -0.0019719116389751434, 0.4608030915260315, 0.30598098039627075, 0.18787071108818054, 0.03421159088611603, 0.3918195962905884, 0.1880885660648346, -0.26447850465774536, -0.005771063268184662, 0.11067590117454529, 0.2696329653263092, 0.27276670932769775, 1.2911179065704346, 0.16546247899532318, -0.1284564882516861, 0.16037850081920624, -0.12687961757183075, -0.4246291220188141, 0.10973915457725525, -0.45424455404281616, 0.25553691387176514, -0.2747032642364502, 0.021307647228240967, 0.2111387997865677, -0.1962839812040329, -0.13326215744018555, 0.14520448446273804, -0.2750956416130066, -0.15913084149360657, -0.37877726554870605, 0.3650413453578949, -0.221604585647583, 0.3003659248352051, -0.24372801184654236, 0.061573244631290436, -0.24788926541805267, -0.1835850179195404, -0.10745914280414581, 0.28225380182266235, 0.4994490444660187, -0.05903121456503868, -0.06164034083485603, 0.33772262930870056, -0.31335020065307617, 0.16278600692749023, 0.10714061558246613, 0.19036605954170227, 0.24027830362319946, -0.37011849880218506, 0.15005764365196228, 0.04792977124452591, 0.512883722782135, 0.2305809110403061, -0.03396691381931305, -0.21248595416545868, -0.2244221270084381, -0.047268226742744446, -0.006985291838645935, 0.0033060163259506226, 0.5702307820320129, 0.03703314810991287, 0.24522608518600464, -0.2514800429344177, -0.173444926738739, 0.22651638090610504, -0.011943347752094269, -0.14867240190505981, -0.2648787498474121, -0.2279505878686905, 0.17054064571857452, -0.29001596570014954, 0.318433552980423, 0.1647130846977234, 0.1204107403755188, -0.1700478196144104, -0.043044690042734146, -0.1740269511938095, -0.33037078380584717, 0.19317838549613953, 0.14479675889015198, 0.03988486900925636, -0.14944496750831604, 0.10639271140098572, 0.3064400255680084, 0.06506030261516571, 0.2685328423976898, 0.13949036598205566, -0.1761353313922882, -0.35323214530944824, 0.2087823897600174, -0.0675363689661026, 0.3995997905731201, 0.27328649163246155, -0.12104153633117676, 0.1212737187743187, 0.28106623888015747, 0.3492450416088104, -0.3427863121032715, 0.006231486797332764, 0.08864393830299377, 0.03207150474190712, -0.3246196210384369, -0.4624021649360657, 0.49009940028190613, -0.09826262295246124, 0.05689583718776703, 0.5365033745765686, -0.06702613085508347, -0.05983317643404007, 0.2996675372123718, 0.22342568635940552, 1.0874265432357788, -0.1824970543384552, -0.03090338036417961, 0.046605776995420456, 0.46605581045150757, 0.15539482235908508, -0.42273473739624023, 0.31433311104774475, -0.17109131813049316, -0.2918223440647125, -0.08824159950017929, -0.051465217024087906, 0.070797860622406, 0.43773147463798523, 0.009589649736881256, 0.05088644102215767, 0.011154428124427795, -0.18509307503700256, -0.19820261001586914, 0.43849554657936096, -0.3697258532047272, -0.4126163423061371, 0.1387268304824829, -0.11765213310718536, -0.0010485397651791573, 0.3067602813243866, -0.033286601305007935, -0.11651105433702469, 0.34269943833351135, 0.028236612677574158, -0.11790844053030014, -0.060848135501146317, -0.12386630475521088, 0.25051259994506836, 0.007419852539896965, -0.5676661729812622, 0.08388319611549377, 0.19775794446468353, -0.020321186631917953, -0.43842872977256775, 0.1185380145907402, -0.00998380221426487, 0.11216162890195847, -0.16558527946472168, -0.12549641728401184, -0.10528554022312164, 0.1718360036611557, -0.09796304255723953, -0.15250591933727264, -0.27194470167160034, 0.31269121170043945, -0.7495590448379517, -0.1616642028093338, 0.3128202557563782, 0.15592505037784576, -0.3165925145149231, -0.0591912567615509, 0.20107589662075043, -0.3650543689727783, -0.1583271622657776, -0.027501165866851807, 0.3705587089061737, -0.21460963785648346, 0.25552430748939514, -0.28467440605163574, -0.13256539404392242, -0.0937948226928711, 0.25664761662483215, -0.008464982733130455, 0.07892224192619324, 0.3693266808986664, 0.22017788887023926, -0.19208842515945435, -0.17557844519615173, -0.05859186500310898, 0.3432995080947876, -0.5996008515357971, 0.03532513231039047, -0.2373829334974289, 0.20706066489219666, -0.16557101905345917, -0.061093803495168686, 0.14411242306232452, 0.15862147510051727, -0.1576251983642578, -0.42017778754234314, -0.26517581939697266, 0.08496597409248352, -0.18357929587364197, 0.26495102047920227, -0.057250939309597015, -0.06872755289077759, -0.0690348893404007, 0.3912723958492279, -0.16570515930652618, 0.1136385053396225, 0.14009743928909302, 0.04428161308169365, 0.2588232159614563, -0.06003424525260925, 0.09125448763370514, 0.018855426460504532, -0.11547993123531342, 0.15860921144485474, 0.05651085823774338, -0.05740128830075264, -0.16935215890407562, 0.18115787208080292, -0.06502575427293777, -0.10089591145515442, -0.2265627682209015, -0.07572673261165619, -0.14628565311431885, -0.28375935554504395, 0.14995676279067993, 0.003794237971305847, -0.04232753813266754, 0.2222100794315338, 0.727514922618866, -0.11280094087123871, -0.3762805163860321, 0.007806701585650444, -0.04428086802363396, 0.05091370269656181, -0.044280823320150375, 0.43026915192604065, 0.2538939118385315, 0.046208836138248444, 0.18739143013954163, 0.19899994134902954, 0.7757990956306458, 0.07873772084712982, 0.18222099542617798, -0.12668070197105408, 0.04999961704015732, -0.310740202665329, 0.4265691339969635, 0.4587095379829407, 0.08447631448507309, -0.16923882067203522, 0.07695549726486206, 0.12315457314252853, -0.061328064650297165, -0.15151658654212952, 0.10499155521392822, 0.19806891679763794, 0.08723601698875427, 0.4259986877441406, -0.01586027443408966, 0.05831354856491089, 0.14353898167610168, 0.2159637063741684, 0.13266906142234802, -0.5296975374221802, 0.10516536980867386, 0.051199592649936676, 0.07559823989868164, -0.10416637361049652, 0.3463820517063141, -0.0039528654888272285, 0.2110310196876526, 0.12343163788318634, -0.26783692836761475, 0.8402658700942993, 0.28755325078964233, -0.05578036233782768, 0.04693128168582916, -0.5208198428153992, -0.42686402797698975, -0.006196662783622742, 0.00018561631441116333, 0.11936816573143005, 0.11462128162384033, 0.5876425504684448, -0.01478671096265316, 0.10141924023628235, 0.05911716818809509, 0.1184421181678772, 0.02429647371172905, -0.18391871452331543, -0.06746631860733032, -0.26375436782836914, -0.2536756098270416, -0.06689770519733429, 0.013923137448728085, -0.05840131267905235, 0.42837244272232056, 0.17967647314071655, 0.018702305853366852, -0.054613858461380005, 0.31933990120887756, 0.1003400906920433, 0.38074058294296265, -0.3300432562828064, -0.086469866335392, 0.08076512813568115, 0.06015947833657265, -0.0727243572473526, 0.10231789201498032, 0.18559816479682922, 0.25151535868644714, -0.1582353711128235, 0.15842515230178833, -0.13536100089550018, -0.013283006846904755, -0.20266291499137878, 0.18004998564720154, -0.2588895559310913, -0.0075506651774048805, 0.2995201349258423, -0.01361471600830555, -0.05597814545035362, 0.09756851196289062, 0.2962192893028259, -0.24594534933567047, -0.19678767025470734, 0.3150177001953125, 0.007300395518541336, -0.4554405212402344, 0.008185388520359993, -0.132654070854187, -0.20915177464485168, -0.24612607061862946, 0.3686164617538452, -0.38592633605003357, -0.013542849570512772, -0.1310092657804489, -0.015877338126301765, -0.09465634077787399, 0.4487622380256653, 0.061742153018713, 0.3193358778953552, -0.3149645924568176, -0.022838108241558075, -0.2006595879793167, 0.02258232980966568, -0.25310733914375305, 0.027248136699199677, 0.0551251657307148, 0.5216025710105896, -0.14671766757965088, 0.2736232876777649, 0.0007442012429237366, -0.1831543892621994, -0.03663408011198044, 0.727195143699646, -0.25770699977874756, 0.19378942251205444, -0.14556917548179626, 0.2306187003850937, 0.1720699667930603, -0.3774476647377014, 0.2634153366088867, -0.0950307548046112, -0.11945710331201553, 0.07539118826389313, -0.1925417184829712, 0.40005871653556824, -0.15169675648212433, 0.2795678377151489, -0.009271465241909027, 0.07752023637294769, -0.02135145664215088, 0.14175984263420105, -0.40344247221946716, 0.14919403195381165, -0.2676313817501068, 0.16955232620239258, 0.3530432879924774, 0.2839924097061157, -0.09049409627914429, -0.025133220478892326, -0.5126560926437378, 0.31249722838401794, -0.15164241194725037, 0.1275390237569809, -0.11207543313503265, 0.1403653621673584, -0.16636741161346436, 0.35563284158706665, -0.03418949246406555, 0.43230581283569336, -0.019204385578632355, 0.09367146342992783, -0.2802124619483948, -0.084546759724617, 0.1267888993024826, -0.5239132642745972, -0.2149943709373474, -0.2782488763332367, 0.2525143027305603, 0.3888793885707855, 0.1726386994123459, -0.4150140881538391, -0.23936963081359863, 0.19653765857219696, -0.1374691277742386, 0.1471668928861618, 0.13585788011550903, 0.488878458738327, -0.2357829511165619, -0.05074124410748482, 0.11929541826248169, 0.14077149331569672, -0.004999108612537384, -0.05678454041481018, -0.6075131893157959 ]
https://github.com/huggingface/datasets/issues/5984
> > Could you explain why you'd need to change the arrow format? > > This way workers have random access to the location of the file where its dataset subset starts. Currently we're using the Arrow streaming format which doesn't include the metadata of the record batches offsets. This is needed here to efficiently split a dataset made of one single file. I guess I don't understand why you'd need to subset the dataset in the first place. It seems sufficient to figure out how to offset or skip rows. For instance, using pyArrow, you could use RecordBatchStreamReader to zero-copy iterate over records with read_next_batch and then only initiate the next step for records modulo worker shard. That's one way to do it, where of course you'd need to account for gpu sharding as well. Otherwise, how did you implement worker/node/GPU sharding for iterable/streaming data where you do not have index information or prior splits (e.g. files)?
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
158
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. > > Could you explain why you'd need to change the arrow format? > > This way workers have random access to the location of the file where its dataset subset starts. Currently we're using the Arrow streaming format which doesn't include the metadata of the record batches offsets. This is needed here to efficiently split a dataset made of one single file. I guess I don't understand why you'd need to subset the dataset in the first place. It seems sufficient to figure out how to offset or skip rows. For instance, using pyArrow, you could use RecordBatchStreamReader to zero-copy iterate over records with read_next_batch and then only initiate the next step for records modulo worker shard. That's one way to do it, where of course you'd need to account for gpu sharding as well. Otherwise, how did you implement worker/node/GPU sharding for iterable/streaming data where you do not have index information or prior splits (e.g. files)?
[ -0.46709948778152466, -0.1791263073682785, -0.11632896214723587, 0.049152933061122894, -0.26057004928588867, -0.17280226945877075, 0.6774322986602783, 0.16799107193946838, -0.08234615623950958, 0.23683150112628937, 0.11716029047966003, 0.24954739212989807, -0.23069238662719727, -0.20272251963615417, -0.07892920821905136, -0.3268373906612396, -0.09764453768730164, 0.06180354207754135, 0.016723301261663437, 0.008218236267566681, -0.08084334433078766, 0.12172055244445801, -0.09854807704687119, -0.333869993686676, -0.3718212842941284, -0.021802401170134544, -0.08079496771097183, 0.11663785576820374, 0.0833587720990181, -0.22696077823638916, 0.09289532154798508, 0.35672613978385925, 0.4370899796485901, 0.444290429353714, -0.00012330352910794318, -0.1340988576412201, 0.08292333781719208, -0.0286276675760746, -0.24186573922634125, 0.11165693402290344, -0.06680400669574738, -0.3418000340461731, 0.0835900530219078, -0.3267808258533478, 0.09842279553413391, -0.24415305256843567, 0.21822313964366913, -0.3822200894355774, 0.310924232006073, -0.10331495106220245, -0.006927743554115295, 0.28343263268470764, -0.23839671909809113, 0.19674456119537354, 0.1322481334209442, 0.05143887549638748, -0.10345922410488129, 0.10990701615810394, 0.40380406379699707, 0.0648273229598999, -0.6061634421348572, 0.35273051261901855, -0.09032108634710312, 0.3489091694355011, 0.29029712080955505, -0.05440869182348251, -0.5406511425971985, -0.46659553050994873, -0.1627476066350937, 0.1814957857131958, 0.04374019056558609, -0.2872781455516815, -0.20227473974227905, -0.7327901124954224, -0.22153693437576294, -0.24705544114112854, -0.01790666952729225, 0.16987928748130798, -0.14752909541130066, -0.11218053102493286, 0.06514056026935577, 0.101593978703022, -0.19023779034614563, 0.21403633058071136, 0.30002492666244507, 0.3404037356376648, -0.0761367529630661, 0.12652258574962616, 0.4351046681404114, 0.1739450842142105, 0.3234545588493347, 0.01701309159398079, 0.25687411427497864, 0.20112921297550201, -0.3925284445285797, -0.05657859519124031, -0.14338372647762299, -0.1380469799041748, 0.1714736819267273, 0.33603158593177795, 0.18577924370765686, 0.08506537973880768, 0.23320992290973663, 0.09384915977716446, 0.285356730222702, -0.1872536689043045, 0.04277859628200531, -0.0012479312717914581, -0.06867094337940216, 0.00386766716837883, 0.08035768568515778, 0.0006764857098460197, -0.010886333882808685, -0.7157847881317139, 0.2798621356487274, 0.2540677487850189, 0.08032936602830887, 0.10069344937801361, 0.022488072514533997, -0.21952301263809204, 0.03745848685503006, -0.32721906900405884, 0.029523741453886032, 0.06315606832504272, 0.043662309646606445, 0.023169688880443573, -0.3392709195613861, 0.33424103260040283, -0.3109428882598877, -0.32362431287765503, 0.04277043789625168, -0.09669548273086548, -0.06111409515142441, 0.31940045952796936, 0.262010395526886, -0.03589138016104698, 0.06975023448467255, -0.05369238927960396, 0.34712862968444824, 0.010874025523662567, 0.2543995976448059, -0.2150866836309433, 0.25124627351760864, 0.06970643252134323, 0.04897885024547577, -0.014151092618703842, -0.042169179767370224, 0.3360750079154968, -0.17292919754981995, 0.21340984106063843, -0.09245768934488297, -0.46536216139793396, -0.06927816569805145, -0.018590863794088364, -0.15004301071166992, 0.03032638132572174, -0.4674246311187744, 0.047973763197660446, 0.565484881401062, -0.17167875170707703, 0.24320030212402344, -0.18049556016921997, -0.21225698292255402, -0.1542268693447113, 0.08542394638061523, 0.5544646382331848, 0.027671203017234802, -0.0964893326163292, -0.1577218770980835, -0.02338559739291668, 0.38411736488342285, 0.22282624244689941, -0.10678431391716003, 0.04406784102320671, -0.10123088210821152, 0.6192275881767273, 0.257939875125885, 0.09721817076206207, -0.47430968284606934, 0.5242748260498047, -0.22952690720558167, 0.14407673478126526, 0.5152028203010559, 0.1536293923854828, 0.47487419843673706, -0.1027120053768158, -0.07458947598934174, 0.20332294702529907, -0.15020033717155457, -0.005142472684383392, -0.34553277492523193, -0.09857238829135895, -0.0447608157992363, 0.4137108325958252, 0.25350522994995117, -0.04305782914161682, 0.07247518002986908, -0.36098557710647583, 0.5523998141288757, -0.040684912353754044, 0.2685280442237854, -0.0639655739068985, -0.09737462550401688, 0.018294524401426315, 0.3620154857635498, -0.23676931858062744, -0.4138542115688324, 0.19191722571849823, -0.019140951335430145, -0.21352684497833252, -0.3690822124481201, -0.12535274028778076, 0.26768958568573, -0.2206445038318634, -0.3611282408237457, 0.006178881973028183, -0.15374097228050232, 0.01661747694015503, 0.03220469504594803, -0.46177077293395996, -0.324629008769989, 0.07163821905851364, -0.46845296025276184, 0.016957156360149384, -0.4666297137737274, 0.1404018998146057, 0.28924205899238586, -0.16651979088783264, -0.07350277155637741, 0.11757473647594452, 0.02254946157336235, -0.3043527901172638, 0.04342371225357056, 0.22664380073547363, 0.18944542109966278, 0.27645039558410645, -0.1027999073266983, 0.3680461049079895, 0.15446756780147552, -0.026062816381454468, 0.12119731307029724, 0.05664970353245735, -0.15057194232940674, -0.10755320638418198, -0.09381231665611267, 0.3878166079521179, -0.4450357258319855, 0.38491755723953247, -0.16309714317321777, -0.05874527245759964, 0.21826836466789246, 0.00776170939207077, -0.2816157341003418, 0.03603450953960419, 0.16419975459575653, -0.12406273186206818, 0.18268164992332458, 0.050248026847839355, -0.34184855222702026, 0.3922937214374542, 0.11268043518066406, -0.07714573293924332, -0.07482747733592987, 0.016314299777150154, -0.05851481109857559, -0.014880623668432236, 0.3294006288051605, 0.42751890420913696, 0.27848342061042786, 0.1032325029373169, 0.13477492332458496, -0.2704535722732544, 0.23464244604110718, -0.18938937783241272, -0.030238963663578033, 0.19052821397781372, 0.22609956562519073, 0.25895094871520996, -0.23871000111103058, 0.03725317493081093, -0.20179107785224915, -0.5255186557769775, -0.08170099556446075, 0.1270136535167694, -0.18168753385543823, 0.14194533228874207, 0.012389056384563446, 0.1583155393600464, -0.35893428325653076, -0.0410478375852108, -0.026823032647371292, -0.1127566546201706, -0.006502083968371153, 0.4830234944820404, -0.14387157559394836, 0.20516124367713928, 0.07800440490245819, 0.37439751625061035, -0.0736486092209816, -0.12949682772159576, -0.1690758764743805, -0.0432237908244133, 0.21698911488056183, -0.07991280406713486, 0.22013312578201294, -0.05398917943239212, 0.19062691926956177, -0.018713627010583878, -0.0567503422498703, -0.38428473472595215, 0.26833006739616394, -0.02160901203751564, 0.0038388557732105255, -0.1869000643491745, 0.04228311404585838, 0.07174369692802429, 0.015081793069839478, -0.36318713426589966, -0.12539827823638916, -0.02489354833960533, 0.1512405127286911, 0.1415325105190277, -0.06961794942617416, -0.020886270329356194, 0.1256953924894333, -0.12126743048429489, -0.43352991342544556, -0.280950129032135, 0.2677631080150604, 0.23411238193511963, 0.35052454471588135, -0.10312303900718689, 0.19568514823913574, -0.2071043998003006, 0.1463673710823059, -0.17472371459007263, 0.09463869035243988, -0.5447434186935425, 0.46939384937286377, -0.2322852909564972, -0.14996473491191864, -0.1804453432559967, -0.09853394329547882, -0.007805787958204746, 0.5124889016151428, -0.20098426938056946, 0.06528432667255402, -0.13046149909496307, 0.21671852469444275, -0.04047899320721626, 0.013720458373427391, 0.4386044144630432, 0.28667324781417847, 0.1787182092666626, 0.001422591507434845, 0.36704814434051514, 0.15715676546096802, -0.29264187812805176, 0.008046567440032959, 0.1323142796754837, 0.24425172805786133, 0.2938324511051178, 1.3324836492538452, 0.19023574888706207, -0.09521457552909851, 0.14342883229255676, -0.08686819672584534, -0.396951824426651, 0.07016390562057495, -0.4143008291721344, 0.28322550654411316, -0.26100587844848633, 0.009976990520954132, 0.23815980553627014, -0.24277928471565247, -0.18515630066394806, 0.16660617291927338, -0.26079434156417847, -0.15927493572235107, -0.3959504961967468, 0.4074326753616333, -0.18767046928405762, 0.32507139444351196, -0.20001253485679626, 0.05811591446399689, -0.24906516075134277, -0.17041879892349243, -0.09018167853355408, 0.23721635341644287, 0.4888252019882202, -0.0288303941488266, -0.07059893012046814, 0.36162805557250977, -0.35443153977394104, 0.2275015115737915, 0.10940667241811752, 0.14314104616641998, 0.2802289128303528, -0.3802776634693146, 0.15705664455890656, 0.0713270902633667, 0.5291094183921814, 0.2147211879491806, -0.05643739551305771, -0.18645510077476501, -0.22182238101959229, -0.05401920527219772, -0.00004606693983078003, -0.0034642294049263, 0.5660012364387512, 0.03844989463686943, 0.17829112708568573, -0.3008912205696106, -0.20241713523864746, 0.2261502593755722, 0.04693775996565819, -0.10893811285495758, -0.2839246392250061, -0.1789351999759674, 0.13416804373264313, -0.31976285576820374, 0.3187345564365387, 0.18128818273544312, 0.11854226887226105, -0.16273777186870575, -0.036064546555280685, -0.13160665333271027, -0.22676128149032593, 0.1369941383600235, 0.1686372458934784, 0.05733391270041466, -0.12913915514945984, 0.06870556622743607, 0.3129563629627228, 0.07982437312602997, 0.33994439244270325, 0.17354993522167206, -0.1808103770017624, -0.35968658328056335, 0.23043541610240936, -0.11004584282636642, 0.3709307610988617, 0.3162690997123718, -0.1198241263628006, 0.10699678957462311, 0.30687353014945984, 0.34720438718795776, -0.28893208503723145, -0.03323531150817871, 0.04026530683040619, 0.004929322749376297, -0.27829524874687195, -0.49352699518203735, 0.42366743087768555, -0.10836029797792435, 0.047709882259368896, 0.48263829946517944, -0.06140601262450218, -0.0407215878367424, 0.3375163972377777, 0.262457013130188, 1.091760277748108, -0.12465160340070724, 0.004660314880311489, 0.12086035311222076, 0.4296877086162567, 0.19048787653446198, -0.39333575963974, 0.3048707842826843, -0.18350595235824585, -0.2716370224952698, -0.05887792631983757, -0.044001128524541855, 0.09528897702693939, 0.46546629071235657, 0.031092539429664612, 0.09668669104576111, 0.05607743561267853, -0.23581618070602417, -0.15067803859710693, 0.3771055340766907, -0.3534633219242096, -0.4303654134273529, 0.1318535953760147, -0.110589399933815, 0.0014142561703920364, 0.18935054540634155, -0.013139687478542328, -0.1099269688129425, 0.27636295557022095, 0.031213052570819855, -0.09144942462444305, -0.07989947497844696, -0.17791526019573212, 0.1857796460390091, 0.014721855521202087, -0.5984687209129333, 0.12992562353610992, 0.17858292162418365, -0.020512346178293228, -0.4398481845855713, 0.10269567370414734, -0.016733165830373764, 0.11147025227546692, -0.14004340767860413, -0.1265663355588913, -0.1393473595380783, 0.23943018913269043, -0.09332355856895447, -0.14842036366462708, -0.3118119239807129, 0.2621544897556305, -0.7009741067886353, -0.12266150116920471, 0.2959670424461365, 0.17202243208885193, -0.2940898835659027, -0.11343087255954742, 0.15451522171497345, -0.3169000446796417, -0.17600969970226288, -0.012772687710821629, 0.3448200821876526, -0.2011653333902359, 0.26778706908226013, -0.28965339064598083, -0.14231112599372864, -0.12918560206890106, 0.20440441370010376, -0.016366545110940933, 0.08512710779905319, 0.3798103332519531, 0.29462894797325134, -0.2374785840511322, -0.16356870532035828, -0.10471124947071075, 0.3809179365634918, -0.658172607421875, -0.020637350156903267, -0.2253962755203247, 0.2321358621120453, -0.20215246081352234, -0.05125952139496803, 0.1630680114030838, 0.13790281116962433, -0.1992560625076294, -0.3686526417732239, -0.25763604044914246, 0.08164947479963303, -0.13883641362190247, 0.2984566390514374, 0.014807932078838348, -0.018673710525035858, -0.06606277078390121, 0.39189204573631287, -0.1931215524673462, 0.10635681450366974, 0.1246238574385643, 0.07957655936479568, 0.23745495080947876, -0.06615420430898666, 0.08762384951114655, 0.014584772288799286, -0.106652170419693, 0.1550516039133072, 0.009348656982183456, -0.08278094232082367, -0.15877604484558105, 0.17654873430728912, -0.050345130264759064, -0.13542577624320984, -0.20590335130691528, -0.06481362879276276, -0.1946934163570404, -0.3218177556991577, 0.16011351346969604, -0.02732900157570839, -0.030357725918293, 0.18541011214256287, 0.7182666063308716, -0.10309338569641113, -0.4205157160758972, -0.011964239180088043, -0.0636315792798996, 0.026898104697465897, -0.06731578707695007, 0.4304823577404022, 0.2095481902360916, 0.019251912832260132, 0.2526828944683075, 0.1920337975025177, 0.7552145719528198, 0.10992024838924408, 0.1716431975364685, -0.10741384327411652, 0.04142218828201294, -0.29539379477500916, 0.41791293025016785, 0.46060678362846375, 0.09869340807199478, -0.22454285621643066, 0.1126939207315445, 0.13319340348243713, -0.0823657214641571, -0.1331748366355896, 0.14821530878543854, 0.17410042881965637, 0.09780484437942505, 0.4194480776786804, 0.0024925321340560913, 0.07391417026519775, 0.12269718945026398, 0.1928182691335678, 0.17627565562725067, -0.5144243240356445, 0.05703379586338997, 0.025176700204610825, 0.04208241403102875, -0.05924561247229576, 0.34914129972457886, 0.043019820004701614, 0.22760681807994843, 0.0950363427400589, -0.2658489942550659, 0.8143421411514282, 0.25588634610176086, -0.08209332823753357, -0.035125162452459335, -0.6022729873657227, -0.3911997973918915, 0.025257423520088196, 0.024647444486618042, 0.07849547266960144, 0.13911046087741852, 0.5331017971038818, 0.03954634070396423, 0.12014017254114151, 0.12814879417419434, 0.06129646673798561, 0.029804769903421402, -0.10450420528650284, -0.12214593589305878, -0.24875707924365997, -0.23188361525535583, -0.09543252736330032, -0.020052947103977203, -0.06293835490942001, 0.4928271174430847, 0.11123014986515045, 0.025213265791535378, -0.06928548961877823, 0.2946874499320984, 0.06326056271791458, 0.35000765323638916, -0.3102946877479553, -0.10058575868606567, 0.07041057199239731, 0.06529828906059265, -0.10343030095100403, 0.12297473847866058, 0.2263932228088379, 0.2289038747549057, -0.1677229106426239, 0.11747513711452484, -0.0662941187620163, -0.024758342653512955, -0.2261977195739746, 0.14497646689414978, -0.2199362814426422, 0.00847901962697506, 0.33116307854652405, 0.010225173085927963, -0.07500908523797989, 0.13734708726406097, 0.3227647840976715, -0.2827954590320587, -0.1715792566537857, 0.2299010455608368, 0.04303514584898949, -0.45745399594306946, 0.05268189311027527, -0.1384444236755371, -0.21813812851905823, -0.218642920255661, 0.3440484404563904, -0.41332387924194336, -0.015988707542419434, -0.14276017248630524, -0.0030456744134426117, -0.09593349695205688, 0.4823451340198517, 0.12179625034332275, 0.35182055830955505, -0.37431833148002625, -0.015425831079483032, -0.24471348524093628, 0.06277961283922195, -0.27858594059944153, 0.02090206742286682, 0.10883109271526337, 0.5068511366844177, -0.04453127086162567, 0.2923935353755951, -0.0022926107048988342, -0.12587600946426392, -0.03262690454721451, 0.747515082359314, -0.28449705243110657, 0.17546838521957397, -0.08328159153461456, 0.20934754610061646, 0.13690844178199768, -0.36369332671165466, 0.2867359220981598, -0.06781847774982452, -0.09285511076450348, 0.04166707769036293, -0.1764543652534485, 0.4524919390678406, -0.13461902737617493, 0.2666853368282318, -0.0014430806040763855, 0.058328963816165924, -0.05636643245816231, 0.15905854105949402, -0.412688672542572, 0.2098333239555359, -0.29453855752944946, 0.19210658967494965, 0.31698065996170044, 0.32185834646224976, -0.07997417449951172, -0.06990624964237213, -0.4767921268939972, 0.32546231150627136, -0.134499654173851, 0.16146692633628845, -0.10132645070552826, 0.2052917182445526, -0.17964550852775574, 0.320267915725708, -0.027420524507761, 0.37953120470046997, 0.014155330136418343, 0.10538388043642044, -0.3319612145423889, -0.0646122545003891, 0.13654017448425293, -0.5438196063041687, -0.22407804429531097, -0.2692708969116211, 0.2093559056520462, 0.42645740509033203, 0.17333117127418518, -0.4191584885120392, -0.23766635358333588, 0.18438038229942322, -0.14320553839206696, 0.0995650514960289, 0.1331920623779297, 0.4470905363559723, -0.20936724543571472, -0.055407535284757614, 0.10367797315120697, 0.10070398449897766, -0.058335453271865845, -0.12817975878715515, -0.6499221920967102 ]
https://github.com/huggingface/datasets/issues/5984
> For instance, using pyArrow, you could use RecordBatchStreamReader to zero-copy iterate over records with read_next_batch and then only initiate the next step for records modulo worker shard. That works indeed ! And what we meant is that you can make it even faster to instantiate. Indeed using RecordBatchStreamReader you need to get the list of all the record batches in each worker, whereas you could just get the list of record batches per worker if you use the record batches locations in the Arrow IPC file footer. This would be especially appreciated to have a fast instantiation in case you have tens of thousands of Arrow files for example.
AutoSharding IterableDataset's when num_workers > 1
### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR.
110
AutoSharding IterableDataset's when num_workers > 1 ### Feature request Minimal Example ``` import torch from datasets import IterableDataset d = IterableDataset.from_file(<file_name>) dl = torch.utils.data.dataloader.DataLoader(d,num_workers=3) for sample in dl: print(sample) ``` Warning: Too many dataloader workers: 2 (max is dataset.n_shards=1). Stopping 1 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=1. To enable more parallelism, please split the dataset in more files than 1. Expected Behavior: Dataset is sharded each cpu uses subset (contiguously - so you can do checkpoint loading/saving) ### Motivation I have a lot of unused cpu's and would like to be able to shard iterable datasets with pytorch's dataloader when num_workers > 1. This is for a very large single file. I am aware that we can use the `split_dataset_by_node` to ensure that each node (for distributed) gets different shards, but we should extend it so that this also continues for multiple workers. ### Your contribution If someone points me to what needs to change, I can create a PR. > For instance, using pyArrow, you could use RecordBatchStreamReader to zero-copy iterate over records with read_next_batch and then only initiate the next step for records modulo worker shard. That works indeed ! And what we meant is that you can make it even faster to instantiate. Indeed using RecordBatchStreamReader you need to get the list of all the record batches in each worker, whereas you could just get the list of record batches per worker if you use the record batches locations in the Arrow IPC file footer. This would be especially appreciated to have a fast instantiation in case you have tens of thousands of Arrow files for example.
[ -0.5463466048240662, -0.06826047599315643, -0.12397506833076477, 0.021309219300746918, -0.2813234329223633, -0.164022758603096, 0.6526508331298828, 0.17368414998054504, 0.03373450040817261, 0.2698051333427429, 0.10144931823015213, 0.215835303068161, -0.3545735478401184, -0.25760674476623535, -0.10230579972267151, -0.170662522315979, -0.1532425582408905, 0.07223343849182129, -0.0598217137157917, 0.0061894431710243225, -0.058782413601875305, 0.15543396770954132, -0.08126365393400192, -0.3289679288864136, -0.33013758063316345, 0.0023369435220956802, 0.007955864071846008, 0.1611400842666626, 0.13842621445655823, -0.32580554485321045, 0.19146880507469177, 0.4115630090236664, 0.5270882844924927, 0.35012757778167725, -0.00012107948714401573, -0.115535207092762, 0.1573173552751541, 0.08083779364824295, -0.21067851781845093, 0.21452629566192627, 0.014682106673717499, -0.431588351726532, 0.14145585894584656, -0.36290067434310913, 0.12384918332099915, -0.2051716446876526, 0.27442315220832825, -0.17377237975597382, 0.22299063205718994, -0.09839828312397003, 0.007351823151111603, 0.2546921372413635, -0.17847543954849243, 0.19898754358291626, 0.0916648730635643, 0.02523435652256012, -0.07202039659023285, 0.17510516941547394, 0.4449175000190735, 0.003983303904533386, -0.5654520988464355, 0.2085757702589035, -0.07896929979324341, 0.317432701587677, 0.2347022444009781, -0.05799001455307007, -0.47702616453170776, -0.5079457759857178, -0.24455782771110535, 0.2532188296318054, -0.06487101316452026, -0.32881972193717957, -0.18266284465789795, -0.6428315043449402, -0.1526450514793396, -0.2437756359577179, 0.05652686581015587, 0.04253942519426346, -0.18954645097255707, -0.15925192832946777, 0.08684511482715607, 0.11491607129573822, -0.19385045766830444, 0.16496676206588745, 0.34423279762268066, 0.2846823036670685, -0.05977457016706467, 0.1166272684931755, 0.5844650268554688, -0.02390541136264801, 0.30049997568130493, 0.06815095245838165, 0.2669331133365631, 0.2993038296699524, -0.4036983251571655, -0.14346182346343994, -0.09739968925714493, -0.15234769880771637, 0.18965306878089905, 0.28919386863708496, 0.14828385412693024, 0.12459249794483185, 0.22445644438266754, 0.21031181514263153, 0.15468034148216248, -0.16566793620586395, -0.035189803689718246, 0.0469900444149971, 0.04921315237879753, 0.015507843345403671, -0.03878080099821091, 0.0612393394112587, -0.09180497378110886, -0.7091239094734192, 0.4158792495727539, 0.191992849111557, 0.02046912908554077, 0.11969757080078125, -0.012048080563545227, -0.19995686411857605, 0.09272743761539459, -0.2936158776283264, 0.18093368411064148, 0.15334442257881165, 0.025941189378499985, 0.04960111528635025, -0.2759305238723755, 0.18529221415519714, -0.3713976740837097, -0.32379430532455444, 0.061795465648174286, -0.027456555515527725, -0.022422753274440765, 0.38407623767852783, 0.3766690492630005, -0.0208064503967762, 0.023818470537662506, -0.00849447026848793, 0.39768242835998535, 0.05479166656732559, 0.3138083815574646, -0.27060768008232117, 0.11693805456161499, 0.08080659806728363, 0.00897543877363205, -0.025654975324869156, -0.0733918696641922, 0.15843793749809265, -0.20372778177261353, 0.1680363267660141, -0.08802096545696259, -0.43897926807403564, -0.021031424403190613, 0.011121555231511593, -0.1403747797012329, 0.05544842779636383, -0.4604119658470154, 0.037286799401044846, 0.5327949523925781, -0.15162047743797302, 0.07489585131406784, -0.20868074893951416, -0.15135270357131958, -0.09760557115077972, 0.14759355783462524, 0.5937556028366089, 0.17909295856952667, -0.03546075522899628, -0.18179215490818024, -0.0987379252910614, 0.31051522493362427, 0.2385827898979187, -0.14563637971878052, 0.11119020730257034, -0.15984958410263062, 0.5455822944641113, 0.20070871710777283, 0.12188249081373215, -0.3995044231414795, 0.44508400559425354, -0.117961585521698, 0.0716375783085823, 0.43358731269836426, 0.2944652736186981, 0.4929322600364685, -0.15474343299865723, -0.0629817396402359, 0.23778825998306274, -0.08617804944515228, 0.03769679367542267, -0.3476821482181549, -0.05652320757508278, -0.07641689479351044, 0.44371935725212097, 0.26460129022598267, 0.06528665125370026, 0.04894820973277092, -0.36511266231536865, 0.4801105558872223, -0.0348234660923481, 0.2412329763174057, 0.028363481163978577, -0.09505562484264374, -0.05814701318740845, 0.3383520841598511, -0.2744695246219635, -0.4265996813774109, 0.25915396213531494, -0.08348123729228973, -0.15731126070022583, -0.29823076725006104, -0.07496523857116699, 0.30173298716545105, -0.10477188229560852, -0.36450353264808655, 0.12552478909492493, -0.11114135384559631, 0.05301089957356453, 0.06389817595481873, -0.436628133058548, -0.32257503271102905, 0.11286469548940659, -0.581733763217926, -0.02356579899787903, -0.4747646152973175, 0.1540602445602417, 0.24637073278427124, -0.1922404170036316, -0.06600673496723175, 0.056547343730926514, -0.01901254802942276, -0.3602105379104614, 0.11762811243534088, 0.110442154109478, 0.07841472327709198, 0.27564916014671326, -0.041950833052396774, 0.4114680588245392, 0.1609710454940796, -0.022229231894016266, 0.01423964835703373, 0.03872770071029663, -0.10305308550596237, -0.1320122331380844, 0.09900204837322235, 0.43636253476142883, -0.4106408953666687, 0.3182920813560486, -0.09216875582933426, -0.14361578226089478, 0.24557335674762726, 0.027740605175495148, -0.22076690196990967, 0.14761225879192352, 0.15363600850105286, -0.05127408355474472, 0.22453948855400085, 0.07279223203659058, -0.22391699254512787, 0.25428831577301025, 0.021934591233730316, -0.08531548082828522, -0.04324808716773987, 0.04660429805517197, -0.00794660672545433, 0.10241205990314484, 0.3160555064678192, 0.3221098780632019, 0.23980267345905304, 0.12057048082351685, 0.09884005039930344, -0.2589123249053955, 0.1979346126317978, -0.12676909565925598, -0.02437887340784073, 0.11734133958816528, 0.20010393857955933, 0.2285279929637909, -0.12304937839508057, 0.019187308847904205, -0.3071017265319824, -0.5647091269493103, 0.007842741906642914, 0.2156950682401657, -0.14063185453414917, 0.10578620433807373, 0.10609974712133408, 0.2638453245162964, -0.21458685398101807, 0.04834085330367088, -0.07397578656673431, -0.0874827653169632, -0.06730891019105911, 0.5774237513542175, -0.07805045694112778, 0.15951788425445557, 0.07077202200889587, 0.29096513986587524, -0.03126777708530426, -0.16351911425590515, -0.18428683280944824, 0.028513137251138687, 0.20198746025562286, -0.07035274803638458, 0.2803034782409668, -0.14581362903118134, 0.2264140546321869, 0.0778849795460701, -0.1051984578371048, -0.3153156042098999, 0.22172409296035767, -0.026667341589927673, 0.024982117116451263, -0.2212940752506256, -0.029301665723323822, 0.07142892479896545, 0.030147090554237366, -0.40015077590942383, -0.09892875701189041, -0.0500405952334404, 0.08054929971694946, 0.19082896411418915, -0.05382932722568512, -0.1005919873714447, 0.17138299345970154, -0.09780280292034149, -0.4088533818721771, -0.27757763862609863, 0.24681410193443298, 0.25347432494163513, 0.40962642431259155, -0.11349442601203918, 0.2097921073436737, -0.09248918294906616, 0.12894673645496368, -0.18577080965042114, 0.1382671445608139, -0.5670219659805298, 0.4834507703781128, -0.18528875708580017, -0.09963888674974442, -0.23237276077270508, -0.19044406712055206, -0.013819446787238121, 0.38983502984046936, -0.19890901446342468, 0.09643124788999557, -0.24592797458171844, 0.4153170585632324, -0.05683433264493942, -0.039362452924251556, 0.4939660429954529, 0.27737823128700256, 0.12214457988739014, 0.09221403300762177, 0.2978406548500061, 0.164027139544487, -0.358074426651001, -0.10309398174285889, 0.17321574687957764, 0.2860039472579956, 0.1686142086982727, 1.329050064086914, 0.15269052982330322, -0.1947876513004303, 0.2380295693874359, -0.14366742968559265, -0.3916316330432892, 0.10147862136363983, -0.47466301918029785, 0.21939623355865479, -0.2606057822704315, -0.00001446157693862915, 0.17689324915409088, -0.230957493185997, -0.21303445100784302, 0.08561530709266663, -0.18430563807487488, -0.07165465503931046, -0.32650843262672424, 0.36569350957870483, -0.14528888463974, 0.3577250838279724, -0.23460891842842102, -0.0352562740445137, -0.284334659576416, -0.20787228643894196, -0.10817593336105347, 0.16993489861488342, 0.4550325274467468, -0.12597639858722687, -0.03195131570100784, 0.3050098419189453, -0.5213815569877625, 0.20983849465847015, 0.09898332506418228, 0.0972365289926529, 0.3131832778453827, -0.3266250491142273, 0.14711874723434448, -0.09120745956897736, 0.4808187782764435, 0.26604175567626953, -0.014986949041485786, -0.1309003084897995, -0.22400745749473572, -0.0018039345741271973, 0.017904140055179596, 0.025117583572864532, 0.5383631587028503, 0.061879973858594894, 0.2157856822013855, -0.3266611695289612, -0.16269001364707947, 0.21361671388149261, 0.010919257998466492, -0.20709094405174255, -0.32468873262405396, -0.21138896048069, 0.10186778753995895, -0.3173513412475586, 0.31299591064453125, 0.08862897008657455, 0.11147797107696533, -0.1924421787261963, -0.07879739254713058, -0.1765121966600418, -0.26899027824401855, 0.20104451477527618, 0.2000918686389923, -0.013050606474280357, -0.16335542500019073, 0.2945637106895447, 0.16485080122947693, -0.018529247492551804, 0.21727336943149567, 0.2197187840938568, -0.17925499379634857, -0.33957019448280334, 0.14862819015979767, 0.03745025023818016, 0.33610406517982483, 0.14255285263061523, -0.09088300168514252, 0.08243604004383087, 0.23547613620758057, 0.3494149446487427, -0.3289733827114105, 0.0018497630953788757, 0.07661018520593643, -0.0003907233476638794, -0.3192756175994873, -0.36227792501449585, 0.5543582439422607, -0.10579906404018402, 0.08742126822471619, 0.42998912930488586, -0.12299162894487381, -0.004056401550769806, 0.24581216275691986, 0.2206641286611557, 0.9750778675079346, -0.32784074544906616, -0.04130134359002113, 0.010996099561452866, 0.5447685122489929, 0.1878720223903656, -0.4275888204574585, 0.24729886651039124, -0.24920713901519775, -0.2660068869590759, 0.024631798267364502, -0.03448253870010376, 0.056544482707977295, 0.46360382437705994, 0.02369678020477295, 0.0010598227381706238, 0.06907667219638824, -0.18201327323913574, -0.15741539001464844, 0.4702146053314209, -0.33163225650787354, -0.46670618653297424, 0.15130507946014404, -0.04965537041425705, 0.007714972365647554, 0.19248509407043457, -0.022041432559490204, -0.08723772317171097, 0.44176578521728516, 0.035382285714149475, -0.09053478389978409, 0.030072778463363647, -0.12459347397089005, 0.29075053334236145, 0.11508837342262268, -0.4354383647441864, 0.027066670358181, 0.1167563945055008, -0.035635776817798615, -0.4128073751926422, 0.09847405552864075, -0.03561035916209221, 0.11801192909479141, -0.17281357944011688, -0.17308394610881805, -0.14500686526298523, 0.17830976843833923, -0.1404096484184265, -0.11829482764005661, -0.26779961585998535, 0.27580946683883667, -0.6885519623756409, -0.12054404616355896, 0.3426319658756256, 0.22738142311573029, -0.2169419825077057, -0.0018736720085144043, 0.27195701003074646, -0.4396028518676758, -0.20219147205352783, 0.008709759451448917, 0.3986080288887024, -0.2949144244194031, 0.32480013370513916, -0.2448270618915558, -0.09095195680856705, -0.05051730200648308, 0.2869262397289276, 0.06055770069360733, 0.11799846589565277, 0.4663214087486267, 0.2242756336927414, -0.24876780807971954, -0.20688316226005554, -0.12086135149002075, 0.32113558053970337, -0.6146171689033508, 0.08275773376226425, -0.10912466049194336, 0.17181874811649323, -0.08193753659725189, -0.04675750434398651, 0.09143409132957458, -0.020437750965356827, -0.14110839366912842, -0.3658616840839386, -0.3881157636642456, 0.023768851533532143, -0.10513828694820404, 0.2560703456401825, -0.00036010146141052246, -0.04374196380376816, -0.08463581651449203, 0.3951658308506012, -0.21123558282852173, 0.07256967574357986, -0.02116788923740387, 0.0650695264339447, 0.2384670376777649, -0.0722302496433258, 0.06632712483406067, 0.07482384145259857, -0.033922936767339706, 0.20403170585632324, 0.030399594455957413, -0.11503792554140091, -0.12442062795162201, 0.16888011991977692, -0.10179273784160614, -0.08943246304988861, -0.19014784693717957, -0.05323999375104904, -0.18687693774700165, -0.32414695620536804, 0.14158876240253448, -0.04576991870999336, -0.1246487945318222, 0.06831289827823639, 0.6472150683403015, -0.08102503418922424, -0.3296332061290741, 0.05893462523818016, -0.06131861358880997, -0.07533247768878937, -0.04986702650785446, 0.4505349397659302, 0.2647813856601715, 0.04178062081336975, 0.21650046110153198, 0.1564793586730957, 0.7262493371963501, -0.07318124175071716, 0.28693515062332153, -0.2054191529750824, -0.09376028180122375, -0.31236588954925537, 0.3829862177371979, 0.3661455810070038, 0.08854056894779205, -0.15359127521514893, 0.13077224791049957, 0.15417738258838654, -0.17733825743198395, -0.1577223837375641, 0.07362955808639526, 0.1714129000902176, 0.1068444550037384, 0.3512134253978729, -0.09610730409622192, -0.013402268290519714, 0.19818997383117676, 0.15724605321884155, 0.1306481957435608, -0.5131985545158386, -0.031393956393003464, -0.07384046912193298, 0.07891856133937836, -0.17257407307624817, 0.3698085844516754, 0.02878677472472191, 0.19585351645946503, 0.14043939113616943, -0.29031991958618164, 0.859650194644928, 0.14117026329040527, -0.011807505041360855, 0.005049161612987518, -0.6363879442214966, -0.2854553163051605, 0.0003688707947731018, 0.04234324395656586, 0.09210656583309174, 0.11363665759563446, 0.542109489440918, 0.07418425381183624, 0.11144581437110901, -0.031337201595306396, 0.16696539521217346, -0.02315111644566059, -0.1323525607585907, 0.05500813573598862, -0.23880529403686523, -0.19651690125465393, -0.06831617653369904, 0.05995815992355347, -0.11442894488573074, 0.42009279131889343, 0.20935297012329102, -0.008105404675006866, -0.1346924602985382, 0.2617281377315521, 0.16414035856723785, 0.35649383068084717, -0.30559930205345154, -0.08151868730783463, 0.06817153096199036, 0.01650506816804409, -0.17059990763664246, 0.14721406996250153, 0.22441911697387695, 0.3373049199581146, -0.19384412467479706, 0.2342342883348465, -0.1826944798231125, 0.05544707179069519, -0.26925235986709595, 0.16867828369140625, -0.25125205516815186, 0.084527388215065, 0.2979157865047455, -0.023227250203490257, -0.07935144007205963, -0.01974080689251423, 0.29626479744911194, -0.26721322536468506, -0.14726290106773376, 0.2805653214454651, 0.01833120360970497, -0.42583906650543213, -0.06240451708436012, -0.024598348885774612, -0.20412226021289825, -0.20330539345741272, 0.3326112926006317, -0.47820571064949036, -0.004697840660810471, -0.1849629133939743, 0.012803133577108383, -0.24874189496040344, 0.4970053434371948, 0.09278319776058197, 0.3237658143043518, -0.35409101843833923, 0.004110291600227356, -0.2777794301509857, 0.02022365853190422, -0.2980722486972809, 0.10301800817251205, 0.09873795509338379, 0.5605307221412659, -0.1265905350446701, 0.21352659165859222, -0.03133731335401535, -0.11544054746627808, -0.00420578196644783, 0.6807507276535034, -0.2538990080356598, 0.1541970819234848, -0.1794411540031433, 0.06297028809785843, 0.14343103766441345, -0.41915351152420044, 0.2339937388896942, -0.1684679388999939, -0.059989191591739655, 0.05668521672487259, -0.17648884654045105, 0.42495453357696533, -0.07532362639904022, 0.36821576952934265, 0.008453229442238808, 0.1405351608991623, -0.06703658401966095, 0.22257813811302185, -0.33698615431785583, 0.12857551872730255, -0.22244106233119965, 0.0829416811466217, 0.35928305983543396, 0.1864139586687088, -0.0460435226559639, -0.01713576354086399, -0.5203310251235962, 0.2437065839767456, -0.08310943841934204, 0.09026026725769043, -0.09218078851699829, 0.02720595896244049, -0.14473889768123627, 0.4602436423301697, -0.12429918348789215, 0.33347126841545105, 0.026558222249150276, 0.0730910524725914, -0.3506823778152466, -0.09311311691999435, 0.183017298579216, -0.542122483253479, -0.165472611784935, -0.3479836881160736, 0.2708061635494232, 0.3063293695449829, 0.14489243924617767, -0.339709609746933, -0.21034659445285797, 0.22623862326145172, -0.2071261703968048, 0.099868044257164, 0.2369939386844635, 0.41248130798339844, -0.19364751875400543, -0.05049007385969162, 0.06897115707397461, 0.12735354900360107, -0.018378842622041702, -0.08178168535232544, -0.5831460356712341 ]
https://github.com/huggingface/datasets/issues/5982
This wasn’t working for me a bit earlier, but it looks to be back up now
404 on Datasets Documentation Page
### Describe the bug Getting a 404 from the Hugging Face Datasets docs page: https://huggingface.co/docs/datasets/index ### Steps to reproduce the bug 1. Go to URL https://huggingface.co/docs/datasets/index 2. Notice 404 not found ### Expected behavior URL should either show docs or redirect to new location ### Environment info hugginface.co
16
404 on Datasets Documentation Page ### Describe the bug Getting a 404 from the Hugging Face Datasets docs page: https://huggingface.co/docs/datasets/index ### Steps to reproduce the bug 1. Go to URL https://huggingface.co/docs/datasets/index 2. Notice 404 not found ### Expected behavior URL should either show docs or redirect to new location ### Environment info hugginface.co This wasn’t working for me a bit earlier, but it looks to be back up now
[ 0.2358924001455307, -0.0897052064538002, -0.038213007152080536, 0.19043193757534027, 0.17236018180847168, 0.2296682745218277, 0.030324263498187065, 0.17348481714725494, -0.0862479954957962, 0.1142839714884758, -0.04872129485011101, -0.027137374505400658, -0.05816924571990967, 0.07129813730716705, 0.3687547445297241, -0.15777014195919037, -0.02312946692109108, -0.029988016933202744, 0.012601276859641075, 0.14752213656902313, -0.07333603501319885, 0.1829535812139511, -0.2179725021123886, 0.2744944393634796, -0.3610217571258545, 0.06908731907606125, -0.06880801171064377, 0.32399284839630127, -0.20868641138076782, -0.4366743862628937, 0.4241464138031006, -0.22731924057006836, 0.10371551662683487, 0.799745500087738, -0.00011055297363782302, 0.021614007651805878, 0.3730630576610565, 0.21096476912498474, -0.40696895122528076, -0.161997452378273, -0.3535914421081543, 0.18881550431251526, -0.040781620889902115, 0.13149648904800415, -0.18560194969177246, -0.14043234288692474, -0.022911464795470238, -0.03522142767906189, -0.020610421895980835, 0.41449517011642456, 0.2528568506240845, 0.36042699217796326, 0.1525176763534546, -0.13128666579723358, 0.2037859559059143, 0.4740329086780548, -0.1035635694861412, 0.23606237769126892, -0.055372610688209534, -0.12769725918769836, 0.13260379433631897, 0.4411172866821289, 0.127406507730484, -0.24519142508506775, 0.21589693427085876, 0.16313177347183228, 0.022435065358877182, -0.08774076402187347, 0.07737751305103302, 0.29353001713752747, 0.5185800194740295, -0.1848522275686264, -0.29725515842437744, -0.30051189661026, -0.07515976577997208, 0.0108412504196167, 0.17687267065048218, -0.03560829907655716, 0.13474494218826294, 0.2569269835948944, -0.3658650517463684, -0.43012192845344543, -0.14840169250965118, 0.159440815448761, -0.06621930003166199, -0.00578862801194191, -0.15504983067512512, -0.15358291566371918, -0.1940489411354065, -0.2366819977760315, -0.12300880253314972, 0.09929370880126953, -0.017991671338677406, 0.3363933563232422, -0.00869644433259964, -0.018830247223377228, 0.2630411982536316, 0.3353389799594879, 0.387859582901001, -0.12115132063627243, -0.08122429251670837, -0.17275260388851166, -0.40351587533950806, 0.09354468435049057, 0.1048344224691391, 0.13066466152668, 0.04381948709487915, 0.054540250450372696, 0.42114394903182983, 0.5263343453407288, 0.2881001830101013, 0.0017802827060222626, 0.21487772464752197, -0.10271584242582321, -0.22238948941230774, -0.25979816913604736, 0.4777456223964691, -0.2702704966068268, -0.3701501488685608, 0.16726025938987732, -0.11172280460596085, -0.06857528537511826, 0.23354244232177734, 0.2772066593170166, 0.10587060451507568, -0.10455159842967987, 0.1548643261194229, -0.2446833848953247, -0.22512567043304443, -0.06683500856161118, -0.28400948643684387, -0.07424408942461014, -0.18700316548347473, 0.24779033660888672, 0.03753988444805145, -0.0700749009847641, 0.364128053188324, 0.015148859471082687, 0.13090567290782928, 0.013668738305568695, -0.20472359657287598, 0.3203529119491577, 0.1704375147819519, 0.16658085584640503, 0.01235402375459671, 0.1255725771188736, -0.020189860835671425, -0.2685287594795227, 0.044799938797950745, -0.12125822901725769, -0.47567102313041687, -0.21830502152442932, -0.0585329607129097, 0.18611156940460205, 0.03679439425468445, 0.056054893881082535, 0.05285556614398956, 0.03872405365109444, -0.11644705384969711, -0.06988049298524857, 0.13342313468456268, 0.29633828997612, -0.05706195533275604, -0.08215248584747314, 0.37169575691223145, 0.4870899021625519, 0.20939747989177704, -0.18863815069198608, 0.24451452493667603, -0.06599637866020203, -0.21862350404262543, 0.2803043723106384, -0.11744796484708786, 0.2787681818008423, -0.6120816469192505, -0.06678506731987, 0.04121048375964165, -0.4780372381210327, -0.2345442771911621, -0.041426412761211395, -0.31019335985183716, 0.06211061775684357, -0.21798603236675262, -0.26867857575416565, -0.23113855719566345, -0.01317502185702324, 0.33898064494132996, 0.08032502233982086, 0.0054022036492824554, -0.023825589567422867, -0.3322817087173462, -0.1204836368560791, -0.05133363977074623, -0.15408241748809814, -0.018185356631875038, -0.052626851946115494, 0.12988066673278809, -0.09839244186878204, 0.3119328022003174, -0.06597773730754852, -0.038866009563207626, 0.6114993691444397, 0.36613237857818604, 0.0077242860570549965, 0.19344556331634521, -0.21073250472545624, -0.3178957998752594, -0.007054977118968964, 0.11716845631599426, -0.05603491887450218, 0.18005724251270294, -0.3373832702636719, -0.4570516347885132, -0.03439319133758545, -0.23601077497005463, -0.36700254678726196, 0.14197036623954773, 0.14201024174690247, 0.08650345355272293, 0.46587279438972473, -0.26432445645332336, 0.2401965707540512, -0.17219892144203186, 0.32767465710639954, -0.4238034188747406, 0.3125269412994385, 0.03092748112976551, -0.07272562384605408, 0.05008941888809204, 0.251274049282074, 0.2326502501964569, 0.030142098665237427, 0.13831327855587006, 0.3939720690250397, 0.05406980589032173, 0.26761767268180847, 0.5152707099914551, -0.06982399523258209, 0.29163166880607605, -0.3437153697013855, -0.13332226872444153, 0.211805060505867, -0.0450790598988533, 0.1928931474685669, -0.2522503733634949, -0.04100850969552994, -0.25112611055374146, 0.25201329588890076, 0.21789835393428802, 0.09621946513652802, 0.1759396493434906, -0.10764031857252121, -0.2772707939147949, -0.3665049076080322, 0.23068159818649292, -0.28579580783843994, 0.14697489142417908, -0.16094955801963806, -0.3387960195541382, 0.07363545894622803, 0.13775895535945892, 0.012640416622161865, 0.044428229331970215, 0.2389327436685562, -0.206020787358284, 0.033284373581409454, 0.2316490262746811, 0.1272987425327301, -0.01956428587436676, 0.17575708031654358, 0.20392584800720215, 0.1919037401676178, 0.016037970781326294, -0.08984699845314026, 0.15527716279029846, -0.11809505522251129, -0.19039219617843628, 0.11305417120456696, 0.024226348847150803, 0.05110828951001167, -0.3355221152305603, -0.05335748940706253, -0.3738160729408264, -0.02314535155892372, -0.5386226177215576, -0.11404334753751755, -0.34968799352645874, -0.4803526997566223, -0.2094530463218689, -0.25806695222854614, -0.46764513850212097, -0.20268574357032776, -0.05087696388363838, -0.10490438342094421, -0.10600116103887558, -0.08399725705385208, -0.12686192989349365, 0.14001381397247314, 0.011563651263713837, 0.16414815187454224, -0.39622220396995544, 0.13612215220928192, -0.3002017140388489, 0.038697462528944016, -0.08296847343444824, -0.020167285576462746, 0.26963040232658386, -0.407639741897583, 0.014774754643440247, -0.6578959822654724, -0.6409288048744202, 0.17581433057785034, 0.1531447321176529, 0.26687371730804443, 0.2863561511039734, 0.15691788494586945, 0.04193006455898285, -0.04001215845346451, 0.20152632892131805, -0.012740399688482285, -0.17620277404785156, -0.20889171957969666, 0.12303294241428375, 0.07306405901908875, -0.14591844379901886, -0.12177716940641403, 0.11941691488027573, -0.14136117696762085, 0.0889534056186676, -0.15309879183769226, -0.09612058103084564, 0.07085192203521729, -0.045589983463287354, 0.43655359745025635, -0.3647821545600891, -0.0803576409816742, -0.2002492994070053, -0.6014858484268188, 0.18455186486244202, -0.2811174690723419, -0.2375672161579132, 0.19630680978298187, 0.11954707652330399, 0.19877035915851593, -0.02482382394373417, -0.4835933744907379, 0.02232423424720764, -0.15562601387500763, 0.09715287387371063, 0.17486314475536346, 0.18078160285949707, 0.20691239833831787, 0.1312360167503357, -0.07683613896369934, 0.012597218155860901, -0.38720667362213135, -0.28714507818222046, -0.03747054561972618, 0.534272313117981, -0.032296743243932724, 0.16802304983139038, 0.2030588686466217, 0.2666134834289551, 0.3094278573989868, 0.20270732045173645, 0.4106009602546692, 0.027589404955506325, 0.7114124298095703, -0.11942609399557114, -0.3029896914958954, 0.011779941618442535, 0.11739438027143478, -0.03819020092487335, 0.08100221306085587, 0.5543354749679565, 0.1972680538892746, -0.2426256239414215, -0.42840778827667236, -0.2010987550020218, -0.29035288095474243, -0.4686852991580963, 0.09713852405548096, 0.23408430814743042, 0.14641410112380981, 0.06364225596189499, 0.2054506540298462, -0.03553768992424011, 0.28447872400283813, 0.6286875009536743, 0.25828447937965393, 0.1233619749546051, -0.23688635230064392, 0.17526260018348694, -0.5801035761833191, -0.017108328640460968, -0.023665880784392357, 0.10280263423919678, -0.14689001441001892, -0.10029654204845428, 0.015328813344240189, -0.015290632843971252, 0.47789761424064636, -0.06823647022247314, 0.190206378698349, -0.1860208809375763, -0.025865036994218826, -0.20315757393836975, 0.1251140981912613, 0.1861337572336197, 0.2551977336406708, 0.2026696801185608, 0.6379334926605225, -0.2314862459897995, -0.1707177460193634, 0.22307728230953217, -0.2848871350288391, 0.00865696370601654, -0.003588523715734482, -0.20540353655815125, -0.3391842246055603, 0.18706843256950378, -0.03803933039307594, -0.018333476036787033, -0.11338408291339874, 0.17881837487220764, -0.1794079840183258, 0.021024374291300774, -0.13019299507141113, -0.06085191294550896, 0.027086541056632996, 0.3328261971473694, -0.1645987629890442, 0.1557816118001938, 0.6371236443519592, 0.32690566778182983, 0.4711070656776428, 0.1722475290298462, -0.28960898518562317, -0.4548197090625763, -0.07869072258472443, -0.026679769158363342, 0.42835110425949097, 0.4484523832798004, -0.11288757622241974, -0.06877848505973816, 0.25012949109077454, 0.1117035374045372, -0.3570888638496399, 0.08168665319681168, 0.33850589394569397, 0.07782891392707825, -0.2429179847240448, 0.01033366471529007, 0.24902476370334625, 0.1020854264497757, -0.06278881430625916, 0.4506632089614868, 0.7809151411056519, -0.48299509286880493, -0.17854319512844086, 0.012751346454024315, 0.7987294793128967, 0.09032690525054932, 0.1230812519788742, 0.3206465244293213, -0.4183880090713501, 0.32981905341148376, 0.1044510006904602, 0.08152452111244202, -0.1573011875152588, 0.05233045667409897, -0.04464156925678253, -0.10112467408180237, 0.10000933706760406, -0.289977490901947, -0.019900426268577576, 0.309270977973938, -0.15842515230178833, 0.2693083584308624, 0.18234989047050476, 0.23443838953971863, 0.02493678592145443, 0.08448472619056702, -0.1760392040014267, 0.1936914175748825, 0.038410261273384094, 0.250277578830719, -0.19010931253433228, -0.132284015417099, -0.17750610411167145, -0.37291502952575684, -0.13302506506443024, -0.035575177520513535, 0.09974733740091324, -0.18289871513843536, 0.1673973798751831, -0.3912888765335083, -0.0006634518504142761, 0.3660103678703308, 0.19402334094047546, 0.18551859259605408, -0.6834622621536255, 0.2970140874385834, -0.36033952236175537, 0.0058547742664813995, -0.1743633896112442, -0.20127759873867035, -0.015077192336320877, 0.0015597715973854065, -0.18419474363327026, -0.05781867727637291, -0.009515851736068726, -0.09188111871480942, -0.3150825798511505, 0.0717521607875824, -0.3098433315753937, -0.25586605072021484, 0.17604053020477295, 0.022775623947381973, 0.23065043985843658, -0.28756237030029297, 0.15772861242294312, 0.11841925233602524, -0.08120891451835632, -0.24917778372764587, 0.4726327955722809, -0.011375628411769867, -0.09542419761419296, 0.3498031198978424, -0.34718701243400574, 0.10101266205310822, 0.11546124517917633, -0.00021498650312423706, -0.2861190140247345, -0.15853393077850342, 0.06429789215326309, 0.426884263753891, -0.071759432554245, 0.1019352376461029, -0.03871094807982445, 0.2787959575653076, 0.07918702811002731, -0.1625034213066101, -0.0006853530067019165, -0.4412093162536621, -0.20524075627326965, -0.18955162167549133, -0.0573725551366806, 0.3408598005771637, -0.2651306688785553, 0.17395243048667908, 0.006420262157917023, -0.08332571387290955, 0.11955530196428299, -0.335713267326355, -0.31708773970603943, 0.18476393818855286, -0.1669500172138214, -0.05421061813831329, 0.14713293313980103, -0.015330290421843529, 0.24025355279445648, -0.2139841467142105, 0.0985214039683342, -0.08630678057670593, 0.0326010026037693, -0.16980287432670593, -0.04289714992046356, 0.07028806954622269, 0.033053264021873474, -0.09861093759536743, 0.13251188397407532, 0.030908726155757904, -0.02692798711359501, -0.1630399078130722, 0.06250167638063431, 0.2338724434375763, 0.13414745032787323, -0.0795060396194458, -0.09199471771717072, -0.05022568628191948, 0.13026052713394165, 0.21892474591732025, 0.06349079310894012, 0.1231713593006134, 0.1281510293483734, -0.06395158171653748, -0.3560788631439209, -0.012785866856575012, 0.3405207395553589, 0.14642539620399475, 0.04462480917572975, 0.09801586717367172, 0.3464587330818176, -0.32350048422813416, -0.1621856689453125, 0.1962270438671112, 0.31224268674850464, 0.09250754117965698, -0.2614195644855499, 0.013639770448207855, 0.2812730073928833, 0.1643579751253128, -0.03474720939993858, -0.1901063174009323, 0.41746842861175537, 0.1507267951965332, -0.073668472468853, -0.03768078237771988, 0.0027967840433120728, -0.0302559956908226, -0.01984281837940216, 0.14897263050079346, 0.5036076307296753, 0.06833221018314362, 0.0902424156665802, 0.048884738236665726, -0.14829982817173004, 0.06535149365663528, 0.007826721295714378, -0.03192344307899475, 0.054357364773750305, 0.20132645964622498, 0.0011519305408000946, 0.053687676787376404, -0.020126253366470337, 0.4388338029384613, 0.07455675303936005, -0.1949569284915924, -0.13505932688713074, -0.23854400217533112, -0.016546480357646942, -0.025435782968997955, -0.03549700975418091, 0.38526561856269836, 0.039212122559547424, -0.04635901376605034, -0.1604638397693634, 0.0769137591123581, -0.18038596212863922, 0.07742331176996231, 0.08613048493862152, -0.27488887310028076, 0.259245365858078, -0.03702082857489586, 0.022813530638813972, -0.2824123203754425, -0.08205762505531311, -0.2657691538333893, -0.05845203250646591, -0.6629732251167297, 0.15295524895191193, 0.16208072006702423, 0.23826579749584198, 0.03353040665388107, 0.1309325098991394, -0.040294814854860306, -0.08155298978090286, -0.04337457939982414, 0.34914493560791016, 0.2877214550971985, 0.15437620878219604, 0.1556665450334549, -0.004707213491201401, -0.09060733020305634, -0.15116432309150696, 0.014166094362735748, 0.21421301364898682, -0.12426131218671799, -0.3106028735637665, 0.17915290594100952, 0.1891690194606781, -0.1699615716934204, -0.08610352873802185, -0.15309178829193115, 0.4257146120071411, -0.23964738845825195, -0.15682527422904968, -0.5501759648323059, 0.06262551248073578, -0.1979711502790451, -0.04402480646967888, -0.2958120107650757, 0.12245654314756393, 0.44339707493782043, -0.044435352087020874, 0.06000753492116928, -0.11514249444007874, 0.06442298740148544, 0.1479993462562561, 0.3571913242340088, 0.45494094491004944, 0.20900091528892517, 0.0657663643360138, -0.3897355794906616, -0.5351764559745789, 0.07485973834991455, -0.14718274772167206, 0.13996578752994537, -0.007876651361584663, 0.009921960532665253, -0.4946463704109192, -0.17272287607192993, 0.5708698630332947, -0.037856485694646835, 0.17313966155052185, -0.06885376572608948, -0.11621758341789246, 0.014468003064393997, -0.07973553240299225, -0.04724889621138573, -0.017973966896533966, 0.01705889403820038, 0.3263840973377228, 0.018623601645231247, -0.01648809388279915, -0.0024773944169282913, 0.40896257758140564, -0.391764760017395, 0.029491379857063293, 0.33492928743362427, 0.28249257802963257, -0.07868754863739014, -0.015584565699100494, -0.2912624478340149, -0.40106263756752014, -0.11584535241127014, -0.02825513482093811, 0.24629653990268707, -0.0375622883439064, 0.020348921418190002, -0.3037320375442505, -0.5745716094970703, -0.27351266145706177, 0.6165804862976074, 0.27436912059783936, 0.16564685106277466, -0.11789317429065704, 0.15374508500099182, -0.06248869746923447, -0.13027535378932953, 0.17529353499412537, 0.03632368892431259, -0.07412349432706833, -0.024922195822000504, 0.03157751262187958, -0.2592107951641083, 0.6405751705169678, -0.26853761076927185, 0.19093258678913116, -0.07530267536640167, 0.28764432668685913, 0.5616580843925476, -0.3697429597377777, -0.5462663769721985, -0.20811353623867035, 0.28654682636260986, 0.3207412660121918, -0.25316178798675537, 0.1421300172805786, -0.1735980063676834, 0.0809333324432373, 0.07189923524856567, 0.43202346563339233, 0.2855875492095947, -0.14543399214744568, 0.4867973029613495, -0.029744483530521393 ]
https://github.com/huggingface/datasets/issues/5982
We had a minor issue updating the docs after the latest release. It should work now :).
404 on Datasets Documentation Page
### Describe the bug Getting a 404 from the Hugging Face Datasets docs page: https://huggingface.co/docs/datasets/index ### Steps to reproduce the bug 1. Go to URL https://huggingface.co/docs/datasets/index 2. Notice 404 not found ### Expected behavior URL should either show docs or redirect to new location ### Environment info hugginface.co
17
404 on Datasets Documentation Page ### Describe the bug Getting a 404 from the Hugging Face Datasets docs page: https://huggingface.co/docs/datasets/index ### Steps to reproduce the bug 1. Go to URL https://huggingface.co/docs/datasets/index 2. Notice 404 not found ### Expected behavior URL should either show docs or redirect to new location ### Environment info hugginface.co We had a minor issue updating the docs after the latest release. It should work now :).
[ 0.17083513736724854, -0.21462519466876984, -0.02505388669669628, 0.2500726580619812, 0.15249451994895935, 0.2086954116821289, 0.030402902513742447, 0.18846707046031952, -0.06417596340179443, 0.19951173663139343, -0.07982753217220306, 0.026617862284183502, -0.07252615690231323, 0.15393909811973572, 0.28752434253692627, -0.15732529759407043, -0.005507852882146835, -0.02575387805700302, -0.045685961842536926, 0.15444627404212952, -0.04824599623680115, 0.22651655972003937, -0.21269068121910095, 0.2709042727947235, -0.39380863308906555, 0.06147146224975586, -0.1229729875922203, 0.32301899790763855, -0.246861070394516, -0.38566508889198303, 0.34871697425842285, -0.23418307304382324, 0.09790186583995819, 0.808532178401947, -0.00010863086208701134, 0.01459801197052002, 0.325660765171051, 0.1729215681552887, -0.3276682496070862, -0.1755692958831787, -0.26466915011405945, 0.17784175276756287, -0.04830504581332207, 0.12895320355892181, -0.21758341789245605, -0.1469752937555313, -0.017465582117438316, -0.05031247064471245, 0.07836969196796417, 0.4050638973712921, 0.2706875503063202, 0.3735616207122803, 0.18000052869319916, -0.19390098750591278, 0.16646981239318848, 0.4595188796520233, -0.13528215885162354, 0.24556803703308105, -0.0986856073141098, -0.1146426796913147, 0.15986108779907227, 0.4234031140804291, 0.1812422126531601, -0.2549845576286316, 0.2631858289241791, 0.13649293780326843, -0.018448978662490845, -0.1283075511455536, 0.06161600723862648, 0.3086141049861908, 0.5172632932662964, -0.1382979303598404, -0.298284649848938, -0.2963023781776428, -0.08211691677570343, 0.013097114861011505, 0.19598931074142456, 0.0097811259329319, 0.1749328076839447, 0.21686938405036926, -0.4178926348686218, -0.3895552158355713, -0.1782708764076233, 0.1449490338563919, 0.017218656837940216, -0.10622020065784454, -0.16793525218963623, -0.08384217321872711, -0.13033048808574677, -0.2779172658920288, -0.17609882354736328, 0.09563086926937103, -0.007179169449955225, 0.3315162658691406, -0.04956855624914169, -0.06756312400102615, 0.19156700372695923, 0.31856074929237366, 0.37696290016174316, -0.1279490888118744, -0.047824226319789886, -0.20935119688510895, -0.33608686923980713, 0.1337476670742035, 0.09787897020578384, 0.1273861825466156, 0.0780484601855278, -0.007045980542898178, 0.3941417336463928, 0.4450947642326355, 0.30471527576446533, -0.034218788146972656, 0.24054411053657532, -0.07182209193706512, -0.23962710797786713, -0.2707018554210663, 0.39630237221717834, -0.27306950092315674, -0.34308287501335144, 0.07469481974840164, -0.0645083338022232, -0.037828341126441956, 0.22546789050102234, 0.31272852420806885, 0.08011828362941742, -0.18297001719474792, 0.105645552277565, -0.2230457067489624, -0.20374354720115662, -0.09826301038265228, -0.30515655875205994, -0.060905821621418, -0.15629762411117554, 0.2285487800836563, 0.05559521168470383, -0.1792413741350174, 0.40172097086906433, 0.014287926256656647, 0.13947689533233643, 0.08163510262966156, -0.1905212700366974, 0.3048337697982788, 0.12700162827968597, 0.174051433801651, 0.048198550939559937, 0.056722477078437805, -0.004582307301461697, -0.24281121790409088, 0.04340773820877075, -0.1197943240404129, -0.40925073623657227, -0.24403448402881622, -0.08894605189561844, 0.19598907232284546, 0.015823647379875183, 0.06508159637451172, 0.02320726588368416, 0.07102112472057343, -0.1242445707321167, -0.11597246676683426, 0.09263494610786438, 0.26051872968673706, -0.11454341560602188, -0.09929738938808441, 0.3369385302066803, 0.4579518437385559, 0.1446247100830078, -0.16653530299663544, 0.22419151663780212, -0.09284816682338715, -0.22507244348526, 0.3126608431339264, -0.061039745807647705, 0.20282502472400665, -0.6137979626655579, -0.026825010776519775, 0.031025201082229614, -0.4140518307685852, -0.20226918160915375, -0.05096527561545372, -0.29232415556907654, 0.023103050887584686, -0.22899821400642395, -0.2511521279811859, -0.20257803797721863, -0.03690056502819061, 0.29205334186553955, 0.08304271847009659, -0.0017691506072878838, -0.03972524404525757, -0.30238646268844604, -0.0958728939294815, -0.010343201458454132, -0.13081637024879456, -0.07180874794721603, -0.060965992510318756, 0.20911601185798645, -0.15243130922317505, 0.19799931347370148, -0.04587072506546974, -0.044924914836883545, 0.6156235337257385, 0.4092022776603699, 0.04558804631233215, 0.19244414567947388, -0.18882082402706146, -0.3225975036621094, 0.007277972996234894, 0.04249197244644165, -0.08720119297504425, 0.16086551547050476, -0.32943686842918396, -0.4322132170200348, -0.050343967974185944, -0.2009047567844391, -0.3372350037097931, 0.1547776609659195, 0.12334997951984406, 0.18666310608386993, 0.4352378845214844, -0.23590238392353058, 0.31434935331344604, -0.1264251172542572, 0.2807328701019287, -0.46755293011665344, 0.34969887137413025, -0.026522742584347725, -0.13791880011558533, 0.11521412432193756, 0.26147159934043884, 0.2198934406042099, 0.009454876184463501, 0.09856399148702621, 0.43534713983535767, 0.0022429637610912323, 0.20931367576122284, 0.5080893635749817, -0.08200891315937042, 0.28974127769470215, -0.3669903874397278, -0.1504196673631668, 0.1827680766582489, -0.0689774602651596, 0.19798684120178223, -0.29381754994392395, -0.04053570330142975, -0.2553686499595642, 0.2118852287530899, 0.1580124795436859, 0.10715056955814362, 0.18303093314170837, -0.05850010737776756, -0.2761414647102356, -0.32675817608833313, 0.24669671058654785, -0.32966938614845276, 0.17124193906784058, -0.12302828580141068, -0.419422447681427, 0.08702240884304047, 0.27293097972869873, 0.07362426817417145, -0.0018591061234474182, 0.27827927470207214, -0.17101599276065826, 0.02360451966524124, 0.241562619805336, 0.05988036096096039, 0.048604413866996765, 0.17771458625793457, 0.16843725740909576, 0.19498662650585175, 0.055696506053209305, -0.046004027128219604, 0.1182718425989151, -0.12127027660608292, -0.16546577215194702, 0.05470055714249611, 0.046663593500852585, 0.03666400536894798, -0.3566679060459137, -0.055448442697525024, -0.3483198583126068, -0.0000646635890007019, -0.5037516951560974, -0.16808970272541046, -0.327621728181839, -0.4803008437156677, -0.1704251766204834, -0.2916579842567444, -0.5376355648040771, -0.1629842221736908, 0.006736347451806068, -0.08918540924787521, -0.13085633516311646, -0.054343290627002716, -0.014373928308486938, 0.2202541083097458, 0.035625942051410675, 0.16441211104393005, -0.44201013445854187, 0.17592833936214447, -0.29723799228668213, 0.05675502121448517, -0.11769293248653412, -0.013849452137947083, 0.3085046708583832, -0.4057002067565918, 0.05703769624233246, -0.6185842752456665, -0.6367939114570618, 0.17159971594810486, 0.05470871552824974, 0.289763480424881, 0.272363543510437, 0.20163016021251678, -0.03736931085586548, -0.040676333010196686, 0.20378004014492035, -0.09579593688249588, -0.22799694538116455, -0.17952200770378113, 0.1540946662425995, 0.04439001902937889, -0.19924233853816986, -0.13926641643047333, 0.008323019370436668, -0.15449751913547516, 0.18769973516464233, -0.15880823135375977, -0.10668575763702393, 0.05481867119669914, -0.012163437902927399, 0.4585658013820648, -0.36818236112594604, -0.025669949129223824, -0.19828352332115173, -0.6351599097251892, 0.23090358078479767, -0.36333009600639343, -0.3235817849636078, 0.26800328493118286, 0.16745975613594055, 0.15857356786727905, -0.1014840304851532, -0.4973873794078827, -0.0764208734035492, -0.16901448369026184, 0.09049490094184875, 0.16522234678268433, 0.14738783240318298, 0.2342245727777481, 0.12678341567516327, -0.07358761131763458, -0.024022653698921204, -0.41557225584983826, -0.2035077065229416, -0.06431600451469421, 0.5440757274627686, -0.03562307357788086, 0.2179628312587738, 0.23907563090324402, 0.20885713398456573, 0.35201162099838257, 0.17837975919246674, 0.3505597412586212, 0.03123634122312069, 0.6998935341835022, -0.19908975064754486, -0.29051917791366577, 0.11616114526987076, 0.08921931684017181, 0.025606215000152588, 0.0876823216676712, 0.5532737374305725, 0.20540077984333038, -0.27455031871795654, -0.42306238412857056, -0.18003761768341064, -0.24474039673805237, -0.49639609456062317, 0.13986316323280334, 0.20235100388526917, 0.13377781212329865, -0.007391087710857391, 0.19971336424350739, -0.059165794402360916, 0.285083532333374, 0.6326463222503662, 0.24958279728889465, 0.2050693929195404, -0.20462441444396973, 0.1674080789089203, -0.5812714695930481, 0.04668944329023361, -0.06209102272987366, 0.08063852787017822, -0.1940925568342209, -0.04377821460366249, 0.01911015436053276, 0.013128068298101425, 0.4793347716331482, -0.028049204498529434, 0.14808258414268494, -0.2305499166250229, -0.09141236543655396, -0.251036673784256, 0.15681837499141693, 0.16390451788902283, 0.1825471669435501, 0.2289210557937622, 0.6182613372802734, -0.30667775869369507, -0.18047049641609192, 0.2071714997291565, -0.2260662317276001, -0.01013578474521637, -0.10765351355075836, -0.1976243108510971, -0.3147270083427429, 0.13238699734210968, -0.06569778919219971, 0.0013870075345039368, -0.05586810037493706, 0.16036246716976166, -0.18233749270439148, 0.022374765947461128, -0.15195298194885254, -0.038313817232847214, 0.03210866078734398, 0.3510652184486389, -0.16469275951385498, 0.18304553627967834, 0.6060044765472412, 0.3486402630805969, 0.39502647519111633, 0.1976436823606491, -0.23932576179504395, -0.48376601934432983, -0.0794651061296463, -0.0997433140873909, 0.3963397741317749, 0.3116846978664398, -0.15124040842056274, -0.05709897726774216, 0.1917814314365387, 0.2141074687242508, -0.28298622369766235, 0.1262730360031128, 0.320280522108078, 0.05367804691195488, -0.24826782941818237, 0.023626744747161865, 0.23975211381912231, 0.07987449318170547, 0.030931249260902405, 0.4518755376338959, 0.7317606210708618, -0.38986313343048096, -0.13839828968048096, -0.05602237954735756, 0.8059661984443665, 0.05492467060685158, 0.09238618612289429, 0.2903202772140503, -0.41607561707496643, 0.34916046261787415, 0.155766561627388, 0.06278093159198761, -0.1658567637205124, -0.032266825437545776, -0.034933172166347504, -0.05374928191304207, 0.06374937295913696, -0.2580195665359497, -0.06851821392774582, 0.3196522295475006, -0.0943511575460434, 0.25139331817626953, 0.12244035303592682, 0.2636534869670868, 0.014228755608201027, 0.0320168063044548, -0.1830330193042755, 0.19872473180294037, 0.010109086520969868, 0.21589873731136322, -0.10790342837572098, -0.187560573220253, -0.1292169988155365, -0.34425100684165955, -0.08894532918930054, -0.039397139102220535, 0.0876760259270668, -0.19257327914237976, 0.21309894323349, -0.37313902378082275, 0.04759412258863449, 0.3951851427555084, 0.19591373205184937, 0.2026532143354416, -0.6617411375045776, 0.23481318354606628, -0.34436488151550293, -0.08562981337308884, -0.19844591617584229, -0.1381458044052124, -0.03311002999544144, -0.054273851215839386, -0.18698865175247192, -0.049532853066921234, -0.007718563079833984, -0.08003666251897812, -0.24944858253002167, 0.04162526875734329, -0.3566973805427551, -0.21107859909534454, 0.14232975244522095, -0.04295313358306885, 0.20662975311279297, -0.2602698504924774, 0.18043965101242065, 0.13336621224880219, -0.10231713950634003, -0.21268916130065918, 0.45417606830596924, -0.05380403995513916, -0.124590203166008, 0.3473367691040039, -0.4382892847061157, 0.08266307413578033, 0.13620075583457947, 0.04397866874933243, -0.29654115438461304, -0.13695186376571655, 0.0533551350235939, 0.4148109257221222, -0.155628502368927, 0.10687752068042755, -0.024197392165660858, 0.31346452236175537, 0.057924553751945496, -0.08630916476249695, 0.03903950750827789, -0.46207889914512634, -0.14120039343833923, -0.21134895086288452, -0.1451846808195114, 0.2969251573085785, -0.2548857033252716, 0.16761715710163116, 0.017047762870788574, -0.061405204236507416, 0.1497245728969574, -0.289387583732605, -0.34577104449272156, 0.16398072242736816, -0.19076991081237793, -0.052331868559122086, 0.1891254186630249, -0.040237147361040115, 0.2553175687789917, -0.1966570019721985, 0.11173487454652786, -0.019103609025478363, -0.0173721294850111, -0.17409907281398773, -0.03411296382546425, 0.07477660477161407, 0.031568869948387146, -0.09913653880357742, 0.09368188679218292, -0.01594347506761551, -0.085502490401268, -0.11500532180070877, 0.06788130104541779, 0.23697113990783691, 0.09759575128555298, -0.08889312297105789, -0.1450228989124298, -0.05121269449591637, 0.13791786134243011, 0.18414989113807678, 0.14553681015968323, 0.11635126918554306, 0.0987648218870163, -0.07972955703735352, -0.3533755838871002, -0.04050152748823166, 0.3486793041229248, 0.08379600942134857, 0.03933671489357948, 0.07920653373003006, 0.3500820994377136, -0.30828744173049927, -0.10201901942491531, 0.15090562403202057, 0.35723480582237244, 0.03750395402312279, -0.26942622661590576, 0.068797767162323, 0.33004868030548096, 0.16831856966018677, -0.08114850521087646, -0.12466158717870712, 0.39709168672561646, 0.23823285102844238, -0.05314246192574501, -0.025386996567249298, 0.03200973570346832, 0.022950902581214905, -0.026075363159179688, 0.20077846944332123, 0.5306116342544556, 0.030742205679416656, 0.04406677186489105, 0.05162086710333824, -0.1416979730129242, 0.056778326630592346, 0.08383466303348541, 0.04587535187602043, 0.027490708976984024, 0.21892839670181274, -0.0617746077477932, 0.060301803052425385, -0.07141774892807007, 0.40959709882736206, 0.1147184818983078, -0.19380632042884827, -0.09794382750988007, -0.175408273935318, 0.006286222487688065, -0.05663245543837547, -0.05271918699145317, 0.42927414178848267, -0.037951428443193436, -0.1057407557964325, -0.19132015109062195, 0.09201300889253616, -0.15557268261909485, 0.08700543642044067, 0.08141696453094482, -0.23562940955162048, 0.20085622370243073, -0.014958292245864868, 0.06961365044116974, -0.2613013684749603, -0.007210869342088699, -0.24516259133815765, -0.023589622229337692, -0.6173763871192932, 0.11534479260444641, 0.1835273802280426, 0.21830636262893677, 0.026281267404556274, 0.1508028358221054, 0.0016556046903133392, -0.07308892905712128, 0.007761125452816486, 0.3319757282733917, 0.32330650091171265, 0.12362562865018845, 0.17914028465747833, 0.06004634499549866, -0.07843416184186935, -0.18747371435165405, 0.03763146698474884, 0.26243114471435547, -0.08954416215419769, -0.2910497188568115, 0.24138224124908447, 0.1865185797214508, -0.1839504987001419, -0.014997826889157295, -0.1923266500234604, 0.5189120769500732, -0.25163984298706055, -0.1494225561618805, -0.5544780492782593, 0.07618051767349243, -0.22716043889522552, -0.075349822640419, -0.341767281293869, 0.1412232220172882, 0.41995951533317566, -0.026833925396203995, 0.016317468136548996, -0.16051530838012695, 0.07368247956037521, 0.14098557829856873, 0.3732883036136627, 0.4712529182434082, 0.23410290479660034, 0.06011676415801048, -0.38578641414642334, -0.5060359835624695, 0.06352821737527847, -0.11261671781539917, 0.20417243242263794, -0.03100854903459549, 0.0247514545917511, -0.5017668008804321, -0.15102460980415344, 0.6063290238380432, -0.012999333441257477, 0.1620902419090271, -0.06189867481589317, -0.13435791432857513, 0.01369013637304306, -0.12402693927288055, -0.039674945175647736, 0.057319194078445435, 0.10339243710041046, 0.3240325152873993, 0.013417448848485947, 0.005677700042724609, 0.021443534642457962, 0.3935861587524414, -0.40240973234176636, 0.015055783092975616, 0.2810044586658478, 0.27903038263320923, -0.06793248653411865, -0.02727605029940605, -0.22724977135658264, -0.30121299624443054, -0.11742820590734482, -0.07175516337156296, 0.1952488124370575, -0.005303432699292898, 0.0890938937664032, -0.30843114852905273, -0.5679331421852112, -0.28744441270828247, 0.6011561155319214, 0.2480260282754898, 0.15851978957653046, -0.10530227422714233, 0.17762114107608795, -0.021138116717338562, -0.13539192080497742, 0.20413750410079956, 0.030484100803732872, -0.07336632162332535, -0.06419926881790161, 0.019839733839035034, -0.2351241111755371, 0.68965083360672, -0.2782971262931824, 0.15563425421714783, -0.08359015733003616, 0.21172930300235748, 0.5868423581123352, -0.4007367491722107, -0.5804283618927002, -0.147677481174469, 0.2591800093650818, 0.3000960946083069, -0.18141742050647736, 0.13394835591316223, -0.23464667797088623, 0.09483508765697479, 0.07655548304319382, 0.48273396492004395, 0.33362871408462524, -0.12617048621177673, 0.5193454623222351, -0.04855666309595108 ]
https://github.com/huggingface/datasets/issues/5981
I think it's more likely that this issue is related to PyTorch than Datasets, as PyTorch (on import) registers functions to execute when forking a process. Maybe this is the culprit: https://github.com/pytorch/pytorch/issues/99625
Only two cores are getting used in sagemaker with pytorch 3.10 kernel
### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
32
Only two cores are getting used in sagemaker with pytorch 3.10 kernel ### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel I think it's more likely that this issue is related to PyTorch than Datasets, as PyTorch (on import) registers functions to execute when forking a process. Maybe this is the culprit: https://github.com/pytorch/pytorch/issues/99625
[ -0.16755031049251556, -0.698649525642395, -0.006346769630908966, 0.3419397175312042, -0.08470866829156876, -0.290692538022995, 0.17301566898822784, 0.061169158667325974, 0.36152422428131104, 0.2239425778388977, -0.09223724901676178, 0.6258037090301514, 0.17458635568618774, 0.04712916910648346, -0.15570229291915894, 0.09349585324525833, 0.2597576975822449, 0.09132017195224762, -0.014752913266420364, -0.0016262531280517578, -0.14717358350753784, 0.5697405934333801, -0.04418962448835373, -0.2275059074163437, -0.21884803473949432, 0.22291772067546844, 0.31872543692588806, 0.2357386350631714, 0.3035767674446106, -0.2511754631996155, -0.050009261816740036, 0.0070148054510355, -0.08806409686803818, 0.25890034437179565, -0.0001259471318917349, 0.1156168133020401, -0.061715204268693924, 0.23891398310661316, -0.0815456286072731, -0.17547707259655, 0.35363146662712097, -0.1928817331790924, 0.03853141516447067, -0.12212018668651581, -0.3029044270515442, 0.4861268997192383, -0.3716069161891937, -0.2371806800365448, 0.308594673871994, 0.17213603854179382, 0.05802103504538536, 0.4175121784210205, -0.004449792206287384, 0.05619695037603378, 0.06778120994567871, 0.21470725536346436, -0.14013662934303284, 0.02477310225367546, 0.37184491753578186, -0.0864512026309967, 0.13934063911437988, 0.5126333832740784, -0.0031074434518814087, 0.2944212853908539, 0.509090006351471, 0.05375657230615616, -0.00009835697710514069, -0.4114382863044739, 0.19149978458881378, 0.037956226617097855, -0.4234714210033417, 0.07123411446809769, 0.03592675179243088, -0.3549829125404358, -0.3954257369041443, -0.4700077176094055, 0.30460184812545776, -0.10609210282564163, -0.23686721920967102, -0.19592496752738953, 0.03730425983667374, -0.05957178771495819, -0.08281922340393066, -0.028197485953569412, 0.18876364827156067, 0.6050975918769836, 0.04189351573586464, 0.2136332392692566, 0.49267271161079407, 0.3435560464859009, -0.5149456858634949, 0.13165122270584106, 0.14218641817569733, -0.09987588226795197, -0.5186396241188049, 0.21082958579063416, 0.13703960180282593, 0.3251979351043701, -0.2749980390071869, 0.24403351545333862, 0.2057742476463318, 0.3358207941055298, 0.18528535962104797, 0.10946677625179291, -0.0026429742574691772, -0.14175225794315338, 0.3818313479423523, 0.024612125009298325, 0.1807878613471985, 0.44188326597213745, 0.12248361110687256, 0.023854847997426987, 0.17043539881706238, -0.3630888760089874, 0.27708885073661804, -0.06825149059295654, -0.07609823346138, -0.17127422988414764, -0.041973505169153214, -0.1687922477722168, -0.23263458907604218, -0.30993035435676575, 0.2369103580713272, 0.3540894091129303, -0.2047935426235199, 0.43340548872947693, 0.03012678027153015, 0.04654776304960251, -0.36486679315567017, -0.30633020401000977, 0.006807185709476471, 0.2171047329902649, -0.178132101893425, -0.050870560109615326, 0.3286026120185852, -1.1836494207382202, 0.3341871201992035, 0.30673155188560486, 0.1511770337820053, -0.2961544394493103, 0.2762035131454468, -0.12762972712516785, 0.11381664872169495, 0.4368519186973572, -0.009458027780056, 0.21056005358695984, 0.09604251384735107, -0.14690715074539185, -0.032373420894145966, 0.07420927286148071, -0.20594839751720428, -0.07026448845863342, 0.15110154449939728, 0.023022212088108063, -0.027960985898971558, 0.05663291737437248, -0.09761691093444824, 0.07164601981639862, 0.34537702798843384, -0.24088925123214722, -0.10857085883617401, -0.2629583179950714, -0.48174142837524414, -0.027572276070713997, 0.25329598784446716, 0.04846569150686264, -0.3752587139606476, -0.15073531866073608, -0.23806048929691315, 0.1895875632762909, 0.2902013063430786, 0.5502302050590515, -0.07792428880929947, -0.1420929878950119, -0.045923635363578796, 0.0326220840215683, 0.015198525041341782, -0.1730213463306427, -0.41295215487480164, -0.18113598227500916, 0.02426908165216446, 0.04614216834306717, 0.14437660574913025, -0.08072114735841751, 0.0003860294818878174, 0.08704216778278351, 0.10258473455905914, -0.0785406082868576, 0.08438177406787872, 0.10219195485115051, -0.2781367301940918, 0.2506214380264282, 0.06209685653448105, 0.08448922634124756, 0.29000550508499146, -0.032452575862407684, -0.14847731590270996, -0.36231622099876404, 0.29164180159568787, -0.17664897441864014, 0.13860350847244263, 0.23318295180797577, 0.22191618382930756, -0.0378786139190197, 0.17506007850170135, -0.060112494975328445, 0.15032228827476501, 0.44838449358940125, -0.31591829657554626, 0.14618858695030212, 0.31724774837493896, 0.25957030057907104, -0.06558442115783691, 0.05064322054386139, -0.10517808794975281, -0.23409134149551392, -0.06013083457946777, 0.11327433586120605, -0.02733847126364708, -0.26313045620918274, -0.2002369463443756, 0.3465351462364197, 0.1803741604089737, 0.3015497922897339, -0.3823430836200714, 0.3745148777961731, -0.05726277083158493, -0.17985187470912933, -0.5665239095687866, -0.1034894585609436, 0.18869103491306305, 0.0917157530784607, 0.05770451948046684, -0.1389281004667282, 0.19250887632369995, -0.2068650871515274, -0.5815451145172119, 0.10098601132631302, 0.2242555171251297, 0.07753369957208633, -0.06599528342485428, -0.03545844554901123, 0.21565771102905273, -0.11531278491020203, 0.02529889903962612, 0.13263210654258728, 0.25414493680000305, 0.4391953647136688, -0.028974168002605438, -0.016284380108118057, -0.0774005874991417, 0.07643132656812668, -0.03592689335346222, -0.1728014349937439, 0.347960501909256, -0.027596017345786095, 0.0311523899435997, -0.04849287122488022, 0.09819261729717255, 0.16182425618171692, 0.04077029973268509, 0.3422176241874695, 0.04295336455106735, -0.006505787372589111, -0.35602959990501404, -0.19295480847358704, 0.1701047718524933, 0.2291140854358673, 0.20064321160316467, 0.06894821673631668, 0.1483788639307022, 0.04045163094997406, -0.25843939185142517, -0.19759860634803772, 0.13474228978157043, 0.266823947429657, 0.15734019875526428, -0.0769989863038063, -0.0836128443479538, -0.041540540754795074, -0.24381813406944275, -0.31975045800209045, 0.15829500555992126, 0.10002794116735458, -0.4689687490463257, 0.11640144139528275, -0.06907866895198822, 0.163035586476326, 0.09799520671367645, 0.29463595151901245, -0.1237434446811676, -0.08740992099046707, -0.01359457615762949, 0.6839892864227295, -0.05031571909785271, -0.10471846163272858, 0.32239633798599243, 0.2717871069908142, -0.539982795715332, 0.2273535132408142, -0.3279074728488922, -0.07819291204214096, -0.1497439593076706, 0.0046201348304748535, -0.03906017541885376, -0.0581497997045517, 0.10995323210954666, -0.1454857885837555, -0.4386260509490967, -0.1857306957244873, -0.33098506927490234, 0.03732885420322418, 0.0911790058016777, -0.012550665065646172, -0.16083064675331116, 0.09225824475288391, -0.11902005970478058, 0.040066853165626526, 0.3640909790992737, -0.12670020759105682, -0.1537531614303589, 0.23047466576099396, -0.17340071499347687, 0.06579460203647614, -0.11128255724906921, 0.020788507536053658, 0.08264508098363876, -0.09718900918960571, 0.013551832176744938, -0.033501848578453064, 0.22395774722099304, 0.3547841012477875, -0.08028265833854675, -0.17788556218147278, -0.38215112686157227, 0.08083167672157288, -0.1620435118675232, -0.04271650314331055, 0.16639386117458344, -0.09557448327541351, -0.27453088760375977, 0.3657078444957733, -0.16432715952396393, 0.630359411239624, -0.07376819849014282, -0.1412094235420227, -0.10794670879840851, -0.4066726863384247, -0.08982739597558975, -0.06282246112823486, 0.3144049644470215, 0.3503240942955017, 0.08278237283229828, 0.056509990245103836, -0.008613109588623047, -0.4825354218482971, 0.25248098373413086, 0.05524197593331337, -0.026551727205514908, 0.09758679568767548, 0.6147052645683289, 0.21903762221336365, 0.5580427050590515, 0.31131511926651, 0.020785193890333176, 0.4120354950428009, 0.09247106313705444, -0.02755291759967804, 0.1752426028251648, -0.4105631709098816, 0.021795351058244705, -0.09490637481212616, -0.04710814356803894, -0.026612240821123123, -0.020265597850084305, -0.0059250034391880035, -0.14093047380447388, 0.23368725180625916, -0.18647265434265137, -0.12780311703681946, 0.20395413041114807, 0.14549444615840912, 0.08530718088150024, 0.04069408029317856, 0.20278070867061615, -0.14790427684783936, 0.07923677563667297, 0.012099415063858032, -0.008961867541074753, 0.17138341069221497, -0.11534053087234497, -0.2953699827194214, -0.35899731516838074, -0.4614044427871704, 0.3243696391582489, -0.11308706551790237, 0.13599132001399994, -0.1493867188692093, -0.20632588863372803, 0.27360886335372925, -0.02251661941409111, 0.18910151720046997, -0.004031933844089508, 0.04639442637562752, 0.10419070720672607, -0.945862889289856, -0.3781394958496094, -0.11380526423454285, -0.15350545942783356, -0.4394417703151703, 0.21921765804290771, 0.049165356904268265, -0.17075222730636597, -0.16027097404003143, -0.09802814573049545, -0.2910839915275574, -0.18124964833259583, 0.04201950505375862, -0.350186824798584, -0.20988091826438904, -0.16848182678222656, 0.11323666572570801, 0.21275009214878082, 0.1798643320798874, 0.08546438068151474, 0.148772194981575, 0.243744358420372, -0.315509170293808, 0.15804463624954224, 0.23186442255973816, 0.178432434797287, 0.1563754826784134, 0.17869995534420013, 0.30928075313568115, 0.255307674407959, -0.29768866300582886, 0.422516405582428, 0.060132186859846115, -0.5345926880836487, 0.21955916285514832, 0.4476402997970581, 0.37090975046157837, 0.22269141674041748, 0.09498625993728638, 0.3413622975349426, 0.32662349939346313, 0.40909481048583984, -0.10226473212242126, 0.1194264143705368, 0.21167004108428955, 0.29341980814933777, -0.05064775049686432, -0.17214375734329224, -0.004834670573472977, 0.22970646619796753, -0.16871437430381775, 0.08717834949493408, -0.22764845192432404, -0.01605006493628025, 0.06589681655168533, 0.21396028995513916, 0.5341183543205261, -0.12591035664081573, 0.025122953578829765, 0.2083137333393097, -0.3521556258201599, 0.6169130802154541, -0.23791687190532684, 0.296833872795105, -0.5036656260490417, -0.23872143030166626, 0.12907129526138306, -0.18320932984352112, 0.18935982882976532, -0.015863414853811264, 0.3014730215072632, 0.08892771601676941, 0.1327085793018341, 0.06747975945472717, 0.01816842332482338, 0.03677845001220703, -0.161396786570549, -0.18813250958919525, 0.20006228983402252, 0.030010774731636047, -0.328029066324234, 0.3722354769706726, 0.06901024281978607, 0.21019823849201202, 0.059897616505622864, -0.2235058844089508, -0.3599384129047394, 0.10370351374149323, -0.28654298186302185, -0.12080222368240356, 0.0967683494091034, -0.25939804315567017, 0.4770149886608124, 0.11123678088188171, 0.48610010743141174, -0.14999672770500183, 0.022743413224816322, 0.122996985912323, -0.08561401069164276, 0.18600508570671082, 0.1435166299343109, -0.13491657376289368, 0.10110265016555786, -0.36445534229278564, -0.28398728370666504, 0.07690993696451187, -0.17764760553836823, -0.3393308222293854, -0.16607621312141418, 0.5274007320404053, -0.05167846009135246, 0.07935196161270142, 0.385892391204834, 0.2658720910549164, 0.2849254608154297, -0.24701713025569916, -0.005393923260271549, 0.43523308634757996, -0.1951192170381546, 0.08613362908363342, -0.2630138397216797, -0.24414068460464478, -0.01788877323269844, 0.43160638213157654, 0.010936364531517029, -0.36476781964302063, 0.31138235330581665, 0.2773204445838928, -0.05492136999964714, -0.04092198982834816, -0.46251726150512695, 0.4252670705318451, -0.37622159719467163, 0.17752856016159058, 0.27058786153793335, -0.3437143862247467, 0.11655503511428833, 0.32205814123153687, 0.11927784234285355, -0.125680074095726, -0.42781805992126465, -0.19008459150791168, -0.2643665671348572, 0.011766744777560234, -0.09658414125442505, 0.061137810349464417, 0.04109908640384674, -0.4575640559196472, -0.053021613508462906, 0.26558688282966614, -0.1683007776737213, -0.15652069449424744, 0.5043370127677917, -0.08257424831390381, -0.35325929522514343, -0.34824734926223755, 0.05897761136293411, 0.10180871933698654, -0.0256345272064209, 0.03128849342465401, -0.04598565772175789, -0.11096411943435669, -0.2136014997959137, 0.11458513885736465, -0.09910949319601059, -0.4500659704208374, -0.18241864442825317, 0.03042096644639969, -0.0026199277490377426, -0.23067715764045715, 0.31011074781417847, 0.019071191549301147, -0.05363953113555908, 0.18421167135238647, 0.2471117526292801, -0.08767887949943542, -0.2209530472755432, 0.0625808835029602, 0.014664137735962868, -0.10698628425598145, 0.0746513158082962, 0.08349838852882385, 0.2196059226989746, -0.030500732362270355, -0.14771650731563568, -0.07124759256839752, 0.0491475947201252, -0.01451060175895691, 0.2511477768421173, -0.4152626395225525, 0.041923001408576965, -0.10197675228118896, 0.3578324317932129, 0.2977588474750519, 0.3283381760120392, 0.17597004771232605, 0.038763757795095444, 0.15941354632377625, -0.14759235084056854, -0.29246795177459717, 0.09031185507774353, 0.3376338481903076, 0.17473164200782776, 0.25125473737716675, 0.03405842185020447, 0.07690434157848358, 0.4129951596260071, 0.028063088655471802, 0.08850762993097305, -0.08162499219179153, 0.17479367554187775, -0.04119274392724037, 0.14569497108459473, 0.23189634084701538, 0.16495884954929352, -0.22305452823638916, 0.08545184880495071, -0.0832492858171463, 0.2342974692583084, 0.5687859058380127, -0.2470605969429016, 0.20311076939105988, 0.27574265003204346, -0.4103923439979553, -0.08863677084445953, -0.07350398600101471, -0.5387387275695801, 0.13394880294799805, 0.09134172648191452, 0.4218246340751648, -0.19690904021263123, -0.3332400321960449, -0.471638560295105, 0.1983218938112259, -0.3018321096897125, -0.039669789373874664, -0.39494287967681885, -0.1511685848236084, 0.0027228593826293945, 0.1452542543411255, 0.09118147194385529, 0.03211842477321625, 0.38494962453842163, 0.00684170238673687, -0.3442358374595642, 0.11780635267496109, -0.7008730173110962, 0.19166845083236694, 0.271465927362442, -0.08304063230752945, -0.011444615200161934, 0.18397575616836548, -0.42398399114608765, -0.21176382899284363, 0.12064743041992188, 0.3707759380340576, -0.13746020197868347, 0.2434704452753067, 0.02358817309141159, -0.06185923144221306, 0.10698332637548447, -0.3097788095474243, 0.12271197885274887, 0.20236152410507202, 0.15063944458961487, -0.1328848898410797, 0.016764216125011444, -0.15667714178562164, -0.06241955980658531, -0.3311351537704468, 0.25544148683547974, -0.12919072806835175, 0.28946244716644287, -0.31174516677856445, -0.10926708579063416, -0.06267845630645752, -0.12078561633825302, -0.04793335497379303, -0.13844214379787445, 0.3162391483783722, 0.08018852025270462, -0.15220804512500763, -0.3329072892665863, -0.0054947491735219955, 0.25093480944633484, 0.03479006141424179, -0.0848047211766243, -0.3747169077396393, -0.36512476205825806, -0.04373915493488312, -0.0762006938457489, 0.06299474090337753, -0.05433095991611481, 0.13010209798812866, 0.05118853226304054, -0.03352237492799759, 0.2024904191493988, -0.04690755531191826, 0.5382410287857056, -0.19762372970581055, 0.09022869914770126, 0.4939836859703064, -0.36273613572120667, 0.2795080840587616, 0.16395889222621918, -0.24502532184123993, 0.24115413427352905, 0.15305198729038239, 0.340907484292984, -0.10938090085983276, -0.0765305608510971, -0.21919718384742737, -0.0032133758068084717, 0.32998862862586975, -0.4664417505264282, 0.10511351376771927, 0.14424502849578857, 0.2913299798965454, 0.13620270788669586, -0.008001074194908142, -0.0477568693459034, 0.29852283000946045, -0.09537927061319351, 0.08609254658222198, -0.16800394654273987, 0.7948806881904602, 0.028456740081310272, -0.17186543345451355, -0.2801815867424011, 0.07175193727016449, -0.1538928896188736, -0.473461389541626, 0.005076639354228973, 0.19420059025287628, 0.04172445833683014, 0.4812254309654236, 0.27765733003616333, 0.30775266885757446, 0.19574794173240662, -0.24642664194107056, -0.7180576324462891, -0.3511047661304474, 0.2571895718574524, -0.4222032427787781, -0.23064972460269928, -0.4947855770587921, 0.5185131430625916, -0.14063912630081177, -0.1689693033695221, 0.09716522693634033, -0.5443713665008545, -0.18181973695755005, -0.057702843099832535, -0.23249700665473938, 0.13984626531600952, 0.06786652654409409, 0.02118375152349472, -0.06836205720901489, 0.4693088233470917, 0.15435028076171875, -0.1750248670578003, -0.09918566048145294, -0.1626558154821396 ]
https://github.com/huggingface/datasets/issues/5981
From reading that ticket, it may be down in mkl? Is it worth hotfixing in the meantime, with the express intention of turning it off? I know that's a horribly crufty solution, but it's also deeply frustrating to be limited to 2 cores for operations as simple as filtration.
Only two cores are getting used in sagemaker with pytorch 3.10 kernel
### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
49
Only two cores are getting used in sagemaker with pytorch 3.10 kernel ### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel From reading that ticket, it may be down in mkl? Is it worth hotfixing in the meantime, with the express intention of turning it off? I know that's a horribly crufty solution, but it's also deeply frustrating to be limited to 2 cores for operations as simple as filtration.
[ -0.16755031049251556, -0.698649525642395, -0.006346769630908966, 0.3419397175312042, -0.08470866829156876, -0.290692538022995, 0.17301566898822784, 0.061169158667325974, 0.36152422428131104, 0.2239425778388977, -0.09223724901676178, 0.6258037090301514, 0.17458635568618774, 0.04712916910648346, -0.15570229291915894, 0.09349585324525833, 0.2597576975822449, 0.09132017195224762, -0.014752913266420364, -0.0016262531280517578, -0.14717358350753784, 0.5697405934333801, -0.04418962448835373, -0.2275059074163437, -0.21884803473949432, 0.22291772067546844, 0.31872543692588806, 0.2357386350631714, 0.3035767674446106, -0.2511754631996155, -0.050009261816740036, 0.0070148054510355, -0.08806409686803818, 0.25890034437179565, -0.0001259471318917349, 0.1156168133020401, -0.061715204268693924, 0.23891398310661316, -0.0815456286072731, -0.17547707259655, 0.35363146662712097, -0.1928817331790924, 0.03853141516447067, -0.12212018668651581, -0.3029044270515442, 0.4861268997192383, -0.3716069161891937, -0.2371806800365448, 0.308594673871994, 0.17213603854179382, 0.05802103504538536, 0.4175121784210205, -0.004449792206287384, 0.05619695037603378, 0.06778120994567871, 0.21470725536346436, -0.14013662934303284, 0.02477310225367546, 0.37184491753578186, -0.0864512026309967, 0.13934063911437988, 0.5126333832740784, -0.0031074434518814087, 0.2944212853908539, 0.509090006351471, 0.05375657230615616, -0.00009835697710514069, -0.4114382863044739, 0.19149978458881378, 0.037956226617097855, -0.4234714210033417, 0.07123411446809769, 0.03592675179243088, -0.3549829125404358, -0.3954257369041443, -0.4700077176094055, 0.30460184812545776, -0.10609210282564163, -0.23686721920967102, -0.19592496752738953, 0.03730425983667374, -0.05957178771495819, -0.08281922340393066, -0.028197485953569412, 0.18876364827156067, 0.6050975918769836, 0.04189351573586464, 0.2136332392692566, 0.49267271161079407, 0.3435560464859009, -0.5149456858634949, 0.13165122270584106, 0.14218641817569733, -0.09987588226795197, -0.5186396241188049, 0.21082958579063416, 0.13703960180282593, 0.3251979351043701, -0.2749980390071869, 0.24403351545333862, 0.2057742476463318, 0.3358207941055298, 0.18528535962104797, 0.10946677625179291, -0.0026429742574691772, -0.14175225794315338, 0.3818313479423523, 0.024612125009298325, 0.1807878613471985, 0.44188326597213745, 0.12248361110687256, 0.023854847997426987, 0.17043539881706238, -0.3630888760089874, 0.27708885073661804, -0.06825149059295654, -0.07609823346138, -0.17127422988414764, -0.041973505169153214, -0.1687922477722168, -0.23263458907604218, -0.30993035435676575, 0.2369103580713272, 0.3540894091129303, -0.2047935426235199, 0.43340548872947693, 0.03012678027153015, 0.04654776304960251, -0.36486679315567017, -0.30633020401000977, 0.006807185709476471, 0.2171047329902649, -0.178132101893425, -0.050870560109615326, 0.3286026120185852, -1.1836494207382202, 0.3341871201992035, 0.30673155188560486, 0.1511770337820053, -0.2961544394493103, 0.2762035131454468, -0.12762972712516785, 0.11381664872169495, 0.4368519186973572, -0.009458027780056, 0.21056005358695984, 0.09604251384735107, -0.14690715074539185, -0.032373420894145966, 0.07420927286148071, -0.20594839751720428, -0.07026448845863342, 0.15110154449939728, 0.023022212088108063, -0.027960985898971558, 0.05663291737437248, -0.09761691093444824, 0.07164601981639862, 0.34537702798843384, -0.24088925123214722, -0.10857085883617401, -0.2629583179950714, -0.48174142837524414, -0.027572276070713997, 0.25329598784446716, 0.04846569150686264, -0.3752587139606476, -0.15073531866073608, -0.23806048929691315, 0.1895875632762909, 0.2902013063430786, 0.5502302050590515, -0.07792428880929947, -0.1420929878950119, -0.045923635363578796, 0.0326220840215683, 0.015198525041341782, -0.1730213463306427, -0.41295215487480164, -0.18113598227500916, 0.02426908165216446, 0.04614216834306717, 0.14437660574913025, -0.08072114735841751, 0.0003860294818878174, 0.08704216778278351, 0.10258473455905914, -0.0785406082868576, 0.08438177406787872, 0.10219195485115051, -0.2781367301940918, 0.2506214380264282, 0.06209685653448105, 0.08448922634124756, 0.29000550508499146, -0.032452575862407684, -0.14847731590270996, -0.36231622099876404, 0.29164180159568787, -0.17664897441864014, 0.13860350847244263, 0.23318295180797577, 0.22191618382930756, -0.0378786139190197, 0.17506007850170135, -0.060112494975328445, 0.15032228827476501, 0.44838449358940125, -0.31591829657554626, 0.14618858695030212, 0.31724774837493896, 0.25957030057907104, -0.06558442115783691, 0.05064322054386139, -0.10517808794975281, -0.23409134149551392, -0.06013083457946777, 0.11327433586120605, -0.02733847126364708, -0.26313045620918274, -0.2002369463443756, 0.3465351462364197, 0.1803741604089737, 0.3015497922897339, -0.3823430836200714, 0.3745148777961731, -0.05726277083158493, -0.17985187470912933, -0.5665239095687866, -0.1034894585609436, 0.18869103491306305, 0.0917157530784607, 0.05770451948046684, -0.1389281004667282, 0.19250887632369995, -0.2068650871515274, -0.5815451145172119, 0.10098601132631302, 0.2242555171251297, 0.07753369957208633, -0.06599528342485428, -0.03545844554901123, 0.21565771102905273, -0.11531278491020203, 0.02529889903962612, 0.13263210654258728, 0.25414493680000305, 0.4391953647136688, -0.028974168002605438, -0.016284380108118057, -0.0774005874991417, 0.07643132656812668, -0.03592689335346222, -0.1728014349937439, 0.347960501909256, -0.027596017345786095, 0.0311523899435997, -0.04849287122488022, 0.09819261729717255, 0.16182425618171692, 0.04077029973268509, 0.3422176241874695, 0.04295336455106735, -0.006505787372589111, -0.35602959990501404, -0.19295480847358704, 0.1701047718524933, 0.2291140854358673, 0.20064321160316467, 0.06894821673631668, 0.1483788639307022, 0.04045163094997406, -0.25843939185142517, -0.19759860634803772, 0.13474228978157043, 0.266823947429657, 0.15734019875526428, -0.0769989863038063, -0.0836128443479538, -0.041540540754795074, -0.24381813406944275, -0.31975045800209045, 0.15829500555992126, 0.10002794116735458, -0.4689687490463257, 0.11640144139528275, -0.06907866895198822, 0.163035586476326, 0.09799520671367645, 0.29463595151901245, -0.1237434446811676, -0.08740992099046707, -0.01359457615762949, 0.6839892864227295, -0.05031571909785271, -0.10471846163272858, 0.32239633798599243, 0.2717871069908142, -0.539982795715332, 0.2273535132408142, -0.3279074728488922, -0.07819291204214096, -0.1497439593076706, 0.0046201348304748535, -0.03906017541885376, -0.0581497997045517, 0.10995323210954666, -0.1454857885837555, -0.4386260509490967, -0.1857306957244873, -0.33098506927490234, 0.03732885420322418, 0.0911790058016777, -0.012550665065646172, -0.16083064675331116, 0.09225824475288391, -0.11902005970478058, 0.040066853165626526, 0.3640909790992737, -0.12670020759105682, -0.1537531614303589, 0.23047466576099396, -0.17340071499347687, 0.06579460203647614, -0.11128255724906921, 0.020788507536053658, 0.08264508098363876, -0.09718900918960571, 0.013551832176744938, -0.033501848578453064, 0.22395774722099304, 0.3547841012477875, -0.08028265833854675, -0.17788556218147278, -0.38215112686157227, 0.08083167672157288, -0.1620435118675232, -0.04271650314331055, 0.16639386117458344, -0.09557448327541351, -0.27453088760375977, 0.3657078444957733, -0.16432715952396393, 0.630359411239624, -0.07376819849014282, -0.1412094235420227, -0.10794670879840851, -0.4066726863384247, -0.08982739597558975, -0.06282246112823486, 0.3144049644470215, 0.3503240942955017, 0.08278237283229828, 0.056509990245103836, -0.008613109588623047, -0.4825354218482971, 0.25248098373413086, 0.05524197593331337, -0.026551727205514908, 0.09758679568767548, 0.6147052645683289, 0.21903762221336365, 0.5580427050590515, 0.31131511926651, 0.020785193890333176, 0.4120354950428009, 0.09247106313705444, -0.02755291759967804, 0.1752426028251648, -0.4105631709098816, 0.021795351058244705, -0.09490637481212616, -0.04710814356803894, -0.026612240821123123, -0.020265597850084305, -0.0059250034391880035, -0.14093047380447388, 0.23368725180625916, -0.18647265434265137, -0.12780311703681946, 0.20395413041114807, 0.14549444615840912, 0.08530718088150024, 0.04069408029317856, 0.20278070867061615, -0.14790427684783936, 0.07923677563667297, 0.012099415063858032, -0.008961867541074753, 0.17138341069221497, -0.11534053087234497, -0.2953699827194214, -0.35899731516838074, -0.4614044427871704, 0.3243696391582489, -0.11308706551790237, 0.13599132001399994, -0.1493867188692093, -0.20632588863372803, 0.27360886335372925, -0.02251661941409111, 0.18910151720046997, -0.004031933844089508, 0.04639442637562752, 0.10419070720672607, -0.945862889289856, -0.3781394958496094, -0.11380526423454285, -0.15350545942783356, -0.4394417703151703, 0.21921765804290771, 0.049165356904268265, -0.17075222730636597, -0.16027097404003143, -0.09802814573049545, -0.2910839915275574, -0.18124964833259583, 0.04201950505375862, -0.350186824798584, -0.20988091826438904, -0.16848182678222656, 0.11323666572570801, 0.21275009214878082, 0.1798643320798874, 0.08546438068151474, 0.148772194981575, 0.243744358420372, -0.315509170293808, 0.15804463624954224, 0.23186442255973816, 0.178432434797287, 0.1563754826784134, 0.17869995534420013, 0.30928075313568115, 0.255307674407959, -0.29768866300582886, 0.422516405582428, 0.060132186859846115, -0.5345926880836487, 0.21955916285514832, 0.4476402997970581, 0.37090975046157837, 0.22269141674041748, 0.09498625993728638, 0.3413622975349426, 0.32662349939346313, 0.40909481048583984, -0.10226473212242126, 0.1194264143705368, 0.21167004108428955, 0.29341980814933777, -0.05064775049686432, -0.17214375734329224, -0.004834670573472977, 0.22970646619796753, -0.16871437430381775, 0.08717834949493408, -0.22764845192432404, -0.01605006493628025, 0.06589681655168533, 0.21396028995513916, 0.5341183543205261, -0.12591035664081573, 0.025122953578829765, 0.2083137333393097, -0.3521556258201599, 0.6169130802154541, -0.23791687190532684, 0.296833872795105, -0.5036656260490417, -0.23872143030166626, 0.12907129526138306, -0.18320932984352112, 0.18935982882976532, -0.015863414853811264, 0.3014730215072632, 0.08892771601676941, 0.1327085793018341, 0.06747975945472717, 0.01816842332482338, 0.03677845001220703, -0.161396786570549, -0.18813250958919525, 0.20006228983402252, 0.030010774731636047, -0.328029066324234, 0.3722354769706726, 0.06901024281978607, 0.21019823849201202, 0.059897616505622864, -0.2235058844089508, -0.3599384129047394, 0.10370351374149323, -0.28654298186302185, -0.12080222368240356, 0.0967683494091034, -0.25939804315567017, 0.4770149886608124, 0.11123678088188171, 0.48610010743141174, -0.14999672770500183, 0.022743413224816322, 0.122996985912323, -0.08561401069164276, 0.18600508570671082, 0.1435166299343109, -0.13491657376289368, 0.10110265016555786, -0.36445534229278564, -0.28398728370666504, 0.07690993696451187, -0.17764760553836823, -0.3393308222293854, -0.16607621312141418, 0.5274007320404053, -0.05167846009135246, 0.07935196161270142, 0.385892391204834, 0.2658720910549164, 0.2849254608154297, -0.24701713025569916, -0.005393923260271549, 0.43523308634757996, -0.1951192170381546, 0.08613362908363342, -0.2630138397216797, -0.24414068460464478, -0.01788877323269844, 0.43160638213157654, 0.010936364531517029, -0.36476781964302063, 0.31138235330581665, 0.2773204445838928, -0.05492136999964714, -0.04092198982834816, -0.46251726150512695, 0.4252670705318451, -0.37622159719467163, 0.17752856016159058, 0.27058786153793335, -0.3437143862247467, 0.11655503511428833, 0.32205814123153687, 0.11927784234285355, -0.125680074095726, -0.42781805992126465, -0.19008459150791168, -0.2643665671348572, 0.011766744777560234, -0.09658414125442505, 0.061137810349464417, 0.04109908640384674, -0.4575640559196472, -0.053021613508462906, 0.26558688282966614, -0.1683007776737213, -0.15652069449424744, 0.5043370127677917, -0.08257424831390381, -0.35325929522514343, -0.34824734926223755, 0.05897761136293411, 0.10180871933698654, -0.0256345272064209, 0.03128849342465401, -0.04598565772175789, -0.11096411943435669, -0.2136014997959137, 0.11458513885736465, -0.09910949319601059, -0.4500659704208374, -0.18241864442825317, 0.03042096644639969, -0.0026199277490377426, -0.23067715764045715, 0.31011074781417847, 0.019071191549301147, -0.05363953113555908, 0.18421167135238647, 0.2471117526292801, -0.08767887949943542, -0.2209530472755432, 0.0625808835029602, 0.014664137735962868, -0.10698628425598145, 0.0746513158082962, 0.08349838852882385, 0.2196059226989746, -0.030500732362270355, -0.14771650731563568, -0.07124759256839752, 0.0491475947201252, -0.01451060175895691, 0.2511477768421173, -0.4152626395225525, 0.041923001408576965, -0.10197675228118896, 0.3578324317932129, 0.2977588474750519, 0.3283381760120392, 0.17597004771232605, 0.038763757795095444, 0.15941354632377625, -0.14759235084056854, -0.29246795177459717, 0.09031185507774353, 0.3376338481903076, 0.17473164200782776, 0.25125473737716675, 0.03405842185020447, 0.07690434157848358, 0.4129951596260071, 0.028063088655471802, 0.08850762993097305, -0.08162499219179153, 0.17479367554187775, -0.04119274392724037, 0.14569497108459473, 0.23189634084701538, 0.16495884954929352, -0.22305452823638916, 0.08545184880495071, -0.0832492858171463, 0.2342974692583084, 0.5687859058380127, -0.2470605969429016, 0.20311076939105988, 0.27574265003204346, -0.4103923439979553, -0.08863677084445953, -0.07350398600101471, -0.5387387275695801, 0.13394880294799805, 0.09134172648191452, 0.4218246340751648, -0.19690904021263123, -0.3332400321960449, -0.471638560295105, 0.1983218938112259, -0.3018321096897125, -0.039669789373874664, -0.39494287967681885, -0.1511685848236084, 0.0027228593826293945, 0.1452542543411255, 0.09118147194385529, 0.03211842477321625, 0.38494962453842163, 0.00684170238673687, -0.3442358374595642, 0.11780635267496109, -0.7008730173110962, 0.19166845083236694, 0.271465927362442, -0.08304063230752945, -0.011444615200161934, 0.18397575616836548, -0.42398399114608765, -0.21176382899284363, 0.12064743041992188, 0.3707759380340576, -0.13746020197868347, 0.2434704452753067, 0.02358817309141159, -0.06185923144221306, 0.10698332637548447, -0.3097788095474243, 0.12271197885274887, 0.20236152410507202, 0.15063944458961487, -0.1328848898410797, 0.016764216125011444, -0.15667714178562164, -0.06241955980658531, -0.3311351537704468, 0.25544148683547974, -0.12919072806835175, 0.28946244716644287, -0.31174516677856445, -0.10926708579063416, -0.06267845630645752, -0.12078561633825302, -0.04793335497379303, -0.13844214379787445, 0.3162391483783722, 0.08018852025270462, -0.15220804512500763, -0.3329072892665863, -0.0054947491735219955, 0.25093480944633484, 0.03479006141424179, -0.0848047211766243, -0.3747169077396393, -0.36512476205825806, -0.04373915493488312, -0.0762006938457489, 0.06299474090337753, -0.05433095991611481, 0.13010209798812866, 0.05118853226304054, -0.03352237492799759, 0.2024904191493988, -0.04690755531191826, 0.5382410287857056, -0.19762372970581055, 0.09022869914770126, 0.4939836859703064, -0.36273613572120667, 0.2795080840587616, 0.16395889222621918, -0.24502532184123993, 0.24115413427352905, 0.15305198729038239, 0.340907484292984, -0.10938090085983276, -0.0765305608510971, -0.21919718384742737, -0.0032133758068084717, 0.32998862862586975, -0.4664417505264282, 0.10511351376771927, 0.14424502849578857, 0.2913299798965454, 0.13620270788669586, -0.008001074194908142, -0.0477568693459034, 0.29852283000946045, -0.09537927061319351, 0.08609254658222198, -0.16800394654273987, 0.7948806881904602, 0.028456740081310272, -0.17186543345451355, -0.2801815867424011, 0.07175193727016449, -0.1538928896188736, -0.473461389541626, 0.005076639354228973, 0.19420059025287628, 0.04172445833683014, 0.4812254309654236, 0.27765733003616333, 0.30775266885757446, 0.19574794173240662, -0.24642664194107056, -0.7180576324462891, -0.3511047661304474, 0.2571895718574524, -0.4222032427787781, -0.23064972460269928, -0.4947855770587921, 0.5185131430625916, -0.14063912630081177, -0.1689693033695221, 0.09716522693634033, -0.5443713665008545, -0.18181973695755005, -0.057702843099832535, -0.23249700665473938, 0.13984626531600952, 0.06786652654409409, 0.02118375152349472, -0.06836205720901489, 0.4693088233470917, 0.15435028076171875, -0.1750248670578003, -0.09918566048145294, -0.1626558154821396 ]
https://github.com/huggingface/datasets/issues/5981
@mariosasko @mmr-crexi I had the exact same problem on my kubernetes cluster. the datasets subprocess only user 1 and 17 core
Only two cores are getting used in sagemaker with pytorch 3.10 kernel
### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel
21
Only two cores are getting used in sagemaker with pytorch 3.10 kernel ### Describe the bug When using the newer pytorch 3.10 kernel, only 2 cores are being used by huggingface filter and map functions. The Pytorch 3.9 kernel would use as many cores as specified in the num_proc field. We have solved this in our own code by placing the following snippet in the code that is called inside subprocesses: ```os.sched_setaffinity(0, {i for i in range(1000)})``` The problem, as near as we can tell, us that once upon a time, cpu affinity was set using a bitmask ("0xfffff" and the like), and affinity recently changed to a list of processors rather than to using the mask. As such, only processors 1 and 17 are shown to be working in htop. ![Selection_072](https://github.com/huggingface/datasets/assets/107141022/04c5a824-5321-4531-afca-7bc84dff36b4) When running functions via `map`, the above resetting of affinity works to spread across the cores. When using `filter`, however, only two cores are active. ### Steps to reproduce the bug Repro steps: 1. Create an aws sagemaker instance 2. use the pytorch 3_10 kernel 3. Load a dataset 4. run a filter operation 5. watch as only 2 cores are used when num_proc > 2 6. run a map operation 7. watch as only 2 cores are used when num_proc > 2 8. run a map operation with processor affinity reset inside the function called via map 9. Watch as all cores run ### Expected behavior All specified cores are used via the num_proc argument. ### Environment info AWS sagemaker with the following init script run in the terminal after instance creation: conda init bash bash conda activate pytorch_p310 pip install Wand PyPDF pytesseract datasets seqeval pdfplumber transformers pymupdf sentencepiece timm donut-python accelerate optimum xgboost python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' sudo yum -y install htop sudo yum -y update sudo yum -y install wget libstdc++ autoconf automake libtool autoconf-archive pkg-config gcc gcc-c++ make libjpeg-devel libpng-devel libtiff-devel zlib-devel @mariosasko @mmr-crexi I had the exact same problem on my kubernetes cluster. the datasets subprocess only user 1 and 17 core
[ -0.16755031049251556, -0.698649525642395, -0.006346769630908966, 0.3419397175312042, -0.08470866829156876, -0.290692538022995, 0.17301566898822784, 0.061169158667325974, 0.36152422428131104, 0.2239425778388977, -0.09223724901676178, 0.6258037090301514, 0.17458635568618774, 0.04712916910648346, -0.15570229291915894, 0.09349585324525833, 0.2597576975822449, 0.09132017195224762, -0.014752913266420364, -0.0016262531280517578, -0.14717358350753784, 0.5697405934333801, -0.04418962448835373, -0.2275059074163437, -0.21884803473949432, 0.22291772067546844, 0.31872543692588806, 0.2357386350631714, 0.3035767674446106, -0.2511754631996155, -0.050009261816740036, 0.0070148054510355, -0.08806409686803818, 0.25890034437179565, -0.0001259471318917349, 0.1156168133020401, -0.061715204268693924, 0.23891398310661316, -0.0815456286072731, -0.17547707259655, 0.35363146662712097, -0.1928817331790924, 0.03853141516447067, -0.12212018668651581, -0.3029044270515442, 0.4861268997192383, -0.3716069161891937, -0.2371806800365448, 0.308594673871994, 0.17213603854179382, 0.05802103504538536, 0.4175121784210205, -0.004449792206287384, 0.05619695037603378, 0.06778120994567871, 0.21470725536346436, -0.14013662934303284, 0.02477310225367546, 0.37184491753578186, -0.0864512026309967, 0.13934063911437988, 0.5126333832740784, -0.0031074434518814087, 0.2944212853908539, 0.509090006351471, 0.05375657230615616, -0.00009835697710514069, -0.4114382863044739, 0.19149978458881378, 0.037956226617097855, -0.4234714210033417, 0.07123411446809769, 0.03592675179243088, -0.3549829125404358, -0.3954257369041443, -0.4700077176094055, 0.30460184812545776, -0.10609210282564163, -0.23686721920967102, -0.19592496752738953, 0.03730425983667374, -0.05957178771495819, -0.08281922340393066, -0.028197485953569412, 0.18876364827156067, 0.6050975918769836, 0.04189351573586464, 0.2136332392692566, 0.49267271161079407, 0.3435560464859009, -0.5149456858634949, 0.13165122270584106, 0.14218641817569733, -0.09987588226795197, -0.5186396241188049, 0.21082958579063416, 0.13703960180282593, 0.3251979351043701, -0.2749980390071869, 0.24403351545333862, 0.2057742476463318, 0.3358207941055298, 0.18528535962104797, 0.10946677625179291, -0.0026429742574691772, -0.14175225794315338, 0.3818313479423523, 0.024612125009298325, 0.1807878613471985, 0.44188326597213745, 0.12248361110687256, 0.023854847997426987, 0.17043539881706238, -0.3630888760089874, 0.27708885073661804, -0.06825149059295654, -0.07609823346138, -0.17127422988414764, -0.041973505169153214, -0.1687922477722168, -0.23263458907604218, -0.30993035435676575, 0.2369103580713272, 0.3540894091129303, -0.2047935426235199, 0.43340548872947693, 0.03012678027153015, 0.04654776304960251, -0.36486679315567017, -0.30633020401000977, 0.006807185709476471, 0.2171047329902649, -0.178132101893425, -0.050870560109615326, 0.3286026120185852, -1.1836494207382202, 0.3341871201992035, 0.30673155188560486, 0.1511770337820053, -0.2961544394493103, 0.2762035131454468, -0.12762972712516785, 0.11381664872169495, 0.4368519186973572, -0.009458027780056, 0.21056005358695984, 0.09604251384735107, -0.14690715074539185, -0.032373420894145966, 0.07420927286148071, -0.20594839751720428, -0.07026448845863342, 0.15110154449939728, 0.023022212088108063, -0.027960985898971558, 0.05663291737437248, -0.09761691093444824, 0.07164601981639862, 0.34537702798843384, -0.24088925123214722, -0.10857085883617401, -0.2629583179950714, -0.48174142837524414, -0.027572276070713997, 0.25329598784446716, 0.04846569150686264, -0.3752587139606476, -0.15073531866073608, -0.23806048929691315, 0.1895875632762909, 0.2902013063430786, 0.5502302050590515, -0.07792428880929947, -0.1420929878950119, -0.045923635363578796, 0.0326220840215683, 0.015198525041341782, -0.1730213463306427, -0.41295215487480164, -0.18113598227500916, 0.02426908165216446, 0.04614216834306717, 0.14437660574913025, -0.08072114735841751, 0.0003860294818878174, 0.08704216778278351, 0.10258473455905914, -0.0785406082868576, 0.08438177406787872, 0.10219195485115051, -0.2781367301940918, 0.2506214380264282, 0.06209685653448105, 0.08448922634124756, 0.29000550508499146, -0.032452575862407684, -0.14847731590270996, -0.36231622099876404, 0.29164180159568787, -0.17664897441864014, 0.13860350847244263, 0.23318295180797577, 0.22191618382930756, -0.0378786139190197, 0.17506007850170135, -0.060112494975328445, 0.15032228827476501, 0.44838449358940125, -0.31591829657554626, 0.14618858695030212, 0.31724774837493896, 0.25957030057907104, -0.06558442115783691, 0.05064322054386139, -0.10517808794975281, -0.23409134149551392, -0.06013083457946777, 0.11327433586120605, -0.02733847126364708, -0.26313045620918274, -0.2002369463443756, 0.3465351462364197, 0.1803741604089737, 0.3015497922897339, -0.3823430836200714, 0.3745148777961731, -0.05726277083158493, -0.17985187470912933, -0.5665239095687866, -0.1034894585609436, 0.18869103491306305, 0.0917157530784607, 0.05770451948046684, -0.1389281004667282, 0.19250887632369995, -0.2068650871515274, -0.5815451145172119, 0.10098601132631302, 0.2242555171251297, 0.07753369957208633, -0.06599528342485428, -0.03545844554901123, 0.21565771102905273, -0.11531278491020203, 0.02529889903962612, 0.13263210654258728, 0.25414493680000305, 0.4391953647136688, -0.028974168002605438, -0.016284380108118057, -0.0774005874991417, 0.07643132656812668, -0.03592689335346222, -0.1728014349937439, 0.347960501909256, -0.027596017345786095, 0.0311523899435997, -0.04849287122488022, 0.09819261729717255, 0.16182425618171692, 0.04077029973268509, 0.3422176241874695, 0.04295336455106735, -0.006505787372589111, -0.35602959990501404, -0.19295480847358704, 0.1701047718524933, 0.2291140854358673, 0.20064321160316467, 0.06894821673631668, 0.1483788639307022, 0.04045163094997406, -0.25843939185142517, -0.19759860634803772, 0.13474228978157043, 0.266823947429657, 0.15734019875526428, -0.0769989863038063, -0.0836128443479538, -0.041540540754795074, -0.24381813406944275, -0.31975045800209045, 0.15829500555992126, 0.10002794116735458, -0.4689687490463257, 0.11640144139528275, -0.06907866895198822, 0.163035586476326, 0.09799520671367645, 0.29463595151901245, -0.1237434446811676, -0.08740992099046707, -0.01359457615762949, 0.6839892864227295, -0.05031571909785271, -0.10471846163272858, 0.32239633798599243, 0.2717871069908142, -0.539982795715332, 0.2273535132408142, -0.3279074728488922, -0.07819291204214096, -0.1497439593076706, 0.0046201348304748535, -0.03906017541885376, -0.0581497997045517, 0.10995323210954666, -0.1454857885837555, -0.4386260509490967, -0.1857306957244873, -0.33098506927490234, 0.03732885420322418, 0.0911790058016777, -0.012550665065646172, -0.16083064675331116, 0.09225824475288391, -0.11902005970478058, 0.040066853165626526, 0.3640909790992737, -0.12670020759105682, -0.1537531614303589, 0.23047466576099396, -0.17340071499347687, 0.06579460203647614, -0.11128255724906921, 0.020788507536053658, 0.08264508098363876, -0.09718900918960571, 0.013551832176744938, -0.033501848578453064, 0.22395774722099304, 0.3547841012477875, -0.08028265833854675, -0.17788556218147278, -0.38215112686157227, 0.08083167672157288, -0.1620435118675232, -0.04271650314331055, 0.16639386117458344, -0.09557448327541351, -0.27453088760375977, 0.3657078444957733, -0.16432715952396393, 0.630359411239624, -0.07376819849014282, -0.1412094235420227, -0.10794670879840851, -0.4066726863384247, -0.08982739597558975, -0.06282246112823486, 0.3144049644470215, 0.3503240942955017, 0.08278237283229828, 0.056509990245103836, -0.008613109588623047, -0.4825354218482971, 0.25248098373413086, 0.05524197593331337, -0.026551727205514908, 0.09758679568767548, 0.6147052645683289, 0.21903762221336365, 0.5580427050590515, 0.31131511926651, 0.020785193890333176, 0.4120354950428009, 0.09247106313705444, -0.02755291759967804, 0.1752426028251648, -0.4105631709098816, 0.021795351058244705, -0.09490637481212616, -0.04710814356803894, -0.026612240821123123, -0.020265597850084305, -0.0059250034391880035, -0.14093047380447388, 0.23368725180625916, -0.18647265434265137, -0.12780311703681946, 0.20395413041114807, 0.14549444615840912, 0.08530718088150024, 0.04069408029317856, 0.20278070867061615, -0.14790427684783936, 0.07923677563667297, 0.012099415063858032, -0.008961867541074753, 0.17138341069221497, -0.11534053087234497, -0.2953699827194214, -0.35899731516838074, -0.4614044427871704, 0.3243696391582489, -0.11308706551790237, 0.13599132001399994, -0.1493867188692093, -0.20632588863372803, 0.27360886335372925, -0.02251661941409111, 0.18910151720046997, -0.004031933844089508, 0.04639442637562752, 0.10419070720672607, -0.945862889289856, -0.3781394958496094, -0.11380526423454285, -0.15350545942783356, -0.4394417703151703, 0.21921765804290771, 0.049165356904268265, -0.17075222730636597, -0.16027097404003143, -0.09802814573049545, -0.2910839915275574, -0.18124964833259583, 0.04201950505375862, -0.350186824798584, -0.20988091826438904, -0.16848182678222656, 0.11323666572570801, 0.21275009214878082, 0.1798643320798874, 0.08546438068151474, 0.148772194981575, 0.243744358420372, -0.315509170293808, 0.15804463624954224, 0.23186442255973816, 0.178432434797287, 0.1563754826784134, 0.17869995534420013, 0.30928075313568115, 0.255307674407959, -0.29768866300582886, 0.422516405582428, 0.060132186859846115, -0.5345926880836487, 0.21955916285514832, 0.4476402997970581, 0.37090975046157837, 0.22269141674041748, 0.09498625993728638, 0.3413622975349426, 0.32662349939346313, 0.40909481048583984, -0.10226473212242126, 0.1194264143705368, 0.21167004108428955, 0.29341980814933777, -0.05064775049686432, -0.17214375734329224, -0.004834670573472977, 0.22970646619796753, -0.16871437430381775, 0.08717834949493408, -0.22764845192432404, -0.01605006493628025, 0.06589681655168533, 0.21396028995513916, 0.5341183543205261, -0.12591035664081573, 0.025122953578829765, 0.2083137333393097, -0.3521556258201599, 0.6169130802154541, -0.23791687190532684, 0.296833872795105, -0.5036656260490417, -0.23872143030166626, 0.12907129526138306, -0.18320932984352112, 0.18935982882976532, -0.015863414853811264, 0.3014730215072632, 0.08892771601676941, 0.1327085793018341, 0.06747975945472717, 0.01816842332482338, 0.03677845001220703, -0.161396786570549, -0.18813250958919525, 0.20006228983402252, 0.030010774731636047, -0.328029066324234, 0.3722354769706726, 0.06901024281978607, 0.21019823849201202, 0.059897616505622864, -0.2235058844089508, -0.3599384129047394, 0.10370351374149323, -0.28654298186302185, -0.12080222368240356, 0.0967683494091034, -0.25939804315567017, 0.4770149886608124, 0.11123678088188171, 0.48610010743141174, -0.14999672770500183, 0.022743413224816322, 0.122996985912323, -0.08561401069164276, 0.18600508570671082, 0.1435166299343109, -0.13491657376289368, 0.10110265016555786, -0.36445534229278564, -0.28398728370666504, 0.07690993696451187, -0.17764760553836823, -0.3393308222293854, -0.16607621312141418, 0.5274007320404053, -0.05167846009135246, 0.07935196161270142, 0.385892391204834, 0.2658720910549164, 0.2849254608154297, -0.24701713025569916, -0.005393923260271549, 0.43523308634757996, -0.1951192170381546, 0.08613362908363342, -0.2630138397216797, -0.24414068460464478, -0.01788877323269844, 0.43160638213157654, 0.010936364531517029, -0.36476781964302063, 0.31138235330581665, 0.2773204445838928, -0.05492136999964714, -0.04092198982834816, -0.46251726150512695, 0.4252670705318451, -0.37622159719467163, 0.17752856016159058, 0.27058786153793335, -0.3437143862247467, 0.11655503511428833, 0.32205814123153687, 0.11927784234285355, -0.125680074095726, -0.42781805992126465, -0.19008459150791168, -0.2643665671348572, 0.011766744777560234, -0.09658414125442505, 0.061137810349464417, 0.04109908640384674, -0.4575640559196472, -0.053021613508462906, 0.26558688282966614, -0.1683007776737213, -0.15652069449424744, 0.5043370127677917, -0.08257424831390381, -0.35325929522514343, -0.34824734926223755, 0.05897761136293411, 0.10180871933698654, -0.0256345272064209, 0.03128849342465401, -0.04598565772175789, -0.11096411943435669, -0.2136014997959137, 0.11458513885736465, -0.09910949319601059, -0.4500659704208374, -0.18241864442825317, 0.03042096644639969, -0.0026199277490377426, -0.23067715764045715, 0.31011074781417847, 0.019071191549301147, -0.05363953113555908, 0.18421167135238647, 0.2471117526292801, -0.08767887949943542, -0.2209530472755432, 0.0625808835029602, 0.014664137735962868, -0.10698628425598145, 0.0746513158082962, 0.08349838852882385, 0.2196059226989746, -0.030500732362270355, -0.14771650731563568, -0.07124759256839752, 0.0491475947201252, -0.01451060175895691, 0.2511477768421173, -0.4152626395225525, 0.041923001408576965, -0.10197675228118896, 0.3578324317932129, 0.2977588474750519, 0.3283381760120392, 0.17597004771232605, 0.038763757795095444, 0.15941354632377625, -0.14759235084056854, -0.29246795177459717, 0.09031185507774353, 0.3376338481903076, 0.17473164200782776, 0.25125473737716675, 0.03405842185020447, 0.07690434157848358, 0.4129951596260071, 0.028063088655471802, 0.08850762993097305, -0.08162499219179153, 0.17479367554187775, -0.04119274392724037, 0.14569497108459473, 0.23189634084701538, 0.16495884954929352, -0.22305452823638916, 0.08545184880495071, -0.0832492858171463, 0.2342974692583084, 0.5687859058380127, -0.2470605969429016, 0.20311076939105988, 0.27574265003204346, -0.4103923439979553, -0.08863677084445953, -0.07350398600101471, -0.5387387275695801, 0.13394880294799805, 0.09134172648191452, 0.4218246340751648, -0.19690904021263123, -0.3332400321960449, -0.471638560295105, 0.1983218938112259, -0.3018321096897125, -0.039669789373874664, -0.39494287967681885, -0.1511685848236084, 0.0027228593826293945, 0.1452542543411255, 0.09118147194385529, 0.03211842477321625, 0.38494962453842163, 0.00684170238673687, -0.3442358374595642, 0.11780635267496109, -0.7008730173110962, 0.19166845083236694, 0.271465927362442, -0.08304063230752945, -0.011444615200161934, 0.18397575616836548, -0.42398399114608765, -0.21176382899284363, 0.12064743041992188, 0.3707759380340576, -0.13746020197868347, 0.2434704452753067, 0.02358817309141159, -0.06185923144221306, 0.10698332637548447, -0.3097788095474243, 0.12271197885274887, 0.20236152410507202, 0.15063944458961487, -0.1328848898410797, 0.016764216125011444, -0.15667714178562164, -0.06241955980658531, -0.3311351537704468, 0.25544148683547974, -0.12919072806835175, 0.28946244716644287, -0.31174516677856445, -0.10926708579063416, -0.06267845630645752, -0.12078561633825302, -0.04793335497379303, -0.13844214379787445, 0.3162391483783722, 0.08018852025270462, -0.15220804512500763, -0.3329072892665863, -0.0054947491735219955, 0.25093480944633484, 0.03479006141424179, -0.0848047211766243, -0.3747169077396393, -0.36512476205825806, -0.04373915493488312, -0.0762006938457489, 0.06299474090337753, -0.05433095991611481, 0.13010209798812866, 0.05118853226304054, -0.03352237492799759, 0.2024904191493988, -0.04690755531191826, 0.5382410287857056, -0.19762372970581055, 0.09022869914770126, 0.4939836859703064, -0.36273613572120667, 0.2795080840587616, 0.16395889222621918, -0.24502532184123993, 0.24115413427352905, 0.15305198729038239, 0.340907484292984, -0.10938090085983276, -0.0765305608510971, -0.21919718384742737, -0.0032133758068084717, 0.32998862862586975, -0.4664417505264282, 0.10511351376771927, 0.14424502849578857, 0.2913299798965454, 0.13620270788669586, -0.008001074194908142, -0.0477568693459034, 0.29852283000946045, -0.09537927061319351, 0.08609254658222198, -0.16800394654273987, 0.7948806881904602, 0.028456740081310272, -0.17186543345451355, -0.2801815867424011, 0.07175193727016449, -0.1538928896188736, -0.473461389541626, 0.005076639354228973, 0.19420059025287628, 0.04172445833683014, 0.4812254309654236, 0.27765733003616333, 0.30775266885757446, 0.19574794173240662, -0.24642664194107056, -0.7180576324462891, -0.3511047661304474, 0.2571895718574524, -0.4222032427787781, -0.23064972460269928, -0.4947855770587921, 0.5185131430625916, -0.14063912630081177, -0.1689693033695221, 0.09716522693634033, -0.5443713665008545, -0.18181973695755005, -0.057702843099832535, -0.23249700665473938, 0.13984626531600952, 0.06786652654409409, 0.02118375152349472, -0.06836205720901489, 0.4693088233470917, 0.15435028076171875, -0.1750248670578003, -0.09918566048145294, -0.1626558154821396 ]
https://github.com/huggingface/datasets/issues/5980
Yes, it seems to be working now. In case it's helpful, the outage lasted several days. It was failing as late as yesterday morning.
Viewing dataset card returns “502 Bad Gateway”
The url is: https://huggingface.co/datasets/Confirm-Labs/pile_ngrams_trigrams I am able to successfully view the “Files and versions” tab: [Confirm-Labs/pile_ngrams_trigrams at main](https://huggingface.co/datasets/Confirm-Labs/pile_ngrams_trigrams/tree/main) Any help would be appreciated! Thanks! I hope this is the right place to report an issue like this.
24
Viewing dataset card returns “502 Bad Gateway” The url is: https://huggingface.co/datasets/Confirm-Labs/pile_ngrams_trigrams I am able to successfully view the “Files and versions” tab: [Confirm-Labs/pile_ngrams_trigrams at main](https://huggingface.co/datasets/Confirm-Labs/pile_ngrams_trigrams/tree/main) Any help would be appreciated! Thanks! I hope this is the right place to report an issue like this. Yes, it seems to be working now. In case it's helpful, the outage lasted several days. It was failing as late as yesterday morning.
[ -0.3045494854450226, -0.08470316231250763, 0.019787978380918503, 0.2753653824329376, 0.37162843346595764, -0.18100424110889435, -0.0117882639169693, 0.2689245343208313, -0.15327826142311096, -0.15398728847503662, -0.10853318870067596, 0.07101313769817352, 0.2886524498462677, 0.6164699196815491, 0.1357523649930954, 0.049449414014816284, -0.012608345597982407, -0.2657233774662018, -0.3791736960411072, 0.22044587135314941, -0.016524724662303925, 0.17678509652614594, -0.15904752910137177, 0.206585094332695, -0.4627452790737152, -0.016199154779314995, 0.1197272539138794, 0.3615226149559021, -0.446132630109787, -0.4015692472457886, -0.02798457443714142, 0.12138766795396805, 0.10331341624259949, 0.31192007660865784, -0.00012630046694539487, 0.30490320920944214, 0.3413515090942383, 0.19265896081924438, -0.5125749707221985, -0.3138464689254761, -0.3566749691963196, 0.001651570200920105, 0.04186936467885971, 0.15745332837104797, -0.11467099189758301, -0.2724042236804962, 0.08575484901666641, -0.009921051561832428, 0.3082059919834137, 0.019727442413568497, 0.10109909623861313, -0.1407671868801117, 0.10659573972225189, -0.18044701218605042, 0.04947236180305481, 0.1525556445121765, -0.11890079081058502, 0.4033035635948181, 0.13680189847946167, 0.12111767381429672, -0.007001128047704697, 0.24814611673355103, 0.1983753740787506, -0.053581804037094116, 0.16606758534908295, -0.004198078066110611, 0.3541658818721771, -0.047289442270994186, 0.17878571152687073, 0.3133968412876129, 0.23532158136367798, 0.10359914600849152, -0.3172883987426758, -0.11135783046483994, -0.1648663878440857, -0.1411854475736618, 0.4760662913322449, -0.15772324800491333, 0.12675467133522034, 0.3537708818912506, -0.037735145539045334, -0.25962120294570923, -0.412719190120697, 0.16127806901931763, -0.0736444965004921, 0.16146434843540192, -0.07936664670705795, 0.1423308551311493, 0.15014755725860596, -0.006995067931711674, 0.046257175505161285, 0.4559934139251709, -0.47637975215911865, -0.08560353517532349, -0.38973432779312134, 0.2457483857870102, 0.09569817781448364, 0.2906295657157898, -0.05278654024004936, 0.3016129434108734, 0.19832277297973633, 0.38974452018737793, -0.09434778988361359, 0.1657389998435974, 0.35581135749816895, 0.05277125909924507, -0.12740957736968994, 0.043468177318573, 0.3955797255039215, 0.5346031785011292, 0.16189968585968018, 0.04191439598798752, -0.01185811311006546, -0.18171857297420502, -0.4165526032447815, -0.06745727360248566, 0.1998569667339325, -0.4373275637626648, -0.1282629519701004, -0.024472519755363464, 0.11098372936248779, -0.1376405954360962, 0.36970818042755127, 0.28771355748176575, -0.1802758425474167, 0.38729166984558105, -0.05918879061937332, -0.20088687539100647, -0.1003853976726532, -0.32600122690200806, -0.07079736888408661, 0.05389392375946045, -0.5079111456871033, 0.0659913420677185, 0.2665911912918091, -0.1080063134431839, 0.036944128572940826, -0.11514438688755035, 0.008323787711560726, -0.08790537714958191, 0.0319611132144928, -0.1004495769739151, 0.39073070883750916, 0.18714770674705505, 0.01149999350309372, 0.27789145708084106, 0.2398795783519745, 0.14055880904197693, 0.19746483862400055, -0.12651106715202332, -0.1520843505859375, -0.3454047441482544, -0.09902507066726685, 0.054588451981544495, -0.2433689534664154, 0.094915971159935, -0.43908384442329407, 0.10105714201927185, -0.41472047567367554, -0.41170334815979004, -0.25555291771888733, 0.2285996377468109, -0.21354205906391144, -0.08406122028827667, 0.4052509665489197, 0.238590270280838, -0.4660189747810364, -0.06482478976249695, -0.006912302225828171, -0.08409032970666885, 0.008350159972906113, 0.3162514567375183, -0.08031770586967468, -0.21086379885673523, -0.25588327646255493, -0.16872121393680573, 0.2532973885536194, -0.22219619154930115, -0.4482738971710205, 0.3749242424964905, -0.219659686088562, -0.3477073013782501, -0.035082750022411346, 0.14641231298446655, 0.03331839665770531, 0.008508317172527313, 0.08169115334749222, -0.05588366091251373, 0.3327188491821289, -0.08318477869033813, -0.2511981725692749, -0.24012741446495056, -0.1551143079996109, 0.015846610069274902, 0.06913426518440247, 0.052718911319971085, -0.017146550118923187, -0.4011812210083008, 0.3792785108089447, 0.10662824660539627, 0.025533616542816162, 0.24723094701766968, 0.5742745995521545, 0.12221188098192215, 0.3227168619632721, -0.023340445011854172, 0.06724139302968979, 0.21036376059055328, -0.4262338876724243, -0.07456310093402863, -0.15561804175376892, -0.021889667958021164, -0.41741859912872314, 0.009240657091140747, 0.09621656686067581, 0.1878892183303833, -0.009332899004220963, 0.03193957358598709, -0.021768972277641296, 0.3535381853580475, -0.24372148513793945, 0.18694353103637695, -0.29550305008888245, 0.21345043182373047, -0.23795154690742493, 0.26074743270874023, -0.06294461339712143, 0.02319425344467163, 0.05778713524341583, -0.22933131456375122, 0.34236443042755127, -0.12804058194160461, -0.05830074101686478, 0.36232197284698486, -0.1528625786304474, 0.05496743693947792, 0.23051172494888306, 0.2978937029838562, 0.44210803508758545, -0.4142111539840698, -0.22455312311649323, -0.0629366934299469, -0.03985685855150223, 0.09754777699708939, -0.18876579403877258, 0.021551165729761124, -0.3520016372203827, 0.10365722328424454, 0.09965616464614868, 0.19171778857707977, 0.16018329560756683, 0.18821826577186584, -0.10100109875202179, 0.0022732242941856384, 0.28007155656814575, 0.15634195506572723, -0.2974225878715515, -0.16823101043701172, 0.20721381902694702, 0.15790614485740662, -0.13052716851234436, 0.11895833909511566, -0.10859175026416779, -0.15525299310684204, 0.0548027902841568, -0.15990179777145386, 0.37495577335357666, 0.5386199951171875, -0.06266804039478302, 0.0329570509493351, 0.007174341939389706, 0.35512036085128784, -0.20156876742839813, 0.05977122485637665, 0.14443425834178925, 0.07649627327919006, 0.13256782293319702, -0.08357445895671844, -0.11390413343906403, -0.1839257776737213, -0.23623383045196533, -0.06767163425683975, 0.32186993956565857, 0.41088995337486267, -0.5211793184280396, -0.003342241048812866, -0.23610007762908936, -0.9295296669006348, 0.3704564869403839, -0.16265560686588287, 0.12495986372232437, -0.5312139391899109, -0.19290043413639069, 0.407938688993454, -0.17546020448207855, 0.09662716835737228, -0.41324281692504883, 0.09622989594936371, -0.10764022171497345, 0.06299006193876266, -0.18131786584854126, -0.22190770506858826, -0.0897754430770874, 0.0481574684381485, 0.205241397023201, 0.21311873197555542, 0.011437375098466873, -0.25604724884033203, -0.2642015814781189, -0.38600286841392517, -0.3667408525943756, 0.28109627962112427, -0.18259796500205994, 0.30453774333000183, 0.16732172667980194, 0.3302348852157593, -0.4244985580444336, 0.3104453980922699, 0.4805701673030853, -0.2595154941082001, -0.0014075040817260742, -0.14951466023921967, -0.2033768743276596, -0.09648746997117996, 0.013635799288749695, -0.30061355233192444, 0.2564722001552582, -0.21398843824863434, 0.15563596785068512, -0.1748848259449005, 0.06550350785255432, 0.19736531376838684, 0.13070133328437805, -0.056709662079811096, 0.06975936144590378, 0.03378869593143463, -0.21750310063362122, -0.6194813251495361, 0.09194435179233551, -0.08811801671981812, -0.38505035638809204, 0.3859245777130127, 0.24795259535312653, 0.3468635678291321, 0.10767176747322083, -0.38727155327796936, -0.35246753692626953, -0.1938500553369522, -0.32771119475364685, -0.04592548683285713, -0.3186798095703125, 0.02169674076139927, -0.15301921963691711, -0.1429494470357895, 0.051840752363204956, -0.03448765352368355, -0.11957670748233795, 0.07881098985671997, 0.3840029239654541, 0.04250689968466759, 0.38109543919563293, 0.25679659843444824, 0.04663022607564926, 0.10467846691608429, 0.24313928186893463, 0.27641740441322327, -0.23167990148067474, 0.44233644008636475, 0.1854121834039688, -0.18013808131217957, -0.048684149980545044, -0.11585137248039246, -0.025625362992286682, -0.1163213774561882, 0.2988198399543762, 0.0354655459523201, -0.3997965455055237, -0.14929908514022827, -0.4659784436225891, -0.13495346903800964, 0.02605614624917507, 0.06867226958274841, 0.05626234412193298, 0.2437337338924408, 0.3572359085083008, 0.059434667229652405, -0.1740313470363617, 0.20884640514850616, 0.12203282117843628, 0.16564951837062836, 0.004735726863145828, -0.19471098482608795, -0.0586850568652153, -0.28973647952079773, 0.14131109416484833, 0.017413411289453506, 0.3475194573402405, -0.3732064366340637, 0.052169643342494965, 0.30777707695961, -0.18677732348442078, 0.4480922222137451, -0.33664798736572266, 0.3045550584793091, 0.2702644169330597, -0.14450719952583313, -0.49745795130729675, 0.10444382578134537, 0.16143186390399933, 0.13146138191223145, 0.5968836545944214, -0.03318412974476814, -0.2112060785293579, -0.06591647863388062, 0.1586105227470398, -0.3153962790966034, -0.053499478846788406, 0.001165248453617096, -0.19146907329559326, -0.18428629636764526, -0.04244587942957878, -0.21906423568725586, 0.12882551550865173, 0.05033500865101814, 0.009142830967903137, -0.13499577343463898, 0.25093984603881836, -0.1367185264825821, 0.026926301419734955, 0.38160330057144165, 0.2030029594898224, -0.035334840416908264, 0.055329158902168274, 0.7571614980697632, 0.6979156732559204, 0.06920681893825531, 0.7083930373191833, 0.23398910462856293, -0.10728625953197479, 0.18021881580352783, 0.05901724100112915, -0.08144976198673248, 0.35884010791778564, -0.14398193359375, 0.14961744844913483, 0.4255067706108093, 0.020446451380848885, -0.1979147046804428, 0.11262214928865433, 0.48373836278915405, 0.074090875685215, -0.48692792654037476, -0.22718586027622223, 0.3730117380619049, 0.12700103223323822, -0.2649037837982178, 0.6205262541770935, 0.534791111946106, 0.08783306181430817, -0.03209106624126434, -0.04890848323702812, 0.9178367257118225, -0.016273127868771553, 0.020424734801054, 0.03301277756690979, -0.14009959995746613, 0.38876423239707947, 0.21300289034843445, 0.1590147316455841, -0.35185980796813965, -0.08975240588188171, -0.13925735652446747, -0.010561615228652954, 0.010805509053170681, -0.18405038118362427, 0.08159984648227692, 0.1448981761932373, 0.031098052859306335, 0.24363523721694946, -0.06846944987773895, -0.05122260004281998, -0.20685230195522308, 0.2390722781419754, -0.09642469882965088, 0.046937450766563416, -0.07735025137662888, 0.01515839621424675, -0.21619778871536255, -0.05458163097500801, -0.2731423079967499, -0.031214475631713867, -0.31868886947631836, -0.007272206246852875, -0.2769445776939392, 0.24142558872699738, -0.16483095288276672, -0.2848881483078003, 0.11047074943780899, 0.057780634611845016, 0.09853332489728928, 0.005853521637618542, -0.47420650720596313, 0.29493990540504456, -0.5396028161048889, -0.020318565890192986, 0.04417385160923004, 0.0373157374560833, 0.07622260600328445, 0.013214372098445892, -0.3934466242790222, 0.06944824755191803, 0.14243902266025543, 0.017357751727104187, -0.3150576651096344, 0.09741246700286865, 0.03177192807197571, -0.1240883395075798, 0.3202786445617676, -0.28513088822364807, -0.23054160177707672, -0.26824313402175903, 0.03175990283489227, 0.19886139035224915, 0.024277623742818832, 0.18424999713897705, 0.46368929743766785, -0.15883278846740723, 0.00029628071933984756, 0.44496771693229675, -0.39656728506088257, -0.11721514165401459, 0.1337660849094391, 0.24415913224220276, -0.16174662113189697, -0.047962017357349396, -0.07575313746929169, -0.1863669455051422, -0.20261242985725403, -0.07829348742961884, 0.15111051499843597, 0.2207028567790985, 0.1703757643699646, -0.010929396376013756, 0.21905608475208282, 0.060078639537096024, -0.18878987431526184, -0.3838053345680237, -0.10522325336933136, 0.3209519684314728, -0.2614004611968994, 0.07819649577140808, -0.16724449396133423, -0.25446420907974243, 0.2712363302707672, -0.33839380741119385, -0.19618014991283417, 0.1653905212879181, -0.15385136008262634, -0.17287230491638184, -0.09367741644382477, 0.040683381259441376, 0.35110145807266235, -0.3750849664211273, -0.05065446346998215, 0.04276644438505173, -0.1378968060016632, -0.0012854523956775665, -0.09657245874404907, 0.11131426692008972, 0.07014845311641693, -0.3717033565044403, -0.05679469555616379, -0.06154153496026993, -0.07468493282794952, 0.11768217384815216, -0.0995524674654007, 0.22542531788349152, 0.20477119088172913, -0.19461217522621155, -0.3576395809650421, -0.18638275563716888, -0.002366088330745697, 0.5131638050079346, 0.0764630138874054, 0.21483203768730164, 0.2505914866924286, 0.10803436487913132, 0.12958306074142456, -0.21901774406433105, -0.1577783226966858, -0.09723179042339325, -0.09055651724338531, -0.15646934509277344, 0.5716464519500732, -0.33791303634643555, 0.10858117789030075, -0.02350636199116707, 0.5846174955368042, 0.14269830286502838, 0.2278718650341034, 0.039729878306388855, 0.13351909816265106, 0.12521123886108398, -0.017057955265045166, 0.04051629826426506, 0.2166738063097, 0.14464882016181946, 0.0734139233827591, -0.17041878402233124, 0.34308868646621704, -0.2589533030986786, -0.15660391747951508, 0.09993669390678406, 0.3741716742515564, -0.03129328787326813, 0.18367047607898712, -0.04725589230656624, -0.019551068544387817, -0.11251090466976166, -0.07377652823925018, 0.06272751092910767, 0.1624564528465271, 0.5462241172790527, 0.012377245351672173, 0.1570916324853897, -0.33238643407821655, 0.5001972913742065, -0.31052082777023315, -0.2496018409729004, -0.2913298010826111, 0.32662755250930786, -0.5067828297615051, -0.06147829070687294, -0.11868836730718613, 0.5589179396629333, 0.026305686682462692, 0.09505520761013031, -0.3033873438835144, 0.08115453273057938, 0.03690306842327118, 0.026519522070884705, -0.7527365684509277, -0.18130922317504883, 0.00202043354511261, 0.09318358451128006, 0.054991986602544785, 0.04731844738125801, -0.12152528762817383, 0.17749284207820892, -0.08210162073373795, -0.5208662152290344, -0.1307302564382553, 0.23375286161899567, 0.37314778566360474, -0.044223446398973465, 0.0012989901006221771, 0.2727486193180084, -0.07536664605140686, 0.37666618824005127, 0.32147276401519775, 0.4860529601573944, -0.07732123136520386, 0.19195416569709778, 0.005611706525087357, -0.26160934567451477, -0.007388036698102951, -0.20262089371681213, 0.06949815154075623, 0.2535250782966614, -0.1950933188199997, 0.28818655014038086, 0.06851314008235931, -0.07668906450271606, 0.08112430572509766, -0.3625645637512207, 0.3667279779911041, 0.19135379791259766, 0.2002687156200409, -0.3194403648376465, -0.11998563259840012, -0.132318913936615, -0.2863589823246002, -0.4358309507369995, 0.03481539338827133, 0.3101211488246918, -0.14905454218387604, 0.14667914807796478, -0.1229829341173172, -0.0216207318007946, -0.01632099784910679, 0.49414584040641785, 0.35942718386650085, 0.3982473909854889, 0.0391228087246418, -0.38769465684890747, -0.3825305700302124, 0.07739107310771942, -0.11501581221818924, 0.245820552110672, 0.05454128980636597, 0.0139956995844841, -0.11615428328514099, -0.04894335940480232, 0.6672636270523071, 0.3039183020591736, -0.2946903705596924, 0.19662855565547943, -0.3644694685935974, 0.11346329003572464, 0.13544705510139465, 0.17681479454040527, -0.3705222010612488, 0.018763624131679535, 0.41419294476509094, 0.05869806185364723, -0.14795516431331635, -0.06737193465232849, 0.05747281759977341, -0.6192580461502075, -0.38906025886535645, 0.3055415153503418, 0.40655791759490967, 0.4150029718875885, 0.1840572953224182, 0.012248829007148743, -0.6105983257293701, -0.4574016332626343, 0.12771081924438477, 0.2531009614467621, 0.46537789702415466, 0.4028538763523102, 0.1123812273144722, -0.24721364676952362, -0.09039320796728134, 0.3956123888492584, -0.02735794335603714, 0.10167095065116882, -0.1699400544166565, -0.1342756301164627, -0.01843017339706421, 0.11880046129226685, 0.031371623277664185, 0.014526549726724625, 0.16539818048477173, 0.03333049267530441, 0.0024094879627227783, -0.36920028924942017, 0.49135884642601013, -0.3716740608215332, 0.10721816122531891, -0.25853613018989563, 0.24905607104301453, 0.25181668996810913, 0.1560697704553604, 0.042077019810676575, -0.06816565990447998, -0.033339373767375946, 0.18735894560813904, 0.008942373096942902, 0.25663015246391296, -0.1874750554561615, 0.1274513155221939, -0.10492371767759323, 0.19930316507816315, -0.07553700357675552, -0.2461109757423401, 0.047833047807216644, 0.08947702497243881 ]
https://github.com/huggingface/datasets/issues/5975
Hi ! can you try to set the upper case environment variables `HTTP_PROXY` and `HTTPS_PROXY` ? We use `aiohttp` for streaming and it uses case sensitive environment variables
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
28
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 Hi ! can you try to set the upper case environment variables `HTTP_PROXY` and `HTTPS_PROXY` ? We use `aiohttp` for streaming and it uses case sensitive environment variables
[ -0.20426958799362183, -0.12143173813819885, 0.09346703439950943, -0.11213923990726471, 0.3825293183326721, 0.020822487771511078, 0.13100317120552063, 0.1265920102596283, -0.06272534281015396, 0.1365622580051422, 0.07379918545484543, -0.17025922238826752, 0.20304013788700104, 0.09881504625082016, 0.11162298917770386, -0.07560823112726212, 0.08502167463302612, -0.08466201275587082, -0.015370599925518036, 0.15250805020332336, 0.004328198730945587, 0.04321891814470291, -0.10512759536504745, -0.07527786493301392, -0.03528594970703125, -0.023391397669911385, 0.0562412291765213, 0.3531203866004944, -0.2163141965866089, 0.0689217671751976, 0.23245084285736084, 0.1102275401353836, -0.014730822294950485, 0.5418376326560974, -0.0001280889700865373, 0.18010279536247253, 0.39852529764175415, -0.19876782596111298, -0.3022354245185852, -0.3564809560775757, -0.37422043085098267, 0.025196164846420288, -0.01746201142668724, -0.04454416036605835, -0.004106074571609497, -0.06256552785634995, 0.3318279981613159, -0.5658832788467407, 0.3956933915615082, 0.29032212495803833, 0.06492425501346588, 0.14576001465320587, -0.06535051763057709, 0.33343350887298584, -0.05877210944890976, 0.07031457126140594, -0.2347838133573532, -0.03608756512403488, 0.20909979939460754, 0.0933796614408493, 0.19368718564510345, 0.4084998369216919, -0.3634755611419678, 0.011075105518102646, 0.45136797428131104, -0.12768536806106567, -0.14484870433807373, -0.37434422969818115, -0.059933293610811234, 0.5890179872512817, 0.5121989846229553, -0.29557469487190247, -0.546581506729126, -0.2975993752479553, 0.04363667219877243, -0.1178024411201477, 0.26182255148887634, 0.2569328546524048, -0.05728378891944885, 0.15198439359664917, -0.006707601249217987, -0.1700063794851303, -0.2250121831893921, 0.09692634642124176, 0.09679442644119263, 0.3142459988594055, -0.050729457288980484, 0.16361069679260254, 0.034642789512872696, -0.04994768649339676, -0.22555868327617645, -0.3617190420627594, -0.18163061141967773, 0.14373214542865753, -0.23938865959644318, 0.15159672498703003, 0.00007953494787216187, 0.1993555873632431, 0.12698142230510712, 0.22331522405147552, -0.027217678725719452, 0.13300862908363342, -0.27792850136756897, 0.17310209572315216, 0.08010318130254745, 0.1604239046573639, -0.019433792680501938, 0.20534005761146545, 0.349191814661026, 0.23843801021575928, 0.062177225947380066, -0.1941959708929062, 0.38210558891296387, 0.02627791464328766, -0.4878257215023041, -0.07403318583965302, 0.7425767183303833, -0.2410781979560852, -0.3629048466682434, 0.1607941836118698, -0.4797252416610718, 0.09179145097732544, 0.16180220246315002, 0.3972143530845642, -0.2283635139465332, 0.3985498249530792, 0.16708670556545258, 0.3126887083053589, -0.21478882431983948, -0.20694419741630554, -0.08731378614902496, -0.1753108948469162, 0.07219289988279343, 0.12940360605716705, -0.015257060527801514, -0.15104468166828156, 0.33977067470550537, -0.038358062505722046, 0.23550395667552948, 0.02395731210708618, 0.030208244919776917, -0.07147198915481567, -0.010753817856311798, 0.37193307280540466, -0.03268064185976982, 0.1371743083000183, 0.19700169563293457, -0.1498420387506485, 0.05729575455188751, -0.016422836109995842, -0.04463750496506691, -0.271059513092041, -0.09539280831813812, 0.03716099634766579, -0.24821272492408752, -0.09266971051692963, -0.39922448992729187, 0.18053030967712402, -0.2834903597831726, -0.21260866522789001, 0.20074766874313354, 0.09516498446464539, -0.2502140700817108, 0.1629287451505661, 0.3151286244392395, 0.7508360743522644, -0.29443296790122986, -0.18382810056209564, 0.11789613962173462, -0.20439767837524414, 0.42624518275260925, 0.11164349317550659, 0.0075019486248493195, -0.277120441198349, -0.1387520432472229, 0.19628888368606567, 0.2453891485929489, -0.3456043004989624, -0.5485813021659851, 0.3150632083415985, -0.17606401443481445, 0.4336555600166321, 0.35271063446998596, 0.20045910775661469, -0.020996037870645523, -0.0118807852268219, -0.12391813099384308, 0.4747169017791748, -0.2609429359436035, 0.12874367833137512, -0.18347465991973877, -0.2906385064125061, 0.06766348332166672, 0.07216407358646393, -0.2117258459329605, 0.25955286622047424, -0.048920419067144394, -0.10376427322626114, 0.2623232901096344, -0.0679398626089096, 0.06775189191102982, 0.3063317835330963, 0.32241004705429077, 0.4977395534515381, -0.10878084599971771, -0.11765839904546738, -0.29174673557281494, 0.026078157126903534, 0.24913083016872406, -0.08402197062969208, -0.12529298663139343, -0.29523682594299316, -0.14236938953399658, -0.13278228044509888, -0.12233655899763107, -0.21126605570316315, -0.10008708387613297, 0.39998048543930054, -0.0016388818621635437, 0.17791923880577087, -0.25796109437942505, 0.6626654863357544, -0.36901843547821045, 0.07939523458480835, -0.29320672154426575, 0.236537367105484, 0.07125185430049896, -0.09767167270183563, -0.10898303985595703, 0.016158100217580795, 0.29777151346206665, -0.12356871366500854, -0.24563351273536682, 0.4923403859138489, 0.04356365650892258, 0.3722553849220276, 0.21949084103107452, 0.07198699563741684, 0.21030214428901672, -0.2156910002231598, -0.06631933152675629, 0.4472789764404297, 0.2528986930847168, 0.06633070856332779, -0.042188744992017746, 0.1399664282798767, 0.22879433631896973, 0.3094944953918457, 0.023082509636878967, 0.004775397479534149, 0.35261332988739014, 0.09194673597812653, -0.3894208073616028, -0.029828742146492004, 0.4949887990951538, -0.22159546613693237, 0.27128878235816956, -0.17593792080879211, -0.4344952702522278, 0.10358075052499771, -0.11054572463035583, 0.05289347469806671, 0.022268176078796387, -0.006390077527612448, -0.09601889550685883, 0.06777262687683105, 0.013367122039198875, 0.289318323135376, 0.32820504903793335, 0.019313514232635498, -0.29944148659706116, 0.20164059102535248, 0.09912704676389694, -0.16884411871433258, 0.12752538919448853, 0.08343619853258133, 0.025074172765016556, -0.06791382282972336, 0.07589304447174072, -0.002824472263455391, -0.2122061848640442, -0.2502296268939972, -0.20776446163654327, 0.0291332695633173, -0.5222561955451965, 0.37790435552597046, -0.32647866010665894, -0.5768648982048035, -0.0014835111796855927, -0.08389213681221008, -0.2722349166870117, -0.38048529624938965, -0.10529997944831848, 0.4200490415096283, -0.2118041068315506, 0.20929330587387085, -0.5415738821029663, 0.1482156664133072, 0.14504525065422058, -0.29367443919181824, -0.35543471574783325, 0.08354455232620239, -0.0837121456861496, -0.09616628289222717, 0.11766371130943298, -0.08551757037639618, 0.31661128997802734, -0.07667775452136993, -0.4604787230491638, -0.4318910241127014, -0.21594136953353882, -0.06630240380764008, 0.010557400062680244, 0.5369324684143066, -0.048525720834732056, 0.4569944441318512, -0.10047688335180283, -0.1538311243057251, 0.23353661596775055, -0.0338822640478611, 0.007526658475399017, -0.12755563855171204, 0.0854068398475647, 0.13718295097351074, -0.026189353317022324, 0.008008522912859917, -0.3043273687362671, -0.27915531396865845, -0.04635977745056152, -0.4069460332393646, -0.03395116329193115, 0.31610792875289917, -0.13638097047805786, 0.014688093215227127, -0.25350138545036316, -0.03218776360154152, -0.10049870610237122, -0.5724443197250366, 0.32522153854370117, 0.03080686181783676, -0.16765908896923065, 0.22356586158275604, 0.1544838398694992, -0.45502936840057373, 0.25995585322380066, -0.4329594373703003, -0.4873913526535034, -0.04338791221380234, -0.026162415742874146, -0.08900073170661926, -0.14091737568378448, 0.12566661834716797, -0.3310079276561737, 0.15934059023857117, -0.29882943630218506, -0.17673534154891968, -0.12134119123220444, 0.08354713022708893, 0.38742128014564514, 0.08030349016189575, 0.6335124969482422, -0.03178912028670311, 0.7957074642181396, 0.21677757799625397, 0.23160773515701294, 0.5836794972419739, -0.09050234407186508, 0.3991343677043915, -0.011577080935239792, -0.23285211622714996, 0.2552066147327423, 0.13247589766979218, -0.15115907788276672, -0.04971826821565628, 0.0798850953578949, 0.17601679265499115, -0.1867990791797638, 0.09500417113304138, -0.18644282221794128, -0.16325819492340088, -0.09828899800777435, -0.052250925451517105, 0.09921322762966156, 0.16414915025234222, 0.18781699240207672, 0.09641487896442413, -0.18317750096321106, -0.10502219945192337, 0.595702052116394, 0.2648499310016632, 0.2065257430076599, -0.0004935190081596375, -0.10860070586204529, -0.7079077959060669, 0.3474184274673462, 0.17640267312526703, 0.37916895747184753, -0.24330627918243408, 0.06251611560583115, 0.08915860205888748, -0.06098423898220062, 0.6994502544403076, -0.11644893884658813, 0.1804620921611786, -0.08101724088191986, -0.05426342412829399, -0.33724844455718994, -0.15362390875816345, 0.13404646515846252, 0.35389670729637146, 0.26247599720954895, -0.16316279768943787, -0.3345490097999573, 0.008867688477039337, 0.028691362589597702, -0.10188038647174835, 0.08058379590511322, -0.0018650367856025696, -0.4174276888370514, -0.3597971796989441, -0.10293039679527283, -0.016411077231168747, -0.06725075840950012, 0.09284526854753494, 0.0955408439040184, 0.1233789399266243, 0.0008390005677938461, 0.1477546989917755, -0.07309189438819885, -0.05394389480352402, 0.2324669510126114, 0.10661278665065765, 0.06639133393764496, 0.20124423503875732, 0.35049399733543396, 0.1682283878326416, 0.5492634177207947, 0.41489315032958984, -0.5902190804481506, -0.06777110695838928, 0.23978224396705627, -0.027432672679424286, 0.47829094529151917, -0.05966987460851669, 0.15344063937664032, 0.5290067195892334, 0.22837704420089722, -0.21556316316127777, 0.23687843978405, 0.3730790615081787, 0.07217603176832199, -0.018836230039596558, -0.6389555335044861, 0.41277673840522766, 0.07464508712291718, 0.13488757610321045, 0.5197599530220032, 0.403188556432724, -0.19360604882240295, -0.037850894033908844, -0.22302135825157166, 0.897240936756134, 0.15893475711345673, 0.04382939264178276, 0.29168739914894104, -0.07760309427976608, 0.3551110327243805, -0.3130265772342682, 0.2500157356262207, 0.009959176182746887, -0.37347811460494995, -0.1953061819076538, -0.07049454748630524, 0.30509230494499207, -0.4498361051082611, -0.1715872436761856, 0.313484251499176, -0.040115199983119965, 0.16221235692501068, 0.028922758996486664, -0.052870411425828934, -0.571142852306366, -0.13585728406906128, -0.6279258728027344, -0.00887945294380188, -0.30993345379829407, 0.3556044101715088, -0.0008079521358013153, -0.0470673069357872, -0.0985797569155693, -0.14023157954216003, -0.4610804617404938, 0.3029824495315552, -0.4925919473171234, -0.19690251350402832, -0.22539041936397552, -0.09722642600536346, 0.000028036534786224365, 0.03669115900993347, -0.07450975477695465, -0.07701687514781952, -0.4189583361148834, 0.4747849404811859, -0.2069101184606552, 0.03946496918797493, 0.028470337390899658, -0.09820933640003204, 0.21657611429691315, 0.0161760151386261, -0.2528992295265198, 0.04764413461089134, -0.13343146443367004, -0.3331923186779022, 0.05337534844875336, -0.24627888202667236, 0.33161187171936035, 0.04311930760741234, -0.19267375767230988, -0.011230230331420898, 0.21719670295715332, -0.11341007053852081, 0.002114510163664818, -0.07843708992004395, -0.26600930094718933, -0.045172642916440964, -0.055660318583250046, -0.253953754901886, -0.11721821129322052, 0.524188756942749, -0.3850037455558777, 0.2627106308937073, 0.5709685683250427, 0.15849857032299042, -0.07981220632791519, -0.026386991143226624, 0.06330898404121399, -0.27342814207077026, -0.0006906986236572266, 0.17192041873931885, 0.04779379069805145, 0.03866639733314514, -0.2633732259273529, 0.04625337943434715, -0.21833211183547974, -0.1857989877462387, -0.01737157255411148, -0.5469328761100769, -0.04572473466396332, 0.06724034249782562, -0.19868497550487518, -0.015487287193536758, 0.23901885747909546, 0.15027779340744019, 0.20648880302906036, -0.1261177659034729, -0.15056867897510529, -0.1534762978553772, -0.09648497402667999, 0.08158868551254272, 0.2784695029258728, 0.2738916873931885, 0.3941866159439087, -0.21006107330322266, -0.08768872171640396, 0.07579834759235382, -0.2613852322101593, -0.04196380078792572, -0.21109828352928162, 0.21409308910369873, 0.10951796919107437, -0.5341963171958923, -0.10583809018135071, -0.42331641912460327, -0.13777971267700195, -0.14462243020534515, 0.14999353885650635, 0.49230897426605225, 0.05852200463414192, -0.2216309905052185, -0.04694592207670212, 0.13248111307621002, -0.10136447846889496, 0.09205089509487152, -0.04765496402978897, 0.3551616072654724, 0.09766894578933716, 0.056159719824790955, -0.01957801915705204, 0.015476062893867493, -0.15528714656829834, -0.11716286092996597, 0.06610780209302902, 0.2890383303165436, 0.3892284631729126, -0.1685970574617386, 0.039016835391521454, 0.25157153606414795, 0.331295907497406, 0.29340267181396484, -0.1319795548915863, 0.012055709958076477, 0.302155077457428, 0.023649001494050026, -0.025929618626832962, 0.06347086280584335, 0.5482990145683289, 0.23205678164958954, 0.16172118484973907, 0.01924482360482216, -0.08165643364191055, 0.04012560844421387, 0.01878323405981064, 0.09549728780984879, 0.4451165497303009, 0.20387963950634003, 0.5547863245010376, 0.10101206600666046, 0.06398939341306686, 0.21777360141277313, -0.15503977239131927, 0.14141620695590973, 0.19890829920768738, 0.3944427967071533, 0.029094956815242767, 0.27217039465904236, -0.039837613701820374, 0.12045899033546448, -0.29054194688796997, -0.4262669086456299, -0.09979122877120972, 0.045462317764759064, -0.2606084644794464, 0.39487379789352417, 0.019810235127806664, -0.01440170407295227, -0.47190582752227783, -0.06989000737667084, -0.21132609248161316, 0.21729646623134613, 0.0544172041118145, -0.17191818356513977, -0.16437619924545288, -0.028853081166744232, 0.18137851357460022, 0.15519222617149353, 0.07738660275936127, -0.016082216054201126, -0.0016744062304496765, 0.09134024381637573, -0.06367413699626923, -0.3238004148006439, 0.004448605701327324, 0.08919693529605865, 0.4979913830757141, -0.1806364357471466, 0.23819449543952942, 0.08742794394493103, 0.03182317316532135, 0.30997851490974426, 0.3777470290660858, 0.3797818720340729, 0.2720141112804413, 0.03165828064084053, 0.178130105137825, 0.1881284862756729, -0.04854641854763031, 0.06228411942720413, 0.014299776405096054, 0.047867342829704285, -0.21691295504570007, 0.19694742560386658, 0.030834350734949112, -0.04295404627919197, 0.12238271534442902, -0.016568707302212715, 0.4625832140445709, -0.45218703150749207, 0.028506651520729065, -0.3964351415634155, 0.42338016629219055, -0.3472498059272766, -0.03975982591509819, -0.27361172437667847, 0.4078328013420105, 0.18574334681034088, -0.0677681490778923, 0.146498441696167, 0.0052943602204322815, -0.03771769255399704, -0.1265682429075241, 0.2274419367313385, 0.5239182710647583, -0.13380733132362366, -0.18565544486045837, -0.02233869582414627, -0.3326871693134308, 0.10639306902885437, -0.17148509621620178, -0.36220982670783997, -0.1086394190788269, 0.19431233406066895, -0.008535422384738922, 0.07906489074230194, 0.19606219232082367, 0.11895374953746796, 0.08584415912628174, 0.05144559219479561, -0.17309120297431946, -0.32856833934783936, -0.42622995376586914, 0.2181481122970581, -0.04472776874899864, -0.2407984435558319, 0.14394024014472961, 0.09456400573253632, -0.10059614479541779, 0.20489482581615448, -0.2974563241004944, -0.26031023263931274, -0.3691065311431885, 0.25417613983154297, 0.08928293734788895, 0.1925244927406311, -0.08499472588300705, -0.0850975289940834, -0.28182998299598694, -0.17750725150108337, -0.2962954044342041, -0.31259483098983765, -0.21050116419792175, 0.4187695384025574, -0.30034559965133667, -0.04255276173353195, -0.42946505546569824, 0.5008694529533386, 0.022198788821697235, -0.1418464183807373, -0.21556687355041504, 0.1584574580192566, -0.2753880023956299, 0.19476096332073212, -0.300272673368454, 0.07857340574264526, -0.14928525686264038, 0.12046469748020172, -0.21925339102745056, -0.15452858805656433, 0.7189850807189941, -0.32956376671791077, -0.057589009404182434, -0.18018126487731934, 0.11928176879882812, 0.3272121846675873, 0.03687760978937149, -0.22702732682228088, 0.32964712381362915, 0.08596381545066833, 0.06782021373510361, -0.08173669129610062, -0.004432763904333115, -0.10789982974529266, 0.11802311986684799, -0.06753940880298615, -0.08890290558338165, 0.14280661940574646, -0.06298265606164932, 0.4813254177570343, -0.055998384952545166 ]
https://github.com/huggingface/datasets/issues/5975
Hi, thanks for the quick reply. I set the uppercase env variables with ` os.environ['HTTP_PROXY'] = "http://example.com:xxxx" os.environ['HTTPS_PROXY'] = "http://example.com:xxxx" ` However, I still get the same error. One thing that could be helpfull: When downloading a dataset without streaming i get the following message: _HF google storage unreachable. Downloading and preparing it from source_. The download does however work as expected.
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
62
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 Hi, thanks for the quick reply. I set the uppercase env variables with ` os.environ['HTTP_PROXY'] = "http://example.com:xxxx" os.environ['HTTPS_PROXY'] = "http://example.com:xxxx" ` However, I still get the same error. One thing that could be helpfull: When downloading a dataset without streaming i get the following message: _HF google storage unreachable. Downloading and preparing it from source_. The download does however work as expected.
[ -0.15595516562461853, -0.09131626784801483, 0.09897124022245407, -0.10627853870391846, 0.39636728167533875, -0.00484660267829895, 0.11199093610048294, 0.07572492212057114, 0.03164759278297424, 0.15219303965568542, 0.08398015052080154, -0.21240690350532532, 0.17867884039878845, 0.1644148826599121, 0.11753114312887192, -0.059361781924963, 0.06601671874523163, -0.08707556128501892, -0.018525708466768265, 0.1428111493587494, -0.02138640731573105, 0.07532382011413574, -0.11778207868337631, -0.17152541875839233, -0.04059131443500519, 0.007949521765112877, 0.03416837751865387, 0.33091387152671814, -0.2233181893825531, 0.05180495232343674, 0.23454827070236206, 0.11952491104602814, -0.038457754999399185, 0.5335402488708496, -0.00013006932567805052, 0.1926550716161728, 0.36282622814178467, -0.21521542966365814, -0.3137785792350769, -0.40741246938705444, -0.3201577663421631, -0.029922571033239365, -0.025486528873443604, -0.0011270195245742798, -0.032480638474226, -0.09635777771472931, 0.34380218386650085, -0.5672948360443115, 0.3557877838611603, 0.2578064203262329, 0.044799163937568665, 0.1070188581943512, -0.036762677133083344, 0.33295512199401855, -0.0031606927514076233, 0.0939856469631195, -0.242407888174057, 0.06954319775104523, 0.19521073997020721, 0.07143823057413101, 0.2042405903339386, 0.4041765332221985, -0.3536342680454254, 0.027023646980524063, 0.5253283977508545, -0.11929348111152649, -0.22521540522575378, -0.38241317868232727, -0.08124370872974396, 0.5652782320976257, 0.5512081384658813, -0.31665828824043274, -0.5345048904418945, -0.3047056198120117, 0.008191432803869247, -0.1082620695233345, 0.27288562059402466, 0.24227562546730042, -0.06122494861483574, 0.1767500936985016, -0.14173313975334167, -0.24039800465106964, -0.2016485333442688, 0.08208958804607391, 0.05827191472053528, 0.2851552367210388, -0.026218395680189133, 0.1402595490217209, 0.009762804955244064, 0.00753171369433403, -0.2472803145647049, -0.36681652069091797, -0.2105327993631363, 0.14974576234817505, -0.2681575417518616, 0.15199194848537445, 0.02035474218428135, 0.1645321249961853, 0.17158496379852295, 0.23874202370643616, -0.033773720264434814, 0.13947230577468872, -0.27960288524627686, 0.1669713407754898, 0.11601695418357849, 0.1757839471101761, -0.08098247647285461, 0.22417792677879333, 0.3232842981815338, 0.2613961100578308, 0.09812618792057037, -0.2025795876979828, 0.4506736099720001, 0.025068428367376328, -0.47776132822036743, -0.05504589527845383, 0.7072630524635315, -0.2410467118024826, -0.3746255040168762, 0.17586684226989746, -0.5214483737945557, 0.08877638727426529, 0.15633924305438995, 0.37457627058029175, -0.25887593626976013, 0.361264169216156, 0.1853899508714676, 0.31586316227912903, -0.21650919318199158, -0.16351532936096191, -0.07764167338609695, -0.12298378348350525, 0.049553170800209045, 0.1688854992389679, 0.045839376747608185, -0.1790216863155365, 0.32811909914016724, -0.02441916987299919, 0.18563704192638397, 0.06067201495170593, 0.04107339680194855, -0.1337866485118866, 0.019068269059062004, 0.37356680631637573, -0.02693108469247818, 0.12292291969060898, 0.20193959772586823, -0.08588665723800659, 0.04335394501686096, -0.04871658980846405, -0.01674608886241913, -0.2858097553253174, -0.065379299223423, 0.024860356003046036, -0.2755628228187561, -0.07508312165737152, -0.4180002212524414, 0.21211528778076172, -0.3034566342830658, -0.2128613144159317, 0.17301955819129944, 0.1199583113193512, -0.27342700958251953, 0.13214758038520813, 0.36566153168678284, 0.7913836240768433, -0.32841765880584717, -0.17769783735275269, 0.149229496717453, -0.21403715014457703, 0.4181655943393707, 0.09011876583099365, 0.040369559079408646, -0.2218385487794876, -0.17303219437599182, 0.14631199836730957, 0.14756859838962555, -0.25927576422691345, -0.5617656111717224, 0.3360724449157715, -0.16396711766719818, 0.46382269263267517, 0.299454927444458, 0.17882698774337769, 0.0034136883914470673, 0.04953818768262863, -0.11822336912155151, 0.49411311745643616, -0.2546044588088989, 0.12279161065816879, -0.1894000619649887, -0.32605165243148804, 0.018875205889344215, 0.05897513031959534, -0.13293860852718353, 0.2922675609588623, -0.011418767273426056, -0.10582711547613144, 0.20318345725536346, -0.05393180996179581, 0.1005806177854538, 0.35413557291030884, 0.3483228385448456, 0.467831015586853, -0.0993276983499527, -0.11468841135501862, -0.35377630591392517, 0.06988871097564697, 0.1995926797389984, -0.07810041308403015, -0.13870638608932495, -0.2683652639389038, -0.12387321889400482, -0.1432662010192871, -0.08707410097122192, -0.2490125149488449, -0.11857138574123383, 0.3960456848144531, 0.0035999566316604614, 0.17636141180992126, -0.2658728361129761, 0.6393871307373047, -0.3186115324497223, 0.0610005185008049, -0.3019164204597473, 0.301412969827652, 0.05991576611995697, -0.13050483167171478, -0.10210096836090088, -0.02253684401512146, 0.278761625289917, -0.09656848013401031, -0.21312271058559418, 0.4885712265968323, 0.018277958035469055, 0.4105374217033386, 0.1872454136610031, 0.09544691443443298, 0.27229341864585876, -0.247992143034935, -0.041487470269203186, 0.4499731957912445, 0.22668488323688507, 0.07008524239063263, -0.08770160377025604, 0.12327899038791656, 0.24726346135139465, 0.28658100962638855, 0.05141158401966095, -0.006056152284145355, 0.29323673248291016, 0.10857518017292023, -0.346303254365921, -0.054312095046043396, 0.4897240996360779, -0.11189407855272293, 0.2648696005344391, -0.19466790556907654, -0.425785630941391, 0.15394864976406097, -0.09573225677013397, 0.11133500933647156, 0.013101484626531601, -0.0030886316671967506, -0.07480964064598083, 0.005861304700374603, 0.051931753754615784, 0.2523254156112671, 0.31156450510025024, -0.018371781334280968, -0.2542418837547302, 0.2217637300491333, 0.09340287744998932, -0.15413667261600494, 0.0743718296289444, 0.05678509920835495, 0.049737561494112015, 0.016588103026151657, 0.04557470604777336, 0.0025349855422973633, -0.19373475015163422, -0.2286229133605957, -0.19361892342567444, 0.009834686294198036, -0.5198336839675903, 0.35720422863960266, -0.3534071445465088, -0.492146372795105, 0.01484667882323265, -0.13658377528190613, -0.2671593725681305, -0.3771859407424927, -0.12223601341247559, 0.47154414653778076, -0.21716716885566711, 0.16640040278434753, -0.5109534859657288, 0.1719341278076172, 0.11267782002687454, -0.33796605467796326, -0.33097410202026367, 0.1091475784778595, -0.03597553074359894, -0.11254555732011795, 0.10672076046466827, -0.05993437021970749, 0.28408321738243103, -0.06663547456264496, -0.4694819450378418, -0.5087411999702454, -0.20518335700035095, -0.03810306638479233, 0.029673341661691666, 0.5225592851638794, -0.01656896248459816, 0.46536386013031006, -0.10716737061738968, -0.08887828141450882, 0.21313047409057617, -0.04392944648861885, -0.015826627612113953, -0.12940727174282074, 0.0734892338514328, 0.1572694480419159, -0.04797429218888283, -0.009570237249135971, -0.3468025028705597, -0.25839874148368835, -0.04223562031984329, -0.3777875304222107, -0.04967820644378662, 0.281963586807251, -0.10396352410316467, 0.020743656903505325, -0.184357151389122, -0.07806381583213806, -0.06888114660978317, -0.5564312934875488, 0.3532790541648865, 0.023914746940135956, -0.1616554856300354, 0.2634567618370056, 0.11919840425252914, -0.5036723613739014, 0.37491175532341003, -0.4734153747558594, -0.4362359046936035, -0.05623821169137955, -0.05165259540081024, -0.07301159203052521, -0.16222059726715088, 0.1671171635389328, -0.32644063234329224, 0.18020544946193695, -0.29235562682151794, -0.2041713148355484, -0.1211356520652771, 0.09198495745658875, 0.41350650787353516, 0.1227950006723404, 0.6361835598945618, -0.0337146557867527, 0.8097463250160217, 0.19238486886024475, 0.28448399901390076, 0.6442716717720032, -0.06357784569263458, 0.4439910352230072, -0.014251891523599625, -0.19840595126152039, 0.26402759552001953, 0.09141935408115387, -0.19199782609939575, -0.054502516984939575, 0.0785774439573288, 0.20482417941093445, -0.1922457069158554, 0.08177278190851212, -0.14770397543907166, -0.1472582221031189, -0.08205186575651169, -0.04392459988594055, 0.15505577623844147, 0.1378801316022873, 0.19112378358840942, 0.11964999884366989, -0.19039511680603027, -0.13742753863334656, 0.5725867748260498, 0.3309626877307892, 0.21829953789710999, 0.018692463636398315, -0.11186429113149643, -0.732609748840332, 0.29975810647010803, 0.1647830307483673, 0.3512275218963623, -0.24682903289794922, 0.05181426554918289, 0.07836958020925522, -0.0993165522813797, 0.6698237657546997, -0.11627953499555588, 0.11729460954666138, -0.1153394877910614, -0.09199680387973785, -0.2875904440879822, -0.19314271211624146, 0.1556267887353897, 0.2828919291496277, 0.19825521111488342, -0.14355605840682983, -0.358989953994751, 0.03347005695104599, 0.0845375806093216, -0.06683310866355896, 0.07454615086317062, 0.015949077904224396, -0.41321831941604614, -0.3991957902908325, -0.12368077039718628, -0.03829976171255112, -0.07449095696210861, 0.05933715030550957, 0.07914189994335175, 0.1036609411239624, 0.029738450422883034, 0.1886729747056961, -0.08149971812963486, -0.10599274933338165, 0.2824791967868805, 0.07840126752853394, 0.07351952791213989, 0.23874610662460327, 0.34206512570381165, 0.22921596467494965, 0.5957344174385071, 0.4113571047782898, -0.5112645030021667, 0.0013474095612764359, 0.2415853589773178, -0.0746392160654068, 0.4927121102809906, -0.05890442430973053, 0.1928621381521225, 0.4606930911540985, 0.1932629495859146, -0.21321867406368256, 0.17057009041309357, 0.32892996072769165, 0.033993691205978394, -0.009578108787536621, -0.6224257946014404, 0.4453572928905487, 0.06868734955787659, 0.1459948718547821, 0.480964332818985, 0.38237065076828003, -0.19785425066947937, -0.07449228316545486, -0.15219615399837494, 0.8856953978538513, 0.14778967201709747, 0.048653338104486465, 0.28569790720939636, -0.049883998930454254, 0.31344062089920044, -0.3313170075416565, 0.26977357268333435, -0.01900157332420349, -0.4241781234741211, -0.23161140084266663, -0.08144569396972656, 0.3001321256160736, -0.41983461380004883, -0.17819353938102722, 0.33797168731689453, -0.04328685253858566, 0.2328418642282486, 0.011147528886795044, -0.051212187856435776, -0.6122786402702332, -0.13023817539215088, -0.5711682438850403, -0.013380654156208038, -0.2850431203842163, 0.40639013051986694, -0.029033323749899864, -0.045712631195783615, -0.11252597719430923, -0.14181149005889893, -0.4725226163864136, 0.3033986985683441, -0.46654126048088074, -0.19101500511169434, -0.20046348869800568, -0.07982313632965088, -0.01139223575592041, 0.03219623118638992, -0.06702147424221039, -0.06274330615997314, -0.4360838532447815, 0.44184303283691406, -0.2514432668685913, 0.028273310512304306, 0.030583053827285767, -0.073405921459198, 0.24602603912353516, 0.016985662281513214, -0.2949497103691101, 0.037844203412532806, -0.17173130810260773, -0.3569757044315338, -0.004943862557411194, -0.2682429552078247, 0.29089856147766113, 0.08898559212684631, -0.19199779629707336, 0.02711246907711029, 0.20365528762340546, -0.10106392204761505, -0.01724511757493019, -0.09220567345619202, -0.19862833619117737, -0.01717248186469078, -0.10529078543186188, -0.2538663446903229, -0.15870770812034607, 0.5447165966033936, -0.38050252199172974, 0.2266470342874527, 0.5702146887779236, 0.1795589178800583, -0.10336832702159882, -0.008485555648803711, 0.038603514432907104, -0.25795260071754456, 0.05907762050628662, 0.15644647181034088, -0.039610885083675385, 0.10123418271541595, -0.2726491689682007, 0.04587395116686821, -0.17163768410682678, -0.1968677043914795, -0.0057058557868003845, -0.5415008664131165, -0.035688772797584534, 0.10218589007854462, -0.20001307129859924, 0.012526539154350758, 0.19362489879131317, 0.12256202101707458, 0.2723613977432251, -0.1331719309091568, -0.13572008907794952, -0.14088328182697296, -0.08889830112457275, 0.06313489377498627, 0.24259324371814728, 0.2519429922103882, 0.3787144422531128, -0.2643178701400757, -0.11579827964305878, 0.05025176703929901, -0.2666154205799103, -0.007369339466094971, -0.1750202476978302, 0.22707228362560272, 0.14055752754211426, -0.5417365431785583, -0.11123549938201904, -0.4127587676048279, -0.14369097352027893, -0.12595234811306, 0.2050565779209137, 0.5221761465072632, 0.06806530058383942, -0.23872865736484528, -0.050700414925813675, 0.1707516461610794, -0.1569826602935791, 0.08515767753124237, 0.025723926723003387, 0.3814634084701538, 0.08140094578266144, 0.044133029878139496, 0.018703006207942963, 0.04744618386030197, -0.1672053039073944, -0.0764223113656044, 0.10248500108718872, 0.292621374130249, 0.3963325321674347, -0.1295788437128067, 0.0730295479297638, 0.18113359808921814, 0.36082059144973755, 0.27693256735801697, -0.14015696942806244, 0.011937081813812256, 0.311339795589447, 0.010856482200324535, -0.01711985468864441, 0.09953944385051727, 0.5429463982582092, 0.19248102605342865, 0.1598508208990097, 0.021368935704231262, 0.009058631956577301, 0.09680907428264618, 0.05148543044924736, 0.11094628274440765, 0.4247536361217499, 0.20157626271247864, 0.5247814059257507, 0.0694044977426529, 0.07087789475917816, 0.23955367505550385, -0.13596557080745697, 0.148955836892128, 0.21341358125209808, 0.3273271322250366, 0.016568055376410484, 0.23784248530864716, -0.12476392090320587, 0.12519478797912598, -0.3074844777584076, -0.4989401698112488, -0.11067511886358261, 0.09819494932889938, -0.25238338112831116, 0.4058977961540222, -0.0070867277681827545, -0.01818924769759178, -0.5140803456306458, -0.11402623355388641, -0.2275567352771759, 0.29173386096954346, 0.05445021763443947, -0.15321633219718933, -0.15801453590393066, -0.061500124633312225, 0.09048403799533844, 0.2075880765914917, 0.0783282220363617, -0.056970685720443726, -0.016229815781116486, 0.091737300157547, -0.12991547584533691, -0.3375060558319092, 0.12310361862182617, 0.0719575434923172, 0.48645293712615967, -0.17047052085399628, 0.22671213746070862, 0.058544427156448364, 0.04085037112236023, 0.25169625878334045, 0.41504809260368347, 0.30279213190078735, 0.308576375246048, 0.021968889981508255, 0.1341036558151245, 0.2031441479921341, -0.039350979030132294, 0.08114539086818695, 0.024596359580755234, -0.010314173996448517, -0.30269238352775574, 0.1915801614522934, 0.0057610198855400085, -0.0354752391576767, 0.17376916110515594, 0.01704726368188858, 0.49748921394348145, -0.41587716341018677, 0.0838029682636261, -0.3526499271392822, 0.4244586229324341, -0.27589505910873413, -0.07595555484294891, -0.3221745491027832, 0.33793893456459045, 0.20330151915550232, -0.07486027479171753, 0.16839246451854706, 0.020969662815332413, -0.05283620208501816, -0.1094023808836937, 0.19583524763584137, 0.5473542213439941, -0.12171630561351776, -0.21197795867919922, -0.02793886512517929, -0.33797433972358704, 0.08062366396188736, -0.18405406177043915, -0.3288498520851135, -0.09832526743412018, 0.21972674131393433, -0.03285681828856468, 0.08736211061477661, 0.15391233563423157, 0.17360247671604156, 0.07434550672769547, 0.04297429323196411, -0.17887510359287262, -0.318306565284729, -0.4250451624393463, 0.21004347503185272, -0.09047715365886688, -0.2640923857688904, 0.1500665843486786, 0.06015755236148834, -0.106935515999794, 0.18346098065376282, -0.24582168459892273, -0.24378439784049988, -0.3528144359588623, 0.24494612216949463, 0.07287829369306564, 0.19186487793922424, -0.09948745369911194, -0.12613213062286377, -0.29683709144592285, -0.17731976509094238, -0.26815733313560486, -0.2933933734893799, -0.1853809654712677, 0.4471728801727295, -0.25901973247528076, -0.04443885013461113, -0.43544578552246094, 0.5296579003334045, 0.041169390082359314, -0.12763425707817078, -0.18079499900341034, 0.16495048999786377, -0.29735058546066284, 0.18525713682174683, -0.28174951672554016, 0.1010039746761322, -0.1199626624584198, 0.15450093150138855, -0.27835267782211304, -0.10703741014003754, 0.6600874662399292, -0.2547762393951416, -0.02424168586730957, -0.16859367489814758, 0.09382398426532745, 0.3353879153728485, 0.02499978430569172, -0.22328004240989685, 0.3371049463748932, 0.08393725007772446, 0.03737574815750122, -0.051083266735076904, -0.009901890531182289, -0.10042547434568405, 0.11005207896232605, -0.09022831171751022, -0.0754181519150734, 0.1285017877817154, -0.07691323757171631, 0.42535752058029175, -0.03925832360982895 ]
https://github.com/huggingface/datasets/issues/5975
Are you able to use `aiohttp` to get the file at `https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json` using your proxy ?
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
16
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 Are you able to use `aiohttp` to get the file at `https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json` using your proxy ?
[ -0.25485262274742126, -0.0679943710565567, 0.09301558881998062, -0.12202920019626617, 0.3035862445831299, -0.011668860912322998, 0.1310204267501831, 0.15154731273651123, 0.009722955524921417, 0.1170535758137703, 0.04780591279268265, -0.19018292427062988, 0.2405724972486496, 0.1584572046995163, 0.12638382613658905, -0.06325537711381912, 0.07049555331468582, -0.03340265154838562, -0.011102404445409775, 0.12614908814430237, -0.0016213208436965942, 0.07834205031394958, -0.0951741486787796, -0.0599658377468586, -0.028240324929356575, -0.006688443012535572, 0.05022229999303818, 0.3279899060726166, -0.26006948947906494, 0.08810122311115265, 0.27497199177742004, 0.10635429620742798, -0.020966745913028717, 0.5173516869544983, -0.00012835876259487122, 0.21518942713737488, 0.39551395177841187, -0.16481921076774597, -0.29890012741088867, -0.38257700204849243, -0.39475148916244507, 0.05892014503479004, -0.03892090544104576, -0.034360915422439575, -0.04193652421236038, 0.015423230826854706, 0.36209118366241455, -0.577725887298584, 0.4066711962223053, 0.3502330780029297, 0.056077077984809875, 0.16726824641227722, -0.03377936780452728, 0.3104453384876251, 0.02235383354127407, 0.1329631805419922, -0.2077387571334839, 0.021428264677524567, 0.1954207420349121, 0.0456077978014946, 0.23984269797801971, 0.4422417879104614, -0.3254493176937103, 0.020449526607990265, 0.43810516595840454, -0.11027160286903381, -0.08763293921947479, -0.346765398979187, -0.08158078789710999, 0.5822426080703735, 0.5361003875732422, -0.28196901082992554, -0.5143095850944519, -0.25845474004745483, 0.022039316594600677, -0.09558571875095367, 0.19085288047790527, 0.22794239223003387, -0.10929890722036362, 0.16024541854858398, -0.00351647287607193, -0.24663978815078735, -0.25472956895828247, 0.11477058380842209, 0.08618433773517609, 0.2873612344264984, -0.03200021758675575, 0.1237533837556839, -0.009770728647708893, -0.03174794465303421, -0.2754485309123993, -0.30836477875709534, -0.22380386292934418, 0.19126838445663452, -0.2761046886444092, 0.10826534777879715, 0.024828683584928513, 0.13819271326065063, 0.15641850233078003, 0.25623923540115356, 0.10188110172748566, 0.12732793390750885, -0.3787652552127838, 0.1812882274389267, 0.11254090070724487, 0.187339648604393, -0.0349285863339901, 0.22002914547920227, 0.3057463765144348, 0.2733457386493683, 0.02700277417898178, -0.24923570454120636, 0.4053621292114258, 0.08033251762390137, -0.4782785475254059, -0.11516229808330536, 0.7189840078353882, -0.2683655321598053, -0.37433522939682007, 0.09216827154159546, -0.5356889367103577, 0.06310867518186569, 0.16677963733673096, 0.3431262671947479, -0.23161029815673828, 0.38058167695999146, 0.21369147300720215, 0.2982192933559418, -0.30679377913475037, -0.21054324507713318, -0.0974033772945404, -0.13348360359668732, 0.08926783502101898, 0.16761475801467896, -0.021627306938171387, -0.09458869695663452, 0.31999990344047546, -0.10820259153842926, 0.28200992941856384, 0.04716787487268448, 0.1325320154428482, -0.07100095599889755, -0.026667799800634384, 0.38753989338874817, -0.04115031287074089, 0.02877548336982727, 0.17228107154369354, -0.13918325304985046, 0.015349939465522766, -0.05125034600496292, -0.04562797769904137, -0.30696961283683777, -0.04065026342868805, 0.044438619166612625, -0.2122509628534317, -0.11547023057937622, -0.47551149129867554, 0.2136719971895218, -0.2820877432823181, -0.2710421085357666, 0.17877084016799927, 0.14108233153820038, -0.3015803396701813, 0.16861970722675323, 0.32687193155288696, 0.7478623390197754, -0.21254479885101318, -0.262686550617218, 0.05410042032599449, -0.21609658002853394, 0.3805185854434967, 0.12351476401090622, -0.01452404260635376, -0.19426608085632324, -0.16141854226589203, 0.20004989206790924, 0.26193973422050476, -0.3336407542228699, -0.5404021739959717, 0.27694830298423767, -0.15816441178321838, 0.4353751540184021, 0.31596410274505615, 0.20547375082969666, -0.012560570612549782, 0.004472937434911728, -0.06564151495695114, 0.48041656613349915, -0.22042901813983917, 0.09372397512197495, -0.1846325844526291, -0.3103882670402527, 0.028149228543043137, 0.13832658529281616, -0.1878715455532074, 0.344583123922348, -0.023907262831926346, -0.12181062996387482, 0.26738888025283813, 0.006932876072824001, 0.060090504586696625, 0.23083242774009705, 0.3508780896663666, 0.461713045835495, -0.1169227808713913, -0.1600833386182785, -0.2803901433944702, 0.017209358513355255, 0.17117862403392792, -0.05110207945108414, -0.07274772226810455, -0.29691559076309204, -0.13483533263206482, -0.1315157264471054, -0.05956209823489189, -0.2196560949087143, -0.1013893112540245, 0.3504351079463959, 0.09016327559947968, 0.21242693066596985, -0.29681867361068726, 0.7409350872039795, -0.35748374462127686, 0.05593692138791084, -0.366328626871109, 0.31299206614494324, 0.09481493383646011, -0.05841092765331268, -0.06865876168012619, 0.03707031160593033, 0.23353837430477142, -0.11782011389732361, -0.2296677529811859, 0.4787559509277344, -0.01830127276480198, 0.34912940859794617, 0.24501711130142212, 0.11856237798929214, 0.270227313041687, -0.20887523889541626, -0.0517677366733551, 0.42535844445228577, 0.22966930270195007, 0.06429210305213928, -0.034687649458646774, 0.1813097596168518, 0.2501019835472107, 0.2899763584136963, 0.08872972428798676, 0.0154280886054039, 0.36905133724212646, 0.05077461898326874, -0.4012983441352844, -0.027096092700958252, 0.44916388392448425, -0.15173932909965515, 0.2133711576461792, -0.1808929592370987, -0.37724488973617554, 0.14099985361099243, -0.06965033710002899, 0.0633912906050682, -0.023254066705703735, 0.04274575412273407, -0.06552531570196152, 0.06347396224737167, 0.019015999510884285, 0.27379462122917175, 0.3916657567024231, 0.018293190747499466, -0.2884852886199951, 0.17671449482440948, 0.09185650944709778, -0.17220057547092438, 0.09032771736383438, 0.08256080001592636, 0.023453261703252792, -0.07713951170444489, 0.06464296579360962, -0.007650943472981453, -0.17826193571090698, -0.30622175335884094, -0.22846391797065735, 0.06715123355388641, -0.45705538988113403, 0.3566012978553772, -0.30192822217941284, -0.5832083821296692, -0.018924860283732414, -0.1297825276851654, -0.28196054697036743, -0.3318327069282532, -0.08205314725637436, 0.39676785469055176, -0.1833755075931549, 0.1979546844959259, -0.5522576570510864, 0.21367132663726807, 0.10214124619960785, -0.22994805872440338, -0.33875495195388794, 0.09179436415433884, -0.09583158791065216, -0.09497098624706268, 0.1129702776670456, 0.010707501322031021, 0.303829163312912, -0.1383223533630371, -0.4833223819732666, -0.4001566171646118, -0.1473194807767868, -0.04526499658823013, 0.07807666063308716, 0.43029361963272095, -0.09931386262178421, 0.43672871589660645, -0.08639242500066757, -0.10857103765010834, 0.21469047665596008, -0.05383104085922241, -0.04742752015590668, -0.1442069560289383, 0.07628713548183441, 0.1525958776473999, -0.0188138484954834, -0.01684815064072609, -0.35726040601730347, -0.2728411555290222, -0.02149925008416176, -0.3598923981189728, 0.005946096032857895, 0.3304539918899536, -0.10292495787143707, 0.045434728264808655, -0.1999673694372177, -0.053597889840602875, -0.09208944439888, -0.6476781964302063, 0.3131396770477295, 0.020028691738843918, -0.15218138694763184, 0.23168039321899414, 0.1299218088388443, -0.47883978486061096, 0.30096447467803955, -0.44851815700531006, -0.5348350405693054, -0.06436391919851303, -0.036997511982917786, -0.1348755955696106, -0.154510036110878, 0.17343321442604065, -0.4053313732147217, 0.16580146551132202, -0.26624441146850586, -0.14306426048278809, -0.0481419637799263, 0.09283126890659332, 0.35353055596351624, 0.15534202754497528, 0.6355544924736023, -0.051561351865530014, 0.7824617028236389, 0.26231566071510315, 0.23490503430366516, 0.5516073703765869, -0.07996676862239838, 0.3788451850414276, -0.054210178554058075, -0.20890098810195923, 0.1990903913974762, 0.13600337505340576, -0.16414755582809448, -0.08217097818851471, 0.11900942027568817, 0.20531362295150757, -0.19859816133975983, 0.08629797399044037, -0.13729295134544373, -0.17663779854774475, -0.12911438941955566, -0.09233912825584412, 0.15060926973819733, 0.18045935034751892, 0.1517118215560913, 0.07501891255378723, -0.1310509592294693, -0.08868905156850815, 0.629922091960907, 0.2451884150505066, 0.23101864755153656, -0.007889077067375183, -0.14400701224803925, -0.7553697228431702, 0.3377341628074646, 0.16362914443016052, 0.33289453387260437, -0.2533123791217804, 0.03821447491645813, 0.09974592179059982, -0.10191501677036285, 0.6535341143608093, -0.08837302774190903, 0.19327007234096527, -0.052543193101882935, -0.03557537496089935, -0.2181827872991562, -0.10949410498142242, 0.1874256283044815, 0.3656913638114929, 0.34861254692077637, -0.10041464865207672, -0.31971660256385803, -0.0012482032179832458, 0.06046655401587486, -0.1727328896522522, 0.08751748502254486, 0.02719445526599884, -0.4093402326107025, -0.3465081453323364, -0.10290107876062393, -0.05063832178711891, -0.05250255763530731, 0.07608833909034729, 0.12263619899749756, 0.12374431639909744, 0.006733318790793419, 0.1576252430677414, -0.11242003738880157, -0.05532461777329445, 0.22820577025413513, 0.10588705539703369, 0.10240931808948517, 0.2462572157382965, 0.2846391201019287, 0.2293345183134079, 0.6301497220993042, 0.4172748327255249, -0.6241884827613831, -0.1388668417930603, 0.25078991055488586, -0.0953734740614891, 0.42629995942115784, 0.00463380292057991, 0.13904248178005219, 0.519946813583374, 0.19976317882537842, -0.1697693020105362, 0.2227831780910492, 0.2885339856147766, 0.04583895578980446, -0.008740562945604324, -0.6681574583053589, 0.4424512982368469, 0.03994327783584595, 0.1280803382396698, 0.4743633270263672, 0.3218565881252289, -0.1901458352804184, -0.0012705512344837189, -0.24355773627758026, 0.8671125769615173, 0.18183615803718567, 0.06154664605855942, 0.28682923316955566, -0.1079096645116806, 0.3240054249763489, -0.31463807821273804, 0.25404995679855347, 0.015350058674812317, -0.33841127157211304, -0.20493482053279877, -0.04774719476699829, 0.2805875539779663, -0.42352914810180664, -0.17838239669799805, 0.21979063749313354, 0.051872506737709045, 0.15726390480995178, 0.044119276106357574, 0.006010860204696655, -0.5665916204452515, -0.14063747227191925, -0.6195979714393616, -0.012571558356285095, -0.3136163651943207, 0.3875126838684082, 0.0015126951038837433, -0.0804932713508606, -0.1015898808836937, -0.13461068272590637, -0.4991118311882019, 0.2997623085975647, -0.4543531537055969, -0.19394145905971527, -0.14905492961406708, -0.11811840534210205, -0.016671262681484222, -0.040574561804533005, -0.10500854253768921, -0.12860026955604553, -0.4269966185092926, 0.47467392683029175, -0.15705136954784393, 0.04083038866519928, 0.05741427093744278, -0.0992635190486908, 0.23292121291160583, 0.004042781889438629, -0.2606014013290405, 0.054760172963142395, -0.12495580315589905, -0.4067994952201843, 0.03174799680709839, -0.236118882894516, 0.42357537150382996, 0.11603936553001404, -0.136480450630188, 0.057816505432128906, 0.20523184537887573, -0.0975152999162674, 0.0010187849402427673, -0.03272436559200287, -0.28029218316078186, -0.0824400782585144, -0.12199737876653671, -0.24010814726352692, -0.12336203455924988, 0.5221772193908691, -0.3541637659072876, 0.2376466542482376, 0.5825177431106567, 0.12625905871391296, -0.040027517825365067, -0.03331054002046585, 0.09652545303106308, -0.2238708734512329, 0.045189470052719116, 0.18061086535453796, 0.015808526426553726, 0.08851593732833862, -0.2638705372810364, 0.06614349782466888, -0.21965795755386353, -0.21590262651443481, -0.02229582518339157, -0.6196460723876953, -0.05467858165502548, 0.06204986944794655, -0.13129788637161255, -0.00827118195593357, 0.22060614824295044, 0.15196451544761658, 0.20837408304214478, -0.09780415892601013, -0.13842570781707764, -0.13663315773010254, -0.06115812808275223, 0.06448176503181458, 0.2293621003627777, 0.2504376769065857, 0.37321585416793823, -0.1979055106639862, -0.12128452211618423, 0.047095660120248795, -0.26786813139915466, -0.034869883209466934, -0.23017597198486328, 0.21605706214904785, 0.11026601493358612, -0.5382694602012634, -0.11086124926805496, -0.402706503868103, -0.14077328145503998, -0.07736161351203918, 0.1200835257768631, 0.4844127893447876, 0.012150842696428299, -0.23615942895412445, 0.015500149689614773, 0.12687133252620697, -0.0955975279211998, 0.1250620186328888, -0.02552727237343788, 0.35035380721092224, 0.08364737033843994, 0.07040971517562866, -0.04421620070934296, 0.00770193338394165, -0.10769663751125336, -0.11157788336277008, 0.036168407648801804, 0.2878972589969635, 0.3961707651615143, -0.15644560754299164, 0.09095758199691772, 0.22706633806228638, 0.2805952727794647, 0.25447365641593933, -0.0864347591996193, 0.05531580001115799, 0.28838300704956055, 0.008849507197737694, -0.047058142721652985, 0.05499514192342758, 0.6184455156326294, 0.18095096945762634, 0.15196067094802856, 0.004340767860412598, -0.13515271246433258, 0.08560922741889954, 0.08611644059419632, 0.08397696912288666, 0.41191959381103516, 0.21730922162532806, 0.5268341302871704, 0.01774272322654724, 0.04920458048582077, 0.21617862582206726, -0.1996249109506607, 0.1603231281042099, 0.25080227851867676, 0.4170066714286804, 0.008394148200750351, 0.22009612619876862, -0.06611866503953934, 0.10225720703601837, -0.3458929657936096, -0.46623167395591736, -0.2116648107767105, 0.052174992859363556, -0.27037128806114197, 0.46789708733558655, 0.06669856607913971, 0.03287917375564575, -0.47563496232032776, -0.03315483406186104, -0.21596764028072357, 0.19333310425281525, 0.08934712409973145, -0.13935470581054688, -0.24967287480831146, -0.006408169865608215, 0.12252919375896454, 0.1473160684108734, 0.12593965232372284, 0.033891234546899796, 0.03240937739610672, 0.08457129448652267, -0.11250166594982147, -0.2839394807815552, 0.05200296640396118, 0.05402567237615585, 0.465009480714798, -0.1588028371334076, 0.20599466562271118, 0.05097786337137222, 0.035120002925395966, 0.33952587842941284, 0.38131508231163025, 0.33387669920921326, 0.26824867725372314, 0.04201451316475868, 0.21941405534744263, 0.2123015820980072, -0.037970103323459625, 0.02606002241373062, -0.0003795325756072998, 0.05857723206281662, -0.2694111168384552, 0.2002224326133728, 0.012416202574968338, -0.035249121487140656, 0.15692691504955292, -0.03543773293495178, 0.4550730586051941, -0.5133920311927795, 0.1514965444803238, -0.4397170841693878, 0.35769155621528625, -0.39232921600341797, -0.006429385393857956, -0.2749638855457306, 0.36103877425193787, 0.05835353955626488, -0.10818082839250565, 0.1122475117444992, -0.014203529804944992, -0.04507492110133171, -0.19438216090202332, 0.22096240520477295, 0.5453590154647827, -0.12345942109823227, -0.16855359077453613, -0.049767687916755676, -0.31038182973861694, 0.09255947172641754, -0.20332911610603333, -0.3444342613220215, -0.09467164427042007, 0.23504650592803955, -0.04308575764298439, 0.08240208029747009, 0.1769208014011383, 0.08999545127153397, 0.030837148427963257, 0.03664425387978554, -0.19043268263339996, -0.33890748023986816, -0.45019957423210144, 0.20930121839046478, -0.06347835063934326, -0.23799355328083038, 0.13506698608398438, 0.10450109094381332, -0.09794717282056808, 0.24977226555347443, -0.33844059705734253, -0.2593420743942261, -0.44811344146728516, 0.22354182600975037, 0.10371837764978409, 0.10052304714918137, -0.0759514793753624, -0.0761634036898613, -0.2413141280412674, -0.14875885844230652, -0.34224483370780945, -0.2913531959056854, -0.23155182600021362, 0.4761877655982971, -0.33019718527793884, -0.02933463081717491, -0.380151629447937, 0.49576863646507263, 0.01641814410686493, -0.26944416761398315, -0.2015221267938614, 0.16027846932411194, -0.2719660699367523, 0.18079492449760437, -0.28636953234672546, 0.1279100775718689, -0.15503741800785065, 0.09211520850658417, -0.24440929293632507, -0.030068285763263702, 0.6342716813087463, -0.36897045373916626, -0.027999218553304672, -0.17888081073760986, 0.1344727724790573, 0.2991253435611725, -0.009094856679439545, -0.21572139859199524, 0.29700371623039246, 0.10024338215589523, 0.05728544294834137, -0.03428035229444504, -0.0003620460629463196, -0.060599420219659805, 0.12615248560905457, -0.07628834992647171, 0.015560973435640335, 0.13428524136543274, -0.0659293681383133, 0.47077664732933044, -0.026283226907253265 ]
https://github.com/huggingface/datasets/issues/5975
It only works when passing trust_env=True when creating the ClientSession, as well as setting ssl=False. Working Example: ``` import os os.environ['HTTP_PROXY'] = "xyz" os.environ['HTTPS_PROXY'] = "xyz" import asyncio import aiohttp async def download_pep(url): async with aiohttp.ClientSession(trust_env=True) as session: print("1") async with session.get(url, ssl=False) as resp: print("2") content = await resp.text() print(content) return content asyncio.run(download_pep("https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json")) ``` SSL Verification has been a problem with other packages as well. Usually I circumvent the problem by setting ``` import ssl ssl._create_default_https_context = ssl._create_unverified_context ``` (probably not the best idea for security), although here aiohttp does not seem to use this default context.
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
98
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 It only works when passing trust_env=True when creating the ClientSession, as well as setting ssl=False. Working Example: ``` import os os.environ['HTTP_PROXY'] = "xyz" os.environ['HTTPS_PROXY'] = "xyz" import asyncio import aiohttp async def download_pep(url): async with aiohttp.ClientSession(trust_env=True) as session: print("1") async with session.get(url, ssl=False) as resp: print("2") content = await resp.text() print(content) return content asyncio.run(download_pep("https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json")) ``` SSL Verification has been a problem with other packages as well. Usually I circumvent the problem by setting ``` import ssl ssl._create_default_https_context = ssl._create_unverified_context ``` (probably not the best idea for security), although here aiohttp does not seem to use this default context.
[ -0.2875823378562927, 0.027243584394454956, 0.11844801157712936, -0.1200261116027832, 0.31531858444213867, -0.05895368754863739, 0.21909725666046143, 0.13560554385185242, 0.06980419903993607, 0.1013476699590683, 0.017686940729618073, -0.1512751579284668, 0.3091881275177002, 0.10330618172883987, 0.06411478668451309, -0.030433140695095062, 0.08692145347595215, -0.016449905931949615, -0.0754723772406578, 0.0845465362071991, -0.04961433261632919, 0.041956476867198944, -0.06435883790254593, -0.08269079029560089, -0.03027285262942314, -0.045974861830472946, -0.02316141128540039, 0.33846449851989746, -0.2690162658691406, 0.06510799378156662, 0.2688087224960327, 0.1257959008216858, -0.019070811569690704, 0.47369736433029175, -0.00012997911835554987, 0.20020467042922974, 0.3660097122192383, -0.18859076499938965, -0.2828078269958496, -0.3031095266342163, -0.43837302923202515, 0.04449782520532608, 0.01904486119747162, -0.06225990504026413, 0.00523868203163147, 0.08578352630138397, 0.26611199975013733, -0.5526943206787109, 0.405617356300354, 0.3799794912338257, 0.02772173285484314, 0.2247469127178192, -0.12446432560682297, 0.26898378133773804, -0.07701049000024796, 0.09576009213924408, -0.2529124319553375, -0.058611221611499786, 0.12657548487186432, 0.0518246665596962, 0.1867709755897522, 0.3824702501296997, -0.3818771541118622, 0.020064830780029297, 0.44370782375335693, -0.13135744631290436, -0.06459103524684906, -0.3540371358394623, -0.0810968354344368, 0.5376141667366028, 0.5055752992630005, -0.25530073046684265, -0.519290566444397, -0.2912527918815613, 0.00575806200504303, -0.11850462853908539, 0.24511055648326874, 0.27078476548194885, -0.12035073339939117, 0.15749967098236084, 0.020053770393133163, -0.1340889036655426, -0.2206469178199768, 0.14923231303691864, 0.07825751602649689, 0.3097987771034241, 0.0018023401498794556, 0.16146385669708252, 0.05370775982737541, -0.0039246706292033195, -0.21572580933570862, -0.35301461815834045, -0.19170331954956055, 0.12213777005672455, -0.31137505173683167, 0.11173591017723083, 0.08343012630939484, 0.16618488729000092, 0.19149449467658997, 0.24852560460567474, 0.02104438841342926, 0.07144613564014435, -0.3297244906425476, 0.1818673014640808, 0.08814161270856857, 0.25282418727874756, -0.01351127028465271, 0.18717466294765472, 0.29069697856903076, 0.29688552021980286, 0.0773015096783638, -0.1802426427602768, 0.3633318543434143, 0.09889049828052521, -0.5101179480552673, -0.09525051712989807, 0.698641300201416, -0.23817211389541626, -0.43780434131622314, 0.1265876442193985, -0.5200268030166626, 0.05184946209192276, 0.16906699538230896, 0.37417304515838623, -0.21034690737724304, 0.40654242038726807, 0.19018515944480896, 0.3334469199180603, -0.30537623167037964, -0.23938694596290588, -0.09654123336076736, -0.17144322395324707, 0.04305483400821686, 0.19014208018779755, 0.014501236379146576, -0.08978760242462158, 0.3559151887893677, -0.11986368894577026, 0.22858694195747375, 0.05509781837463379, 0.11444167792797089, -0.052668891847133636, 0.034042421728372574, 0.41240233182907104, -0.04860968887805939, 0.015706464648246765, 0.2208930253982544, -0.18840205669403076, 0.001529097557067871, -0.006544204428792, -0.013074424117803574, -0.24742068350315094, -0.07483132928609848, 0.0032279910519719124, -0.3121032118797302, -0.13053634762763977, -0.3645780682563782, 0.14359857141971588, -0.2496039718389511, -0.1882385015487671, 0.21639682352542877, 0.11044904589653015, -0.27902722358703613, 0.16895261406898499, 0.3283001780509949, 0.7954016923904419, -0.1422811895608902, -0.2379249483346939, 0.054952606558799744, -0.25576913356781006, 0.32117706537246704, 0.18239228427410126, 0.011792831122875214, -0.1937360018491745, -0.12685522437095642, 0.1857035905122757, 0.24485370516777039, -0.28006643056869507, -0.665267288684845, 0.29613932967185974, -0.11082940548658371, 0.4385591745376587, 0.32878050208091736, 0.24695554375648499, 0.07062707096338272, 0.02235596254467964, -0.08315685391426086, 0.5041970610618591, -0.2059359848499298, 0.11272122710943222, -0.22125595808029175, -0.3422161936759949, 0.022259872406721115, 0.09839580953121185, -0.1908492147922516, 0.3988698124885559, -0.022102952003479004, -0.17152024805545807, 0.27698853611946106, -0.023624781519174576, 0.06000354886054993, 0.15915100276470184, 0.35739538073539734, 0.3971613347530365, -0.11056499183177948, -0.007019884884357452, -0.3304506838321686, 0.013297632336616516, 0.21061941981315613, -0.012759769335389137, -0.16707441210746765, -0.28780728578567505, -0.11525490134954453, -0.11817831546068192, -0.13077086210250854, -0.23708981275558472, -0.1455691009759903, 0.43545472621917725, 0.03028646856546402, 0.20108157396316528, -0.24692127108573914, 0.7550533413887024, -0.3411492109298706, 0.0870492160320282, -0.30551958084106445, 0.2694515585899353, 0.10625221580266953, -0.09595142304897308, -0.07785715907812119, -0.0030746571719646454, 0.2907932996749878, -0.09687474370002747, -0.2353295087814331, 0.49178361892700195, -0.010984819382429123, 0.3259332776069641, 0.17565791308879852, 0.12284938991069794, 0.255402147769928, -0.20311209559440613, -0.019898898899555206, 0.4036439061164856, 0.21812129020690918, 0.11407570540904999, -0.09352964162826538, 0.20027081668376923, 0.23937582969665527, 0.257144957780838, 0.0439249724149704, 0.08443406224250793, 0.34060904383659363, 0.042863719165325165, -0.43608149886131287, -0.014980144798755646, 0.4454359710216522, -0.17983458936214447, 0.20192444324493408, -0.14527574181556702, -0.34451961517333984, 0.1364903301000595, -0.09736282378435135, 0.052704647183418274, 0.06232291832566261, 0.013492044992744923, -0.006765447556972504, 0.06672260165214539, 0.11743706464767456, 0.26799696683883667, 0.40947407484054565, -0.03561093285679817, -0.2566113770008087, 0.19174665212631226, 0.0033230073750019073, -0.17565804719924927, 0.06672864407300949, 0.050908736884593964, 0.02403062954545021, -0.08410245180130005, 0.05118417367339134, -0.03703923523426056, -0.2484683394432068, -0.2846261262893677, -0.17177367210388184, 0.11789943277835846, -0.4626433849334717, 0.3321765661239624, -0.2945817708969116, -0.5101008415222168, 0.05475449189543724, -0.08402258157730103, -0.22607366740703583, -0.35198068618774414, -0.12610381841659546, 0.44943371415138245, -0.2007656991481781, 0.232885479927063, -0.6433822512626648, 0.18466031551361084, 0.16363532841205597, -0.2923722565174103, -0.34154385328292847, 0.09264087677001953, -0.03582944720983505, -0.12346110492944717, 0.1080075278878212, -0.102044478058815, 0.33036479353904724, -0.10261522233486176, -0.4208865165710449, -0.3858305513858795, -0.2030273675918579, -0.03714073449373245, 0.04045012965798378, 0.43909546732902527, -0.1155388206243515, 0.4180716872215271, -0.09459789097309113, -0.1272689402103424, 0.2551995515823364, -0.04415685310959816, -0.030258528888225555, -0.15035778284072876, 0.08636535704135895, 0.10272279381752014, -0.02990332618355751, -0.031043559312820435, -0.2680235803127289, -0.22525326907634735, 0.011155928485095501, -0.4000976085662842, -0.0012692343443632126, 0.30025172233581543, -0.05274641886353493, 0.045227207243442535, -0.25033727288246155, -0.05994616076350212, -0.10479088127613068, -0.6273648738861084, 0.3320781886577606, 0.008902493864297867, -0.15571719408035278, 0.19863173365592957, 0.07635451853275299, -0.40987858176231384, 0.31822335720062256, -0.45768266916275024, -0.4885164499282837, -0.08228738605976105, 0.009641289710998535, -0.14824317395687103, -0.20934204757213593, 0.2114734649658203, -0.3764539361000061, 0.19273385405540466, -0.30484744906425476, -0.19110655784606934, 0.010575484484434128, 0.11927542090415955, 0.3884246051311493, 0.04449763894081116, 0.6418004035949707, -0.0003147795796394348, 0.7394344806671143, 0.2735639810562134, 0.21128343045711517, 0.5890882611274719, -0.08199773728847504, 0.36477339267730713, -0.018379513174295425, -0.213069885969162, 0.2017434537410736, 0.1628735065460205, -0.163099005818367, -0.07972288131713867, 0.09379987418651581, 0.13662853837013245, -0.21440446376800537, 0.09774473309516907, -0.13100746273994446, -0.187782883644104, -0.13902145624160767, -0.10692280530929565, 0.21197150647640228, 0.1772090494632721, 0.25041836500167847, 0.08484789729118347, -0.17140865325927734, -0.06774934381246567, 0.6514857411384583, 0.2633110284805298, 0.22377531230449677, 0.015920810401439667, -0.08602811396121979, -0.7701786756515503, 0.3178233504295349, 0.1215917319059372, 0.4261687695980072, -0.2938905954360962, 0.009241558611392975, 0.09542457014322281, -0.05490615963935852, 0.6786897778511047, -0.12776488065719604, 0.1452944576740265, -0.07243826240301132, -0.011643633246421814, -0.26925235986709595, -0.10587330907583237, 0.17700842022895813, 0.254105806350708, 0.24762068688869476, -0.12003092467784882, -0.32024919986724854, -0.0018639825284481049, 0.029605038464069366, -0.18896976113319397, 0.10185545682907104, 0.00320323184132576, -0.4370678663253784, -0.43773382902145386, -0.13326133787631989, 0.06525805592536926, -0.11365790665149689, 0.06415419280529022, 0.09320860356092453, 0.1719207614660263, 0.011410539969801903, 0.20208953320980072, -0.08460943400859833, -0.06695883721113205, 0.2351498007774353, 0.1384979784488678, 0.12528522312641144, 0.20329639315605164, 0.3870135247707367, 0.21909502148628235, 0.6664077639579773, 0.40209102630615234, -0.6179797649383545, -0.08807642012834549, 0.19788843393325806, -0.09302496165037155, 0.4849080443382263, -0.00941312313079834, 0.1397435963153839, 0.5089604258537292, 0.16277536749839783, -0.11285508424043655, 0.2643008828163147, 0.3122568130493164, 0.014022082090377808, 0.01617417111992836, -0.5830570459365845, 0.3744012117385864, -0.0338037945330143, 0.1286732405424118, 0.4754870533943176, 0.3070468008518219, -0.14235761761665344, -0.014431271702051163, -0.20155194401741028, 0.8852348923683167, 0.16753219068050385, 0.10993419587612152, 0.39981451630592346, -0.11089339107275009, 0.33924350142478943, -0.2780117392539978, 0.26361021399497986, 0.010781355202198029, -0.2915249168872833, -0.22207683324813843, -0.10006701946258545, 0.3513198494911194, -0.44284787774086, -0.19356472790241241, 0.19708862900733948, 0.005939751863479614, 0.13983799517154694, 0.10706773400306702, 0.025301553308963776, -0.5911833047866821, -0.18045087158679962, -0.5158858299255371, -0.01609886810183525, -0.284504771232605, 0.3840658664703369, 0.04457535594701767, -0.0988471657037735, -0.0843077301979065, -0.12554527819156647, -0.3890976905822754, 0.35325339436531067, -0.4524322748184204, -0.18725788593292236, -0.19711026549339294, -0.12800073623657227, 0.005548499524593353, 0.0139466542750597, -0.09474041312932968, -0.16440421342849731, -0.41032448410987854, 0.46656718850135803, -0.19354990124702454, 0.08847533166408539, 0.09245763719081879, -0.12853068113327026, 0.25435879826545715, 0.05833248794078827, -0.26644882559776306, 0.03322238847613335, -0.1432720273733139, -0.4031785726547241, 0.01566728949546814, -0.24520118534564972, 0.47499361634254456, 0.03300829604268074, -0.11434829980134964, 0.05146341770887375, 0.1419399380683899, -0.08571771532297134, -0.0283415075391531, 0.011968025006353855, -0.2300986498594284, -0.06195089593529701, -0.16647355258464813, -0.31589484214782715, -0.10047537088394165, 0.547228217124939, -0.35423576831817627, 0.20311009883880615, 0.601468026638031, 0.08958305418491364, -0.032443247735500336, -0.03965859115123749, 0.04707346111536026, -0.3023945093154907, -0.0044128671288490295, 0.09305528551340103, -0.05249036103487015, 0.05476868152618408, -0.32974642515182495, 0.07830981910228729, -0.26247626543045044, -0.14074870944023132, -0.0025382936000823975, -0.5732519626617432, -0.08049701154232025, 0.06020818650722504, -0.1767028123140335, -0.001158657018095255, 0.19007635116577148, 0.19600854814052582, 0.2403886616230011, -0.1603473424911499, -0.11169972270727158, -0.1530534029006958, -0.04960282891988754, 0.07511107623577118, 0.24537241458892822, 0.2656359374523163, 0.4026554822921753, -0.2122688889503479, -0.14220565557479858, 0.08465312421321869, -0.27372875809669495, -0.011059712618589401, -0.2732083201408386, 0.23682290315628052, 0.16617390513420105, -0.5137068033218384, -0.07676373422145844, -0.44999632239341736, -0.13301527500152588, -0.10871350765228271, 0.1421177089214325, 0.4444971978664398, -0.04806326702237129, -0.2270246297121048, -0.06498244404792786, 0.18971961736679077, -0.07853526622056961, 0.05618750676512718, -0.04977553337812424, 0.2471945583820343, 0.03648323565721512, 0.06165887787938118, -0.07258957624435425, 0.041578441858291626, -0.09370259940624237, -0.07410630583763123, 0.07863651216030121, 0.28965112566947937, 0.399497926235199, -0.17136067152023315, 0.08005619049072266, 0.12910333275794983, 0.30264854431152344, 0.22315755486488342, -0.10493765026330948, 0.011353343725204468, 0.3000420928001404, -0.009212786331772804, -0.015773098915815353, 0.10796217620372772, 0.5596544146537781, 0.24294999241828918, 0.17000874876976013, 0.03610024228692055, -0.12294948846101761, 0.05566972494125366, 0.08448289334774017, 0.06259503960609436, 0.3833698034286499, 0.2221003919839859, 0.47945189476013184, 0.11189299076795578, -0.02765239030122757, 0.303680419921875, -0.1406586617231369, 0.09225982427597046, 0.20249029994010925, 0.3752082884311676, -0.00940031185746193, 0.2191586196422577, -0.056978918612003326, 0.1100202351808548, -0.3429388403892517, -0.4254266321659088, -0.20232653617858887, -0.09060125052928925, -0.2505355775356293, 0.39952677488327026, 0.0021351389586925507, 0.06859654188156128, -0.48599910736083984, -0.03109843097627163, -0.2566043734550476, 0.18477410078048706, 0.042037349194288254, -0.14928051829338074, -0.27240803837776184, -0.032541319727897644, 0.1407979279756546, 0.14640399813652039, 0.08230175077915192, 0.013656661845743656, 0.06973366439342499, 0.08257032930850983, -0.12621240317821503, -0.3018331527709961, -0.002628454938530922, 0.14602765440940857, 0.39803722500801086, -0.17512285709381104, 0.26095080375671387, 0.05650532245635986, 0.02426230162382126, 0.2838667631149292, 0.3920011520385742, 0.3251902759075165, 0.28942686319351196, 0.09021195769309998, 0.19123530387878418, 0.2073039710521698, 0.01597842574119568, 0.026378244161605835, 0.02273319661617279, 0.13008853793144226, -0.19694256782531738, 0.21754999458789825, -0.015268120914697647, -0.02419745735824108, 0.16919781267642975, -0.04545591399073601, 0.44879984855651855, -0.46220749616622925, 0.2038513720035553, -0.421906977891922, 0.38803830742836, -0.31115299463272095, -0.017976362258195877, -0.26244038343429565, 0.3471774160861969, 0.11402739584445953, -0.08273754268884659, 0.1483074426651001, -0.06758062541484833, -0.06348010897636414, -0.23295505344867706, 0.22226643562316895, 0.5271812677383423, -0.13052943348884583, -0.23084315657615662, -0.014057815074920654, -0.3439655303955078, 0.15474951267242432, -0.20106852054595947, -0.4103150963783264, -0.1064179390668869, 0.23523694276809692, 0.004464361816644669, 0.11610689014196396, 0.15615515410900116, 0.090309739112854, 0.0617375448346138, 0.027784191071987152, -0.15109990537166595, -0.31292659044265747, -0.4150558114051819, 0.2089282125234604, -0.03402192145586014, -0.2760215997695923, 0.19225285947322845, 0.10988940298557281, -0.10974299907684326, 0.24728502333164215, -0.33541882038116455, -0.23000633716583252, -0.41981446743011475, 0.2799168527126312, 0.14056162536144257, 0.20607095956802368, -0.059746235609054565, -0.06417391449213028, -0.2380802035331726, -0.17509430646896362, -0.3184339106082916, -0.312564492225647, -0.2317950278520584, 0.4786410331726074, -0.3227112889289856, -0.0006081815809011459, -0.41562849283218384, 0.49515748023986816, 0.03788606822490692, -0.265095055103302, -0.20285683870315552, 0.1575608104467392, -0.2653767466545105, 0.21736514568328857, -0.2752907872200012, 0.14204196631908417, -0.16134479641914368, 0.14967945218086243, -0.24128875136375427, -0.04840349406003952, 0.6578292846679688, -0.3743444085121155, -0.023261964321136475, -0.166096493601799, 0.13851529359817505, 0.3137158155441284, -0.01692252606153488, -0.20381441712379456, 0.2743009328842163, 0.06383707374334335, 0.013565931469202042, -0.1398172527551651, -0.033756811171770096, -0.05730268359184265, 0.1416703760623932, -0.09460724890232086, -0.007229253649711609, 0.13378438353538513, -0.13249513506889343, 0.5061249732971191, -0.059027060866355896 ]
https://github.com/huggingface/datasets/issues/5975
We do pass `trust_env` as well. Could you share the full stack trace you get when streaming using `datasets` ? That could help locate where we might have forgotten to pass `trust_env`
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
32
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 We do pass `trust_env` as well. Could you share the full stack trace you get when streaming using `datasets` ? That could help locate where we might have forgotten to pass `trust_env`
[ -0.22055009007453918, -0.04736737906932831, 0.09124628454446793, -0.10017752647399902, 0.36972758173942566, -0.011570446193218231, 0.10142427682876587, 0.1315036416053772, 0.010005481541156769, 0.11178212612867355, 0.09104365110397339, -0.15345272421836853, 0.20461568236351013, 0.12522998452186584, 0.09858983755111694, -0.04407079145312309, 0.09984476864337921, -0.0792984813451767, -0.01666562631726265, 0.12072013318538666, -0.015001393854618073, 0.026894448325037956, -0.06800134479999542, -0.14309412240982056, -0.05634789541363716, -0.006185917183756828, 0.013352058827877045, 0.3663432002067566, -0.22724318504333496, 0.04320567846298218, 0.26426926255226135, 0.13172468543052673, -0.018482010811567307, 0.5819855332374573, -0.0001268554333364591, 0.18023018538951874, 0.40589824318885803, -0.1852678656578064, -0.32394957542419434, -0.34377321600914, -0.3755210041999817, -0.030693091452121735, -0.005020309239625931, -0.051665209233760834, -0.03145093843340874, -0.07742585241794586, 0.32573896646499634, -0.5772076845169067, 0.4002200961112976, 0.27316656708717346, 0.07545273751020432, 0.2194720059633255, -0.051255203783512115, 0.2995569705963135, -0.019077960401773453, 0.11066479980945587, -0.216912180185318, -0.009341930970549583, 0.1502382755279541, 0.06377014517784119, 0.1713094264268875, 0.40262746810913086, -0.37419942021369934, 0.009271927177906036, 0.5120882391929626, -0.1703636199235916, -0.14143434166908264, -0.37655502557754517, -0.09337863326072693, 0.5573853254318237, 0.48189735412597656, -0.2973983585834503, -0.5032281875610352, -0.3070560395717621, 0.010923359543085098, -0.06187105178833008, 0.226521298289299, 0.22481466829776764, -0.06923621147871017, 0.1215524673461914, -0.09645450115203857, -0.2098371684551239, -0.17439430952072144, 0.07935497164726257, 0.06762346625328064, 0.27800533175468445, -0.021482404321432114, 0.15841025114059448, 0.05322322994470596, -0.004797244910150766, -0.2639569044113159, -0.33987486362457275, -0.20295363664627075, 0.12693321704864502, -0.2383502721786499, 0.14426547288894653, 0.0678890272974968, 0.19898104667663574, 0.16114526987075806, 0.29415780305862427, -0.11599516868591309, 0.11055019497871399, -0.31992626190185547, 0.17154815793037415, 0.12234234064817429, 0.14225633442401886, -0.05361359193921089, 0.2426213026046753, 0.30188441276550293, 0.25483056902885437, 0.07353193312883377, -0.17808179557323456, 0.4067758321762085, 0.05128689110279083, -0.4613513946533203, -0.066407710313797, 0.7208111882209778, -0.21110519766807556, -0.34791046380996704, 0.1590573787689209, -0.45831575989723206, 0.09801176190376282, 0.1804535835981369, 0.40269410610198975, -0.26530721783638, 0.36766448616981506, 0.1840682178735733, 0.27740639448165894, -0.23836088180541992, -0.2240290641784668, -0.12414966523647308, -0.16895395517349243, 0.039392709732055664, 0.10911235213279724, 0.01840883493423462, -0.20557042956352234, 0.3481580317020416, -0.05666886642575264, 0.20285174250602722, 0.0637979656457901, 0.04493045061826706, -0.06249123066663742, 0.0031982697546482086, 0.3968469500541687, -0.04602956026792526, 0.12413262575864792, 0.23966975510120392, -0.10610215365886688, 0.05073438584804535, -0.03486976400017738, -0.05971481651067734, -0.2677766680717468, -0.06241147220134735, 0.05373432859778404, -0.29239335656166077, -0.10249555110931396, -0.3829323649406433, 0.16820667684078217, -0.2563234865665436, -0.21644675731658936, 0.19081318378448486, 0.08525344729423523, -0.2668302059173584, 0.12901633977890015, 0.3564684987068176, 0.7964455485343933, -0.25238221883773804, -0.19665536284446716, 0.12153689563274384, -0.24289175868034363, 0.3859180212020874, 0.11210069060325623, 0.004918668419122696, -0.23665198683738708, -0.14214926958084106, 0.18743759393692017, 0.18269121646881104, -0.33762338757514954, -0.5380033254623413, 0.3137439489364624, -0.1635531485080719, 0.4373379945755005, 0.2355724275112152, 0.2031669020652771, 0.025672756135463715, 0.0007042437791824341, -0.13568952679634094, 0.4889136850833893, -0.27409180998802185, 0.15315091609954834, -0.20893630385398865, -0.3161138892173767, 0.08325697481632233, 0.08381745219230652, -0.18136820197105408, 0.26191824674606323, -0.02178453654050827, -0.10075092315673828, 0.2391195297241211, -0.052614063024520874, 0.07085361331701279, 0.2810477018356323, 0.3777708411216736, 0.4594763219356537, -0.10086178779602051, -0.10459955036640167, -0.2903692424297333, 0.030614443123340607, 0.26581859588623047, -0.06436091661453247, -0.11166910082101822, -0.3167189657688141, -0.12861603498458862, -0.10997772961854935, -0.11751765012741089, -0.22270837426185608, -0.09198363125324249, 0.4097800552845001, -0.02544422075152397, 0.21342270076274872, -0.2513706088066101, 0.6161832809448242, -0.3511027693748474, 0.1026923805475235, -0.31830549240112305, 0.28990209102630615, 0.09060278534889221, -0.09075337648391724, -0.1202988475561142, 0.02606046572327614, 0.2942098379135132, -0.11665195971727371, -0.21479472517967224, 0.5232264399528503, 0.010871965438127518, 0.3674163222312927, 0.1811559498310089, 0.08763208985328674, 0.24100887775421143, -0.2724902629852295, -0.03703326731920242, 0.45879635214805603, 0.2268172651529312, 0.07915846258401871, -0.03358607366681099, 0.1559114009141922, 0.176924467086792, 0.2986305058002472, 0.029714852571487427, 0.0293218195438385, 0.2982773780822754, 0.08720411360263824, -0.4232670068740845, -0.006521739065647125, 0.478479266166687, -0.21484065055847168, 0.22207793593406677, -0.16436634957790375, -0.3753005564212799, 0.14298787713050842, -0.10680258274078369, 0.08919111639261246, -0.00044662319123744965, -0.02472284436225891, -0.07335374504327774, 0.04802607744932175, 0.0737662985920906, 0.31762927770614624, 0.33404240012168884, 0.01059965044260025, -0.26153331995010376, 0.20629379153251648, 0.03798098489642143, -0.14414528012275696, 0.08678244054317474, 0.04840411990880966, 0.03980817273259163, -0.03039401024580002, 0.0582965612411499, -0.008988883346319199, -0.22075840830802917, -0.2338566780090332, -0.21336473524570465, 0.058733098208904266, -0.4897640347480774, 0.386738657951355, -0.33451047539711, -0.5597395896911621, -0.0015240274369716644, -0.14421212673187256, -0.28728705644607544, -0.37817108631134033, -0.11074331402778625, 0.39693549275398254, -0.23111741244792938, 0.1832970529794693, -0.6000169515609741, 0.155948206782341, 0.14710810780525208, -0.29489755630493164, -0.3484519124031067, 0.10016557574272156, -0.0687757283449173, -0.09057909995317459, 0.13047565519809723, -0.08201944828033447, 0.34932002425193787, -0.07277199625968933, -0.44235432147979736, -0.43671926856040955, -0.21388199925422668, -0.056249894201755524, -0.0001024315133690834, 0.5094897150993347, -0.03692103549838066, 0.464728444814682, -0.08407554775476456, -0.13899222016334534, 0.23109698295593262, -0.06399653106927872, -0.006196606904268265, -0.15751338005065918, 0.07927379012107849, 0.13952197134494781, -0.06124044209718704, -0.009760726243257523, -0.2967834174633026, -0.24063673615455627, -0.017132725566625595, -0.3542579114437103, -0.07371707260608673, 0.3804399371147156, -0.08514808118343353, 0.011052452027797699, -0.22459247708320618, -0.018990371376276016, -0.09650979191064835, -0.5695589780807495, 0.3065658509731293, 0.02660205587744713, -0.15297095477581024, 0.2810567021369934, 0.11038114130496979, -0.44492393732070923, 0.3142818510532379, -0.4709925651550293, -0.43784141540527344, -0.019322896376252174, -0.01244160532951355, -0.09205307066440582, -0.13613787293434143, 0.1365552842617035, -0.34074944257736206, 0.18293032050132751, -0.2815210223197937, -0.17201140522956848, -0.12335838377475739, 0.015538204461336136, 0.44016504287719727, 0.03516071289777756, 0.629437267780304, -0.01708924025297165, 0.804204523563385, 0.21987248957157135, 0.20904947817325592, 0.5509272217750549, -0.08818169683218002, 0.46628338098526, -0.0018024779856204987, -0.24667902290821075, 0.26759058237075806, 0.1498071849346161, -0.18223877251148224, -0.068455770611763, 0.09467076510190964, 0.19681718945503235, -0.16374555230140686, 0.09162792563438416, -0.13911737501621246, -0.17503109574317932, -0.12476047873497009, -0.10269174724817276, 0.12541469931602478, 0.15212784707546234, 0.22842815518379211, 0.10685734450817108, -0.1963299661874771, -0.11712320148944855, 0.6097620129585266, 0.2833751440048218, 0.20276203751564026, -0.0306643545627594, -0.08968841284513474, -0.7151026725769043, 0.2750805616378784, 0.10654138028621674, 0.3583056330680847, -0.2295309603214264, 0.03316211700439453, 0.06603293120861053, -0.09434786438941956, 0.6981897354125977, -0.12932522594928741, 0.1373533010482788, -0.1277320384979248, -0.06478016823530197, -0.3292621672153473, -0.16608189046382904, 0.16445261240005493, 0.3291347622871399, 0.22386974096298218, -0.17610710859298706, -0.3363511562347412, 0.038086626678705215, 0.11375699192285538, -0.10688212513923645, 0.0684502124786377, 0.01693166419863701, -0.4136267900466919, -0.407879114151001, -0.11782202869653702, -0.022444438189268112, -0.07398742437362671, 0.06480316817760468, 0.04813728481531143, 0.14365720748901367, -0.013389287516474724, 0.18889357149600983, -0.07602579146623611, -0.09040644764900208, 0.24956423044204712, 0.12594294548034668, 0.09242947399616241, 0.23616299033164978, 0.332367479801178, 0.20765358209609985, 0.5836686491966248, 0.39507484436035156, -0.5749269723892212, -0.0953858271241188, 0.2512614130973816, -0.0678800642490387, 0.49995243549346924, -0.037532590329647064, 0.13151809573173523, 0.5415214896202087, 0.17418010532855988, -0.20665636658668518, 0.22688859701156616, 0.3536224067211151, 0.030083339661359787, -0.027520420029759407, -0.6421124935150146, 0.36144745349884033, 0.06704764068126678, 0.1760076880455017, 0.482351690530777, 0.31863686442375183, -0.17752790451049805, -0.02105586975812912, -0.20211049914360046, 0.8771010041236877, 0.16055980324745178, 0.04301684722304344, 0.3375648856163025, -0.002565734088420868, 0.37135177850723267, -0.39088141918182373, 0.22389280796051025, -0.040018655359745026, -0.38356927037239075, -0.2136106789112091, -0.06025586649775505, 0.2803701162338257, -0.4952762722969055, -0.1445891261100769, 0.2862676978111267, 0.01717531681060791, 0.19254593551158905, -0.0021721161901950836, -0.038685888051986694, -0.5366081595420837, -0.11686446517705917, -0.549248993396759, 0.022495120763778687, -0.2942529618740082, 0.37605947256088257, -0.03313647583127022, -0.04924988001585007, -0.0816643089056015, -0.15019750595092773, -0.4493928551673889, 0.31774842739105225, -0.4423326253890991, -0.2058791071176529, -0.1305176019668579, -0.06730755418539047, -0.022605709731578827, 0.023996518924832344, -0.05520004779100418, -0.03395465761423111, -0.44063013792037964, 0.4782004654407501, -0.22056320309638977, 0.009214255958795547, 0.031085770577192307, -0.11240065097808838, 0.23385056853294373, 0.03540925681591034, -0.276120662689209, 0.060743845999240875, -0.1490124762058258, -0.37364572286605835, 0.033268436789512634, -0.23706607520580292, 0.33285990357398987, 0.06264864653348923, -0.1712609827518463, 0.031741514801979065, 0.2526596188545227, -0.08939199894666672, 0.012652609497308731, -0.05410059168934822, -0.23248258233070374, -0.06269913911819458, -0.06590685248374939, -0.2426491677761078, -0.13323040306568146, 0.5322279334068298, -0.37660160660743713, 0.1965896189212799, 0.5268016457557678, 0.17223891615867615, -0.08340935409069061, -0.027939889580011368, 0.049701519310474396, -0.2481279820203781, 0.022033005952835083, 0.10728606581687927, -0.02076331153512001, 0.09278517961502075, -0.25214096903800964, 0.069356769323349, -0.20737522840499878, -0.22918502986431122, -0.0051094964146614075, -0.5217728614807129, -0.06548111140727997, 0.09548085927963257, -0.18155863881111145, 0.0015387018211185932, 0.20448817312717438, 0.14982855319976807, 0.19969725608825684, -0.1277841180562973, -0.16026200354099274, -0.13893304765224457, -0.058302223682403564, 0.060999274253845215, 0.26548856496810913, 0.26507437229156494, 0.3714017868041992, -0.2295694798231125, -0.08741110563278198, 0.07171490788459778, -0.2767575979232788, -0.04505579173564911, -0.19227059185504913, 0.20975928008556366, 0.14403410255908966, -0.5231112837791443, -0.10424446314573288, -0.4103921949863434, -0.16173087060451508, -0.13336463272571564, 0.13333246111869812, 0.48553499579429626, 0.03993375599384308, -0.23977136611938477, -0.016424031928181648, 0.1825902760028839, -0.06890605390071869, 0.08938111364841461, -0.012996163219213486, 0.361410528421402, 0.04422939941287041, 0.05336230620741844, -0.055122874677181244, 0.018710851669311523, -0.15952609479427338, -0.0733126848936081, 0.10709289461374283, 0.3322891294956207, 0.3932335376739502, -0.14775533974170685, 0.07525259256362915, 0.2058005928993225, 0.38559818267822266, 0.2831897437572479, -0.16699695587158203, 0.02909740060567856, 0.3160633444786072, 0.03945247083902359, -0.0004889890551567078, 0.10150773823261261, 0.5911045074462891, 0.2745024561882019, 0.1478869616985321, 0.038272321224212646, -0.06870578974485397, 0.06886143982410431, 0.07354576140642166, 0.11700078845024109, 0.4315029978752136, 0.18080532550811768, 0.5821753144264221, 0.07322385907173157, 0.023268841207027435, 0.20847144722938538, -0.13025732338428497, 0.10225160419940948, 0.20037731528282166, 0.3891318440437317, -0.011407177895307541, 0.27611953020095825, -0.04411126673221588, 0.06318548321723938, -0.30915743112564087, -0.4400300979614258, -0.06494247913360596, 0.007679544389247894, -0.2362275868654251, 0.37075406312942505, 0.028148947283625603, 0.06497035920619965, -0.5025316476821899, -0.10366028547286987, -0.2644060254096985, 0.27530142664909363, 0.023334041237831116, -0.15329957008361816, -0.17146910727024078, -0.06702008098363876, 0.15561240911483765, 0.17729178071022034, 0.075870580971241, -0.047672078013420105, 0.011763263493776321, 0.07221764326095581, -0.12217062711715698, -0.36651575565338135, 0.06889484822750092, 0.06596508622169495, 0.4471262991428375, -0.13819004595279694, 0.2077595442533493, 0.054359499365091324, 0.03965890407562256, 0.3099214434623718, 0.3962833285331726, 0.35930147767066956, 0.2996453046798706, 0.05443950742483139, 0.15793918073177338, 0.1842411756515503, -0.02994801104068756, 0.04650147259235382, 0.04474986717104912, 0.00010666996240615845, -0.24022270739078522, 0.18004758656024933, 0.042636461555957794, -0.06127801537513733, 0.16121919453144073, -0.0392528735101223, 0.4510558545589447, -0.43871501088142395, 0.11504179239273071, -0.4101783335208893, 0.4309338927268982, -0.34151652455329895, -0.06548307836055756, -0.2829992175102234, 0.34901830554008484, 0.19698387384414673, -0.03910352289676666, 0.16966745257377625, -0.05749276280403137, -0.029325567185878754, -0.18111443519592285, 0.17995260655879974, 0.5158204436302185, -0.13623052835464478, -0.17575687170028687, -0.006125137209892273, -0.35250139236450195, 0.12746202945709229, -0.2074526846408844, -0.384221613407135, -0.1253664791584015, 0.19987785816192627, -0.03328773379325867, 0.09240785241127014, 0.1552392542362213, 0.10947885364294052, 0.14183545112609863, 0.03115088865160942, -0.1378106027841568, -0.3190208971500397, -0.4815005362033844, 0.16023854911327362, -0.04132109135389328, -0.23385925590991974, 0.14294207096099854, 0.08502408117055893, -0.09535768628120422, 0.2287764698266983, -0.3345835506916046, -0.2309684455394745, -0.389670729637146, 0.25438207387924194, 0.06574395298957825, 0.23778589069843292, -0.08696009963750839, -0.10901154577732086, -0.31504958868026733, -0.19082540273666382, -0.3067021369934082, -0.271124929189682, -0.2232351452112198, 0.44633471965789795, -0.2732633352279663, -0.0540117509663105, -0.44246426224708557, 0.47280409932136536, 0.051844075322151184, -0.15566307306289673, -0.241498202085495, 0.17123693227767944, -0.3009803891181946, 0.19097723066806793, -0.27866441011428833, 0.07748223096132278, -0.13924700021743774, 0.1682860553264618, -0.2044323831796646, -0.11534270644187927, 0.6962776780128479, -0.3367502689361572, -0.0017447099089622498, -0.18237954378128052, 0.09035807847976685, 0.32662028074264526, -0.02466382272541523, -0.2539740800857544, 0.3295881748199463, 0.07675252109766006, 0.02248828113079071, -0.08482182025909424, -0.010286414995789528, -0.14776141941547394, 0.12914757430553436, -0.07647471874952316, -0.047353897243738174, 0.13362905383110046, -0.08920405060052872, 0.5417448878288269, -0.02153848484158516 ]
https://github.com/huggingface/datasets/issues/5975
Is there a way to disable ssl verification when streaming a dataset. I suspect this might be the isssue with my proxy. Here you go: ``` FileNotFoundError Traceback (most recent call last) Cell In[8], line 3 1 from datasets import load_dataset ----> 3 ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) 5 sample = next(iter(ds)) File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/load.py:1790](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/load.py:1790), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 # Return iterable dataset in case of streaming 1789 if streaming: -> 1790 return builder_instance.as_streaming_dataset(split=split) 1792 # Some datasets are already processed on the HF google storage 1793 # Don't try downloading from Google storage for the packaged datasets as text, json, csv or pandas 1794 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/builder.py:1281](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/builder.py:1281), in DatasetBuilder.as_streaming_dataset(self, split, base_path) 1274 dl_manager = StreamingDownloadManager( 1275 base_path=base_path or self.base_path, 1276 download_config=DownloadConfig(use_auth_token=self.use_auth_token, storage_options=self.storage_options), 1277 dataset_name=self.name, 1278 data_dir=self.config.data_dir, 1279 ) 1280 self._check_manual_download(dl_manager) -> 1281 splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} 1282 # By default, return all splits 1283 if split is None: File [~/.cache/huggingface/modules/datasets_modules/datasets/facebook--voxpopuli/b5ff837284f0778eefe0f642734e142d8c3f574eba8c9c8a4b13602297f73604/voxpopuli.py:120](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.cache/huggingface/modules/datasets_modules/datasets/facebook--voxpopuli/b5ff837284f0778eefe0f642734e142d8c3f574eba8c9c8a4b13602297f73604/voxpopuli.py:120), in Voxpopuli._split_generators(self, dl_manager) 118 def _split_generators(self, dl_manager): 119 n_shards_path = dl_manager.download_and_extract(_N_SHARDS_FILE) --> 120 with open(n_shards_path) as f: 121 n_shards = json.load(f) 123 if self.config.name == "en_accented": File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/streaming.py:71](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/streaming.py:71), in extend_module_for_streaming..wrap_auth..wrapper(*args, **kwargs) 69 @wraps(function) 70 def wrapper(*args, **kwargs): ---> 71 return function(*args, use_auth_token=use_auth_token, **kwargs) File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:517](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:517), in xopen(file, mode, use_auth_token, *args, **kwargs) 515 except FileNotFoundError: 516 if file.startswith(config.HF_ENDPOINT): --> 517 raise FileNotFoundError( 518 file + "\nIf the repo is private or gated, make sure to log in with `huggingface-cli login`." 519 ) from None 520 else: 521 raise FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ```
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
282
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 Is there a way to disable ssl verification when streaming a dataset. I suspect this might be the isssue with my proxy. Here you go: ``` FileNotFoundError Traceback (most recent call last) Cell In[8], line 3 1 from datasets import load_dataset ----> 3 ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) 5 sample = next(iter(ds)) File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/load.py:1790](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/load.py:1790), in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 # Return iterable dataset in case of streaming 1789 if streaming: -> 1790 return builder_instance.as_streaming_dataset(split=split) 1792 # Some datasets are already processed on the HF google storage 1793 # Don't try downloading from Google storage for the packaged datasets as text, json, csv or pandas 1794 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/builder.py:1281](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/builder.py:1281), in DatasetBuilder.as_streaming_dataset(self, split, base_path) 1274 dl_manager = StreamingDownloadManager( 1275 base_path=base_path or self.base_path, 1276 download_config=DownloadConfig(use_auth_token=self.use_auth_token, storage_options=self.storage_options), 1277 dataset_name=self.name, 1278 data_dir=self.config.data_dir, 1279 ) 1280 self._check_manual_download(dl_manager) -> 1281 splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} 1282 # By default, return all splits 1283 if split is None: File [~/.cache/huggingface/modules/datasets_modules/datasets/facebook--voxpopuli/b5ff837284f0778eefe0f642734e142d8c3f574eba8c9c8a4b13602297f73604/voxpopuli.py:120](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.cache/huggingface/modules/datasets_modules/datasets/facebook--voxpopuli/b5ff837284f0778eefe0f642734e142d8c3f574eba8c9c8a4b13602297f73604/voxpopuli.py:120), in Voxpopuli._split_generators(self, dl_manager) 118 def _split_generators(self, dl_manager): 119 n_shards_path = dl_manager.download_and_extract(_N_SHARDS_FILE) --> 120 with open(n_shards_path) as f: 121 n_shards = json.load(f) 123 if self.config.name == "en_accented": File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/streaming.py:71](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/streaming.py:71), in extend_module_for_streaming..wrap_auth..wrapper(*args, **kwargs) 69 @wraps(function) 70 def wrapper(*args, **kwargs): ---> 71 return function(*args, use_auth_token=use_auth_token, **kwargs) File [~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:517](https://vscode-remote+ssh-002dremote-002bml-002er-002dsoftware-002eat.vscode-resource.vscode-cdn.net/home/wrsbri/projects/audio_course/~/.conda/envs/audio_hf/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:517), in xopen(file, mode, use_auth_token, *args, **kwargs) 515 except FileNotFoundError: 516 if file.startswith(config.HF_ENDPOINT): --> 517 raise FileNotFoundError( 518 file + "\nIf the repo is private or gated, make sure to log in with `huggingface-cli login`." 519 ) from None 520 else: 521 raise FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ```
[ -0.24882769584655762, -0.05979403853416443, 0.1007160171866417, -0.10208457708358765, 0.24106337130069733, -0.006721898913383484, 0.17118151485919952, 0.06702045351266861, -0.020424023270606995, 0.1228136420249939, 0.11307883262634277, -0.21383479237556458, 0.2762974798679352, 0.006733819842338562, 0.07609730213880539, 0.024944618344306946, 0.05803810432553291, -0.07915334403514862, -0.023750435560941696, 0.1624048352241516, 0.04177097976207733, -0.026761185377836227, -0.13535363972187042, -0.12524278461933136, 0.0394267663359642, -0.10102294385433197, 0.06038115918636322, 0.20640332996845245, -0.2620925307273865, -0.05032553896307945, 0.21784904599189758, 0.11256451904773712, -0.03998454287648201, 0.428039014339447, -0.00012739950034301728, 0.19163163006305695, 0.4263509511947632, -0.14920152723789215, -0.34510326385498047, -0.33619096875190735, -0.4527885615825653, -0.01960190013051033, 0.02500435709953308, -0.02162841707468033, 0.02099570631980896, -0.13919535279273987, 0.19024698436260223, -0.5174437165260315, 0.42188790440559387, 0.31944143772125244, 0.05576370656490326, 0.2200120985507965, -0.10203850269317627, 0.44042691588401794, -0.19495275616645813, 0.06058690696954727, -0.16426046192646027, 0.0571700818836689, 0.1053297221660614, 0.07503975927829742, 0.1776505410671234, 0.47770607471466064, -0.3823812007904053, -0.046322327107191086, 0.4585990011692047, -0.17960596084594727, -0.1382753551006317, -0.4498394727706909, 0.04958853870630264, 0.6405585408210754, 0.5654544234275818, -0.31727850437164307, -0.4939993619918823, -0.2375892698764801, 0.04841306433081627, 0.0502064973115921, 0.3548155128955841, 0.33010900020599365, -0.09288232773542404, 0.1431685984134674, -0.0966140627861023, -0.18650680780410767, -0.1301443874835968, 0.011366979219019413, 0.04487776756286621, 0.26809611916542053, 0.015370674431324005, 0.11462268233299255, 0.1315002739429474, -0.07180914282798767, -0.18586553633213043, -0.4531306028366089, -0.24197939038276672, 0.141076922416687, -0.29055941104888916, 0.057336390018463135, -0.008250968530774117, 0.15698310732841492, 0.1288512498140335, 0.2772316038608551, 0.05015018954873085, 0.13279639184474945, -0.20860272645950317, 0.13592883944511414, 0.06632284075021744, 0.16351889073848724, -0.03741844370961189, 0.22584569454193115, 0.36661332845687866, 0.31070879101753235, 0.17331865429878235, -0.10159281641244888, 0.45583170652389526, 0.004884984344244003, -0.3694775104522705, -0.009889617562294006, 0.6486763954162598, -0.2744954526424408, -0.3863505423069, 0.20954203605651855, -0.5609046816825867, 0.05343130603432655, 0.24340426921844482, 0.3624357283115387, -0.17870983481407166, 0.3705241084098816, 0.1125900074839592, 0.1899801641702652, -0.15770787000656128, -0.13995659351348877, -0.06468793004751205, -0.09168660640716553, 0.1773347407579422, 0.18380846083164215, 0.0405365526676178, -0.25125640630722046, 0.3021913170814514, 0.005074184387922287, 0.12962770462036133, -0.010639272630214691, 0.06467949599027634, -0.15131592750549316, 0.12653566896915436, 0.3846636712551117, -0.10068896412849426, 0.05317017436027527, 0.15502819418907166, -0.08286242187023163, 0.013724058866500854, 0.02800339087843895, 0.023990018293261528, -0.2588460445404053, -0.027346380054950714, 0.04195239022374153, -0.36061930656433105, -0.0661846399307251, -0.1957179307937622, 0.16099968552589417, -0.3513917326927185, -0.24477925896644592, 0.23546722531318665, 0.06505018472671509, -0.21792680025100708, 0.22188715636730194, 0.3155982792377472, 0.7515555620193481, -0.3696878254413605, -0.18162819743156433, 0.10262071341276169, -0.26936066150665283, 0.3242019712924957, 0.09934459626674652, -0.030085952952504158, -0.22464817762374878, -0.15542122721672058, 0.21495378017425537, 0.23808830976486206, -0.3808969557285309, -0.610016942024231, 0.3565930128097534, -0.030600309371948242, 0.4614383578300476, 0.25118759274482727, 0.2366591989994049, -0.03557965159416199, 0.03776363655924797, -0.25247955322265625, 0.33145368099212646, -0.19045975804328918, 0.10815639793872833, -0.2617115378379822, -0.30128970742225647, 0.10615283995866776, 0.02859477698802948, -0.2740669548511505, 0.25932830572128296, -0.0621933788061142, -0.11620292067527771, 0.17814242839813232, -0.13603730499744415, 0.014688849449157715, 0.2908112406730652, 0.4122829735279083, 0.39128103852272034, -0.10631580650806427, -0.053993016481399536, -0.32709112763404846, 0.011603839695453644, 0.30477046966552734, 0.013726459816098213, -0.23547212779521942, -0.2994009852409363, -0.05077546462416649, -0.13917525112628937, -0.12857234477996826, -0.26319220662117004, -0.1017313003540039, 0.36412525177001953, 0.09313501417636871, 0.20634165406227112, -0.24076272547245026, 0.6099973917007446, -0.3229307532310486, 0.050645869225263596, -0.3443372845649719, 0.19630011916160583, 0.03163304179906845, 0.035982243716716766, -0.019203826785087585, 0.05630364269018173, 0.2643367052078247, -0.09635591506958008, -0.16940264403820038, 0.5057210326194763, 0.07117563486099243, 0.2845446765422821, 0.1147853434085846, 0.13750143349170685, 0.2190026044845581, -0.3110167384147644, -0.06951609998941422, 0.3459347188472748, 0.22295022010803223, 0.1674107164144516, -0.039724402129650116, 0.19231531023979187, 0.13871808350086212, 0.2822490930557251, 0.04071909189224243, -0.03666694089770317, 0.3506675362586975, 0.04824663698673248, -0.5566163063049316, -0.03241188824176788, 0.4437917470932007, -0.22353015840053558, 0.30384165048599243, -0.1317894607782364, -0.3422344923019409, 0.04197275638580322, -0.07928360998630524, 0.05272471904754639, 0.07467784732580185, 0.0032172249630093575, -0.05978608503937721, 0.004848212003707886, 0.056049272418022156, 0.3987634479999542, 0.32436609268188477, -0.04362666606903076, -0.20559462904930115, 0.23962661623954773, -0.005819942802190781, -0.161645770072937, 0.14888709783554077, 0.012082783505320549, -0.027110597118735313, 0.04722451791167259, 0.06651035696268082, -0.01993691176176071, -0.3144976496696472, -0.21555127203464508, -0.17114168405532837, 0.05766981840133667, -0.42438727617263794, 0.43687981367111206, -0.39411666989326477, -0.5177326798439026, 0.031563568860292435, -0.07544825971126556, -0.3397497236728668, -0.31376320123672485, -0.02442242205142975, 0.4034145474433899, -0.21321064233779907, 0.1991991102695465, -0.5954256057739258, 0.18289946019649506, 0.16893568634986877, -0.35989826917648315, -0.28711456060409546, 0.06405549496412277, -0.08359284698963165, -0.0742400735616684, 0.21683527529239655, -0.0524236299097538, 0.3494250774383545, -0.030931074172258377, -0.49409928917884827, -0.4889468848705292, -0.1922236680984497, -0.036834802478551865, 0.05827668309211731, 0.427219033241272, -0.02251427248120308, 0.4354831278324127, -0.04385307803750038, -0.14444613456726074, 0.15920120477676392, 0.003997310996055603, -0.044209811836481094, -0.1287916600704193, -0.03286976367235184, 0.21425455808639526, -0.06492213159799576, -0.004197116941213608, -0.23335519433021545, -0.15374422073364258, -0.05619395896792412, -0.4606464207172394, -0.010287843644618988, 0.36485958099365234, -0.0806802362203598, -0.003710314631462097, -0.27491047978401184, -0.055872298777103424, -0.1358359456062317, -0.615071177482605, 0.34477293491363525, 0.10884542763233185, -0.19578112661838531, 0.227717787027359, 0.06554894149303436, -0.30689966678619385, 0.2752750813961029, -0.5503798127174377, -0.5611276030540466, -0.06716291606426239, 0.033424824476242065, -0.18402314186096191, -0.26560935378074646, 0.13940982520580292, -0.31365126371383667, 0.16947214305400848, -0.25383299589157104, -0.14619052410125732, -0.07420691847801208, -0.04591144248843193, 0.49339768290519714, 0.0371941514313221, 0.6148654818534851, 0.05016982555389404, 0.78841233253479, 0.19011788070201874, 0.09670548141002655, 0.4604695439338684, -0.02980199083685875, 0.41890788078308105, 0.059165097773075104, -0.17574846744537354, 0.17363978922367096, 0.15689481794834137, -0.10698900371789932, -0.10707876086235046, -0.026571374386548996, 0.23338335752487183, -0.20770037174224854, 0.24353067576885223, -0.16456785798072815, -0.19942188262939453, -0.09273206442594528, -0.2207311987876892, 0.22626714408397675, 0.2142847180366516, 0.26619189977645874, 0.14425279200077057, -0.1677013337612152, -0.09376106411218643, 0.6643587350845337, 0.3982059359550476, 0.16700142621994019, -0.07871004939079285, -0.13579753041267395, -0.6752011775970459, 0.29173728823661804, 0.2146615982055664, 0.5342473983764648, -0.29443395137786865, 0.06626974046230316, 0.07258938997983932, -0.11504955589771271, 0.6723254919052124, -0.10431531816720963, 0.16129007935523987, -0.12772685289382935, -0.03889942169189453, -0.24678219854831696, -0.1607542186975479, 0.11686024069786072, 0.18950048089027405, 0.2740074694156647, -0.1783279925584793, -0.3931210935115814, 0.07373317331075668, 0.01578710600733757, -0.0667538046836853, 0.06719544529914856, -0.0032327361404895782, -0.49776798486709595, -0.41464927792549133, -0.06000658497214317, -0.017284829169511795, -0.0986308604478836, 0.05886067822575569, -0.027201741933822632, 0.1862286478281021, 0.11991368979215622, 0.12132274359464645, -0.011580929160118103, 0.04499095678329468, 0.2216005027294159, 0.07239407300949097, 0.03855197876691818, 0.24279844760894775, 0.34598973393440247, 0.18740594387054443, 0.5330182909965515, 0.46901506185531616, -0.5702400803565979, -0.048660971224308014, 0.23235732316970825, -0.19867999851703644, 0.42960450053215027, -0.09593607485294342, 0.24215416610240936, 0.5350132584571838, 0.1577313244342804, -0.2588493227958679, 0.15631532669067383, 0.30673760175704956, 0.1454465687274933, 0.00009002909064292908, -0.5183588266372681, 0.28897979855537415, 0.03414501994848251, 0.1759411245584488, 0.4351714551448822, 0.2617247700691223, -0.1840035319328308, -0.0895044356584549, -0.13698360323905945, 0.8281607627868652, 0.24855118989944458, -0.08546927571296692, 0.36428648233413696, 0.013311520218849182, 0.48086628317832947, -0.4206168055534363, 0.3049831986427307, -0.006014019250869751, -0.39743539690971375, -0.23462297022342682, -0.14711199700832367, 0.38415098190307617, -0.43970486521720886, -0.1742214858531952, 0.282606303691864, 0.07594339549541473, 0.1282356232404709, 0.03909308463335037, 0.06543639302253723, -0.6285830140113831, -0.02664971351623535, -0.5401325225830078, 0.012173239141702652, -0.2597675323486328, 0.37715470790863037, -0.046512529253959656, -0.03649764508008957, -0.03776618093252182, -0.23709061741828918, -0.4835878908634186, 0.2978689670562744, -0.34487059712409973, -0.13129663467407227, -0.14123950898647308, -0.07382363826036453, 0.0994962826371193, 0.035015229135751724, -0.010989192873239517, -0.036510828882455826, -0.42532339692115784, 0.4426673352718353, -0.20529556274414062, 0.09806302189826965, -0.0604679211974144, -0.09620395302772522, 0.204938605427742, -0.043676067143678665, -0.2930869460105896, 0.011289200745522976, -0.14638343453407288, -0.37433117628097534, 0.12741565704345703, -0.23991072177886963, 0.3284599184989929, 0.08517063409090042, -0.04682872071862221, -0.02431594952940941, 0.22117212414741516, -0.08456146717071533, -0.005311766639351845, -0.10846810042858124, -0.2683008015155792, 0.020318038761615753, -0.03352583944797516, -0.2675536572933197, -0.05953637883067131, 0.529121458530426, -0.3625132739543915, 0.2616457939147949, 0.6128159165382385, 0.12275592982769012, -0.07071660459041595, -0.10402502119541168, 0.06005578488111496, -0.3742525577545166, 0.053118474781513214, 0.06523624062538147, 0.05949030816555023, 0.09677755832672119, -0.3498818278312683, 0.01244734413921833, -0.20583663880825043, -0.07710786163806915, -0.07415913045406342, -0.5295748114585876, 0.040136151015758514, 0.05515609309077263, -0.20086413621902466, 0.012912596575915813, 0.12663234770298004, 0.34394511580467224, 0.15391552448272705, -0.07966813445091248, -0.13732188940048218, -0.12679165601730347, -0.19461730122566223, 0.13863709568977356, 0.23105968534946442, 0.22981232404708862, 0.37740400433540344, -0.17790710926055908, -0.09914109855890274, 0.13211427628993988, -0.2589278221130371, -0.042889855802059174, -0.1603441834449768, 0.20380832254886627, 0.11613316833972931, -0.5617790818214417, -0.16466662287712097, -0.3186537027359009, -0.1719343364238739, -0.020335912704467773, 0.11260508000850677, 0.4186643958091736, 0.026146750897169113, -0.13017740845680237, -0.14658018946647644, 0.1676025092601776, -0.12873682379722595, 0.04059916362166405, -0.12715135514736176, 0.3312145471572876, 0.16717272996902466, 0.08395028114318848, 0.010094024240970612, -0.0011553317308425903, -0.2594454288482666, -0.0018457453697919846, 0.1081310510635376, 0.17633146047592163, 0.2794685363769531, -0.04359548166394234, 0.08866355568170547, 0.06466331332921982, 0.3432038426399231, 0.34844183921813965, -0.1756495237350464, -0.029559146612882614, 0.2716711163520813, 0.018110018223524094, -0.04533011466264725, 0.09574996680021286, 0.4215013384819031, 0.1296933889389038, 0.17925523221492767, -0.01046483963727951, -0.07693997770547867, 0.1100115180015564, 0.1250413954257965, 0.029201939702033997, 0.3843981921672821, 0.2040245682001114, 0.5632761716842651, 0.2121497243642807, -0.017831318080425262, 0.2260376214981079, -0.06585564464330673, -0.021789344027638435, 0.07822148501873016, 0.29784876108169556, -0.03955325484275818, 0.24510079622268677, -0.08638545870780945, 0.161749467253685, -0.3064486086368561, -0.478606641292572, -0.03766040503978729, -0.0031825751066207886, -0.21151211857795715, 0.24135935306549072, 0.04250536859035492, -0.06511107087135315, -0.44184041023254395, -0.07637262344360352, -0.2278662919998169, 0.22585435211658478, 0.05121322348713875, -0.1954280138015747, -0.2434190958738327, -0.09979918599128723, 0.25771430134773254, 0.18406786024570465, 0.16958191990852356, 0.016741780564188957, -0.08279934525489807, 0.07484540343284607, -0.1769530177116394, -0.319528192281723, -0.028534725308418274, 0.12209800630807877, 0.4052655100822449, -0.12293975055217743, 0.21742582321166992, 0.14169952273368835, 0.04749135673046112, 0.30851224064826965, 0.38641753792762756, 0.2866665720939636, 0.27227848768234253, 0.1677856147289276, 0.1961667388677597, 0.09829379618167877, -0.015749763697385788, 0.050012409687042236, 0.12403906881809235, 0.03731371462345123, -0.3180476427078247, 0.3018350601196289, 0.013355821371078491, -0.010821275413036346, 0.1689404547214508, -0.1153012067079544, 0.4396655559539795, -0.4485436677932739, 0.08867691457271576, -0.35679247975349426, 0.4718175232410431, -0.39349502325057983, 0.0023642033338546753, -0.2198053002357483, 0.30440202355384827, 0.13293665647506714, -0.08349832892417908, 0.1777721345424652, -0.11014506965875626, -0.027679571881890297, -0.2414124459028244, 0.24238139390945435, 0.5545068979263306, -0.14401915669441223, -0.19289182126522064, -0.015582993626594543, -0.4372706413269043, 0.055356401950120926, -0.15223100781440735, -0.3405742645263672, -0.214921772480011, 0.25694572925567627, -0.08427774906158447, 0.21498456597328186, 0.08720841258764267, 0.16754689812660217, 0.0928116887807846, 0.06805387139320374, -0.11794820427894592, -0.19480907917022705, -0.4890574812889099, 0.23153363168239594, -0.1505953073501587, -0.2279423177242279, 0.2644837498664856, 0.11061088740825653, -0.07235635071992874, 0.3044693171977997, -0.33968275785446167, -0.2854660153388977, -0.1679588109254837, 0.25901949405670166, 0.25135841965675354, 0.3061867356300354, -0.05230563133955002, -0.11875231564044952, -0.22408989071846008, -0.13338983058929443, -0.21813668310642242, -0.19406801462173462, -0.16041940450668335, 0.4224041700363159, -0.16593676805496216, 0.011602634564042091, -0.42703211307525635, 0.6022767424583435, 0.018399260938167572, -0.19621264934539795, -0.30337297916412354, 0.03594301640987396, -0.22796055674552917, 0.23263290524482727, -0.2769626975059509, 0.024714916944503784, -0.07126899063587189, 0.09690605103969574, -0.3079310357570648, -0.08447498083114624, 0.6275231838226318, -0.3461484909057617, 0.08076493442058563, -0.18081364035606384, 0.21000000834465027, 0.32588475942611694, -0.05078970640897751, -0.23724007606506348, 0.2536504864692688, 0.1268538534641266, -0.031060533598065376, -0.0172387957572937, -0.029117301106452942, -0.15496014058589935, 0.20886588096618652, -0.13115453720092773, -0.13455405831336975, 0.11319920420646667, -0.045484259724617004, 0.45787426829338074, -0.04479365423321724 ]
https://github.com/huggingface/datasets/issues/5975
> Is there a way to disable ssl verification when streaming a dataset. I don't think so. We use `fsspec` HTTPFileSystem implementation that is based on `aiohttp`. If you register a subclass of HTTPFileSystem that has SSL disabled by default it could work, but I wouldn't recommended it because it can raise security issues.
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
54
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 > Is there a way to disable ssl verification when streaming a dataset. I don't think so. We use `fsspec` HTTPFileSystem implementation that is based on `aiohttp`. If you register a subclass of HTTPFileSystem that has SSL disabled by default it could work, but I wouldn't recommended it because it can raise security issues.
[ -0.25454550981521606, -0.01584668457508087, 0.1071445494890213, -0.10625217854976654, 0.23831488192081451, -0.018652863800525665, 0.13900716602802277, 0.07588482648134232, 0.0818885862827301, 0.13150793313980103, 0.12248197197914124, -0.2498541623353958, 0.30348244309425354, 0.17006513476371765, 0.06800545752048492, 0.08819985389709473, 0.08650308847427368, -0.016591928899288177, -0.07093776762485504, 0.1515316218137741, 0.08118300139904022, -0.03683310002088547, -0.12429738789796829, -0.15578995645046234, -0.004989981651306152, -0.05305063724517822, 0.05781800299882889, 0.21560364961624146, -0.3002265393733978, -0.0902777761220932, 0.2659517824649811, 0.08883459866046906, -0.07677597552537918, 0.3581041097640991, -0.00012957319268025458, 0.22270797193050385, 0.39856064319610596, -0.1547427773475647, -0.25756752490997314, -0.27477678656578064, -0.4934389293193817, -0.01906735450029373, 0.033668555319309235, -0.01799701154232025, 0.046635836362838745, -0.08487826585769653, 0.22977876663208008, -0.480336457490921, 0.4390809237957001, 0.3640913963317871, 0.03149528056383133, 0.18969343602657318, -0.0649256557226181, 0.45306187868118286, -0.1734960526227951, 0.05113982781767845, -0.17130377888679504, -0.0163145512342453, 0.052816130220890045, 0.013374924659729004, 0.1304883062839508, 0.4404279291629791, -0.3077161908149719, -0.0235381331294775, 0.45687487721443176, -0.17532336711883545, -0.13867902755737305, -0.43999266624450684, -0.011722770519554615, 0.6246607899665833, 0.5270360708236694, -0.28360074758529663, -0.4732920527458191, -0.2262582629919052, 0.0394158773124218, 0.05912967026233673, 0.33245089650154114, 0.2917988896369934, -0.1320033073425293, 0.1690981239080429, -0.09295443445444107, -0.25525638461112976, -0.23363342881202698, 0.05659741535782814, 0.04707964509725571, 0.21165701746940613, 0.014294706284999847, 0.07973536849021912, 0.0937078595161438, -0.06337793171405792, -0.2550797760486603, -0.40846747159957886, -0.2181260883808136, 0.1534246951341629, -0.28624141216278076, 0.027264803647994995, 0.02249605394899845, 0.19000056385993958, 0.1516096293926239, 0.24814726412296295, 0.024995755404233932, 0.16430255770683289, -0.24362143874168396, 0.1320490539073944, 0.10317005962133408, 0.217951238155365, -0.035679157823324203, 0.14769533276557922, 0.35898086428642273, 0.3027360737323761, 0.07476125657558441, -0.11404670774936676, 0.5204870700836182, 0.03488856554031372, -0.3825717866420746, -0.046568430960178375, 0.6366821527481079, -0.3309633433818817, -0.33809512853622437, 0.1960897147655487, -0.5464267730712891, 0.025877300649881363, 0.16384972631931305, 0.33010315895080566, -0.2047147899866104, 0.4334253668785095, 0.08713231980800629, 0.16579569876194, -0.2497633397579193, -0.19024091958999634, -0.06849870085716248, -0.11534887552261353, 0.10292625427246094, 0.1925504207611084, 0.04779361933469772, -0.21934494376182556, 0.26821526885032654, -0.030588988214731216, 0.18611526489257812, 0.057026974856853485, 0.06028734892606735, -0.11827503144741058, 0.11046786606311798, 0.4289329946041107, -0.11533910036087036, -0.030141547322273254, 0.16507785022258759, -0.10830498486757278, 0.022844642400741577, 0.00016240030527114868, 0.017022335901856422, -0.2728416919708252, 0.010368997231125832, 0.01596420258283615, -0.36588025093078613, -0.1290612369775772, -0.26789093017578125, 0.16047893464565277, -0.3819431662559509, -0.23006346821784973, 0.20253095030784607, 0.11658349633216858, -0.1960759460926056, 0.18045493960380554, 0.30983349680900574, 0.7481928467750549, -0.3272809684276581, -0.2269478440284729, 0.029537204653024673, -0.30579647421836853, 0.31642499566078186, 0.16941389441490173, 0.012291956692934036, -0.1867695301771164, -0.16308891773223877, 0.21909663081169128, 0.2735304534435272, -0.3108152151107788, -0.6442462801933289, 0.3925575911998749, 0.018787652254104614, 0.452534943819046, 0.27963101863861084, 0.23893260955810547, -0.04907887428998947, 0.0255390927195549, -0.3016293942928314, 0.35631924867630005, -0.2255978286266327, 0.06287483870983124, -0.23897893726825714, -0.3538369834423065, 0.07897231727838516, 0.06121542304754257, -0.22367553412914276, 0.3362577557563782, -0.01132240891456604, -0.17067956924438477, 0.19694893062114716, -0.09728289395570755, 0.009131122380495071, 0.25704917311668396, 0.4694177806377411, 0.3782860338687897, -0.11998270452022552, -0.09775300323963165, -0.40650638937950134, 0.031728826463222504, 0.2328101545572281, 0.017195705324411392, -0.1837393343448639, -0.27392011880874634, -0.017245512455701828, -0.1609913408756256, -0.06671296805143356, -0.2293459177017212, -0.1283261477947235, 0.3008209466934204, 0.13705676794052124, 0.19341495633125305, -0.29403552412986755, 0.6863006353378296, -0.3051433861255646, 0.07081232964992523, -0.3717899024486542, 0.23669180274009705, 0.051058463752269745, 0.006869804114103317, -0.0785270631313324, 0.04120389372110367, 0.23251302540302277, -0.08656374365091324, -0.14033585786819458, 0.4683911204338074, 0.10060960054397583, 0.26599064469337463, 0.17660292983055115, 0.26852554082870483, 0.2254721224308014, -0.3566969633102417, -0.0700562596321106, 0.36513715982437134, 0.19763614237308502, 0.17550873756408691, -0.02383904904127121, 0.1816544532775879, 0.15008601546287537, 0.28289175033569336, 0.08716434985399246, -0.030789971351623535, 0.36396324634552, 0.003883473575115204, -0.523450493812561, -0.05749893561005592, 0.43152904510498047, -0.1623530387878418, 0.2387157380580902, -0.09205690771341324, -0.3038526773452759, 0.09215234220027924, -0.0694752037525177, 0.074351005256176, 0.04839503392577171, 0.041672233492136, -0.029453381896018982, -0.00947173684835434, 0.07228988409042358, 0.3545999825000763, 0.3788362741470337, -0.01270090788602829, -0.21157027781009674, 0.2541164755821228, 0.0006032250821590424, -0.15068665146827698, 0.11847162246704102, 0.004828125238418579, -0.07040990144014359, -0.009660663083195686, 0.06401944160461426, -0.0295025035738945, -0.31306031346321106, -0.20257166028022766, -0.21689245104789734, 0.05872926115989685, -0.4485143721103668, 0.4454350173473358, -0.40527772903442383, -0.5653452277183533, 0.01846807450056076, -0.04878653213381767, -0.3547232151031494, -0.2707952857017517, -0.01622365415096283, 0.37951037287712097, -0.20392480492591858, 0.19588997960090637, -0.600707471370697, 0.21995975077152252, 0.12941990792751312, -0.293182373046875, -0.3390583395957947, 0.08985139429569244, -0.09520670026540756, -0.09461382031440735, 0.25832223892211914, -0.011705804616212845, 0.3471636474132538, -0.02080710604786873, -0.5158297419548035, -0.4679386019706726, -0.19828778505325317, -0.04583415389060974, 0.035333264619112015, 0.38991132378578186, -0.06647144258022308, 0.4605303704738617, -0.01253306120634079, -0.03009549155831337, 0.13506029546260834, -0.04033973067998886, -0.07207051664590836, -0.10338769108057022, -0.025922298431396484, 0.23702140152454376, -0.04953479394316673, -0.03269420191645622, -0.2349606454372406, -0.13377022743225098, -0.011289546266198158, -0.46408790349960327, 0.0030227582901716232, 0.3139152228832245, -0.05737203359603882, -0.021289627999067307, -0.3004583716392517, -0.14233994483947754, -0.061214204877614975, -0.6345280408859253, 0.33629533648490906, 0.11600330471992493, -0.1929631531238556, 0.27874869108200073, 0.10559544712305069, -0.39921218156814575, 0.27076730132102966, -0.5855134725570679, -0.5052724480628967, -0.15956974029541016, 0.027225054800510406, -0.22771309316158295, -0.21328353881835938, 0.21976947784423828, -0.31817978620529175, 0.161141499876976, -0.2553679347038269, -0.07961336523294449, -0.025070466101169586, -0.0007653515785932541, 0.4518961012363434, 0.04281502962112427, 0.5616501569747925, 0.06558360159397125, 0.8205011487007141, 0.21493032574653625, 0.08859042823314667, 0.49760717153549194, -0.0464247465133667, 0.396367609500885, 0.058237478137016296, -0.1468995213508606, 0.1992568075656891, 0.12429818511009216, -0.11648041754961014, -0.08048595488071442, 0.010392669588327408, 0.23708873987197876, -0.20701295137405396, 0.2690601050853729, -0.13785013556480408, -0.17051692306995392, -0.05500480532646179, -0.15904758870601654, 0.24005404114723206, 0.2097937911748886, 0.18626286089420319, 0.16656926274299622, -0.18228918313980103, -0.06828770041465759, 0.630400538444519, 0.3678891956806183, 0.1749303787946701, -0.03666994720697403, -0.19314220547676086, -0.7105090618133545, 0.2971692979335785, 0.21040582656860352, 0.4318808913230896, -0.29625582695007324, 0.04068150371313095, 0.08683354407548904, -0.11527471244335175, 0.6273056268692017, -0.12411610037088394, 0.2178337424993515, -0.11473964899778366, -0.026297062635421753, -0.20975349843502045, -0.13147404789924622, 0.12135367095470428, 0.12802866101264954, 0.2870861291885376, -0.1672586053609848, -0.393954873085022, 0.04567959904670715, -0.05082844942808151, -0.12195029854774475, 0.058935657143592834, 0.010953232645988464, -0.5033321380615234, -0.33109280467033386, -0.04441682994365692, -0.007002249360084534, -0.11019289493560791, 0.0042807720601558685, -0.010924242436885834, 0.17316988110542297, 0.06314568966627121, 0.13728603720664978, -0.04299125447869301, 0.042158931493759155, 0.17932364344596863, 0.049459002912044525, 0.041694626212120056, 0.23239856958389282, 0.3497583270072937, 0.24606426060199738, 0.5960574150085449, 0.4537307918071747, -0.6357945799827576, -0.12311314046382904, 0.30460020899772644, -0.18657170236110687, 0.4181774854660034, -0.06349092721939087, 0.24488887190818787, 0.5421736836433411, 0.1729714572429657, -0.2433810830116272, 0.20604801177978516, 0.2699086368083954, 0.1128561943769455, 0.007003907114267349, -0.4966078996658325, 0.35626211762428284, -0.032584067434072495, 0.1915040761232376, 0.41079187393188477, 0.3403840661048889, -0.17424644529819489, -0.06861105561256409, -0.1493556797504425, 0.8668534755706787, 0.25243645906448364, 0.0010890038684010506, 0.32009655237197876, -0.06381544470787048, 0.45177558064460754, -0.4404873251914978, 0.27570056915283203, 0.001963511109352112, -0.3657529056072235, -0.25795355439186096, -0.13488681614398956, 0.45313864946365356, -0.3794454336166382, -0.17344674468040466, 0.27132517099380493, 0.08145244419574738, 0.07213941216468811, 0.07137085497379303, 0.08152733743190765, -0.607792317867279, -0.05412084609270096, -0.5584075450897217, -0.0066850632429122925, -0.25171783566474915, 0.3327948749065399, -0.044800810515880585, -0.022919997572898865, 0.005046732723712921, -0.23040294647216797, -0.5240867137908936, 0.3110754191875458, -0.3614673614501953, -0.13031414151191711, -0.12125340104103088, -0.0061294883489608765, 0.11628220975399017, 0.02758844569325447, -0.02274380251765251, -0.10193425416946411, -0.44308900833129883, 0.44915932416915894, -0.1425827443599701, 0.07239928841590881, -0.022683188319206238, -0.10211646556854248, 0.1987035572528839, -0.05189948156476021, -0.2976955771446228, -0.015856295824050903, -0.15305519104003906, -0.40986570715904236, 0.1652294546365738, -0.23726128041744232, 0.3914874494075775, 0.0669088214635849, -0.010310616344213486, 0.034364551305770874, 0.24081480503082275, -0.06566981971263885, -0.027542147785425186, -0.036913201212882996, -0.24916532635688782, 0.07771579176187515, -0.07895664870738983, -0.2744629979133606, -0.06553306430578232, 0.5469279885292053, -0.3414618670940399, 0.2307204008102417, 0.5941979885101318, 0.08021505177021027, -0.06975632160902023, -0.11603938043117523, 0.1171066015958786, -0.3228783905506134, 0.06265735626220703, 0.04731988161802292, 0.0882413387298584, 0.07832174003124237, -0.35498759150505066, 0.10621339082717896, -0.20839476585388184, -0.11199919879436493, -0.05826520547270775, -0.5173854827880859, 0.027745239436626434, 0.056391045451164246, -0.15027578175067902, 0.004569401498883963, 0.11407272517681122, 0.2915475368499756, 0.1205868273973465, -0.07757651805877686, -0.11774997413158417, -0.10237778723239899, -0.15796349942684174, 0.08773946017026901, 0.2124808430671692, 0.26328542828559875, 0.4320739209651947, -0.22667886316776276, -0.1300731897354126, 0.0951743870973587, -0.2799115478992462, -0.03583173081278801, -0.1394658088684082, 0.2204134464263916, 0.13228264451026917, -0.5290851593017578, -0.1549961268901825, -0.3385646343231201, -0.19680169224739075, 0.014789711683988571, 0.13860133290290833, 0.4406140446662903, -0.014631807804107666, -0.08855169266462326, -0.06495659798383713, 0.11395673453807831, -0.16399019956588745, 0.06119265779852867, -0.10406447947025299, 0.3276381194591522, 0.16031499207019806, 0.05377040430903435, -0.027944084256887436, 0.016455918550491333, -0.16220882534980774, -0.005068756639957428, 0.15867111086845398, 0.22678633034229279, 0.26476606726646423, -0.06874922662973404, 0.07735565304756165, 0.045758623629808426, 0.3258591592311859, 0.2921130359172821, -0.11112291365861893, -0.025229744613170624, 0.3389660120010376, -0.002637093421071768, -0.0776786282658577, 0.07417886704206467, 0.5075778365135193, 0.17326533794403076, 0.1790085732936859, -0.027245521545410156, -0.12756463885307312, 0.12508907914161682, 0.12782077491283417, 0.020984001457691193, 0.2529298961162567, 0.29017531871795654, 0.5099726319313049, 0.12535931169986725, 0.02107129991054535, 0.19304737448692322, -0.14831805229187012, -0.0008626002818346024, 0.10482476651668549, 0.35427582263946533, 0.03972615674138069, 0.2387470304965973, -0.12565164268016815, 0.17243249714374542, -0.38265660405158997, -0.5039661526679993, -0.09367406368255615, -0.05072914808988571, -0.250415176153183, 0.2874143719673157, 0.06447400152683258, 0.033553335815668106, -0.384544312953949, -0.13786675035953522, -0.23748037219047546, 0.18486064672470093, 0.11755675077438354, -0.14764443039894104, -0.18556106090545654, -0.03879211097955704, 0.2626872956752777, 0.20295795798301697, 0.19307813048362732, 0.0014563845470547676, 0.034650690853595734, 0.13898777961730957, -0.18939881026744843, -0.290659099817276, -0.04039917513728142, 0.10994340479373932, 0.460797518491745, -0.08223073929548264, 0.1979895979166031, 0.07087281346321106, -0.0025669168680906296, 0.29867804050445557, 0.43957123160362244, 0.23403580486774445, 0.19179511070251465, 0.1662323772907257, 0.20278507471084595, 0.14452897012233734, -0.008722756057977676, 0.03717580437660217, 0.12305489182472229, 0.038577958941459656, -0.26749640703201294, 0.2480984926223755, -0.02940736524760723, 0.0010629333555698395, 0.1282598078250885, -0.1638106405735016, 0.39605259895324707, -0.4848690927028656, 0.16294902563095093, -0.31804683804512024, 0.4598637521266937, -0.4057517349720001, 0.04037405923008919, -0.27339044213294983, 0.24477875232696533, 0.116411492228508, -0.11197465658187866, 0.13935399055480957, -0.0967414528131485, -0.04242466017603874, -0.26033592224121094, 0.3218018412590027, 0.5625677108764648, -0.10044235736131668, -0.17542707920074463, -0.03949727863073349, -0.4222317337989807, 0.07328518480062485, -0.17528872191905975, -0.2842891216278076, -0.19806578755378723, 0.23792047798633575, -0.08663147687911987, 0.1820419579744339, 0.1238526701927185, 0.1278352290391922, 0.07689253240823746, 0.11311165243387222, -0.12313226610422134, -0.15931862592697144, -0.47555917501449585, 0.22748440504074097, -0.18572798371315002, -0.24833956360816956, 0.2600622773170471, 0.1458168923854828, -0.09085901081562042, 0.3945971727371216, -0.3444445729255676, -0.27270692586898804, -0.2962222695350647, 0.319067120552063, 0.22651128470897675, 0.28705736994743347, -0.03783923760056496, -0.15275275707244873, -0.1327367126941681, -0.13906246423721313, -0.29265397787094116, -0.2139415740966797, -0.1844559758901596, 0.43183469772338867, -0.2876613736152649, 0.08708542585372925, -0.3941536843776703, 0.5657054781913757, 0.04359717667102814, -0.24497778713703156, -0.2790388762950897, 0.05145503580570221, -0.21622797846794128, 0.26385965943336487, -0.2857838273048401, 0.06821897625923157, -0.09454333782196045, 0.05963899940252304, -0.2920547127723694, -0.014502439647912979, 0.61166912317276, -0.3866521716117859, 0.06096865236759186, -0.19049176573753357, 0.24531830847263336, 0.28219956159591675, -0.08612765371799469, -0.2499857395887375, 0.1921418458223343, 0.08614882826805115, -0.01499268226325512, -0.04826230928301811, -0.005429554730653763, -0.19748802483081818, 0.21164140105247498, -0.14763487875461578, 0.01991795189678669, 0.09744121879339218, -0.010974586009979248, 0.4600105285644531, -0.040822144597768784 ]
https://github.com/huggingface/datasets/issues/5975
Okay thanks for your help! I guess I have to figure out how to improve the proxy environment / see if I can make it work with ssl connections.
Streaming Dataset behind Proxy - FileNotFoundError
### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2
29
Streaming Dataset behind Proxy - FileNotFoundError ### Describe the bug When trying to stream a dataset i get the following error after a few minutes of waiting. ``` FileNotFoundError: https://huggingface.co/datasets/facebook/voxpopuli/resolve/main/data/n_files.json If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` I have already set the proxy environment variables. Downloading a Dataset without streaming works as expected. Still i suspect that this is connected to being behind a proxy. Is there a way to set the proxy for streaming datasets? Possibly a keyword argument that gets passed to ffspec? ### Steps to reproduce the bug This is the code i use. ``` import os os.environ['http_proxy'] = "http://example.com:xxxx" os.environ['https_proxy'] = "http://example.com:xxxx" from datasets import load_dataset ds = load_dataset("facebook/voxpopuli", name="de", streaming=True) ``` ### Expected behavior I would expect the streaming functionality to use the set proxy settings. ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-73-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.2 Okay thanks for your help! I guess I have to figure out how to improve the proxy environment / see if I can make it work with ssl connections.
[ -0.22630605101585388, -0.08385404199361801, 0.08787970244884491, -0.11146005988121033, 0.31258198618888855, -0.019106529653072357, 0.1175183653831482, 0.1108732521533966, -0.001358620822429657, 0.05213000997900963, 0.09835232049226761, -0.17861908674240112, 0.21179527044296265, 0.14290660619735718, 0.11755552887916565, -0.0716758668422699, 0.08804665505886078, -0.10730284452438354, -0.06993769854307175, 0.13748660683631897, 0.004770323634147644, 0.03324273228645325, -0.07876859605312347, -0.14767296612262726, -0.0008928664028644562, -0.041709139943122864, 0.02626071870326996, 0.32652923464775085, -0.18827171623706818, 0.03481380641460419, 0.21156108379364014, 0.0988578349351883, 0.011828936636447906, 0.5143142342567444, -0.00012768112355843186, 0.19049081206321716, 0.39412182569503784, -0.18129777908325195, -0.2830962538719177, -0.33256253600120544, -0.3295993506908417, -0.06006287410855293, 0.033986516296863556, -0.028648503124713898, -0.03576444461941719, -0.11546926200389862, 0.313618004322052, -0.5326490998268127, 0.4143241047859192, 0.24743178486824036, 0.07745596766471863, 0.16388316452503204, -0.10195857286453247, 0.3750110864639282, -0.07522213459014893, 0.12437883764505386, -0.23847460746765137, 0.035815153270959854, 0.26258188486099243, 0.0285574272274971, 0.1874263435602188, 0.44285354018211365, -0.38943716883659363, -0.011940469034016132, 0.5614148378372192, -0.12242409586906433, -0.13167744874954224, -0.37291330099105835, -0.06942082941532135, 0.581567108631134, 0.5081964731216431, -0.2810822129249573, -0.4848787784576416, -0.32179123163223267, 0.02678835019469261, -0.06030946224927902, 0.26348167657852173, 0.2519248127937317, -0.10059811174869537, 0.12197129428386688, -0.04208829998970032, -0.21851319074630737, -0.19758792221546173, 0.09369970858097076, 0.10914860665798187, 0.3514002859592438, -0.017891403287649155, 0.1477506458759308, 0.06547600030899048, -0.0499771423637867, -0.25769200921058655, -0.32345154881477356, -0.19160699844360352, 0.12722332775592804, -0.2565234303474426, 0.14491277933120728, 0.021126260980963707, 0.1658277064561844, 0.10770336538553238, 0.27524083852767944, -0.029305508360266685, 0.1005963534116745, -0.29088786244392395, 0.13670435547828674, 0.1119534969329834, 0.16541804373264313, -0.03831738978624344, 0.22843718528747559, 0.32796797156333923, 0.26784735918045044, 0.08777648210525513, -0.15232059359550476, 0.4230118989944458, 0.031752895563840866, -0.46163973212242126, -0.06403593719005585, 0.7162261009216309, -0.19850969314575195, -0.3404642343521118, 0.2068384438753128, -0.4840279221534729, 0.07152320444583893, 0.18783162534236908, 0.4024014472961426, -0.2596079409122467, 0.3639218211174011, 0.19636036455631256, 0.2763237953186035, -0.22252139449119568, -0.145316481590271, -0.08374229073524475, -0.1388232260942459, 0.09264615923166275, 0.12257423996925354, -0.0038727298378944397, -0.14968173205852509, 0.32441747188568115, -0.04521149396896362, 0.16220608353614807, 0.05214371532201767, 0.05265229195356369, -0.04440545290708542, 0.03787185624241829, 0.3925521969795227, -0.051189400255680084, 0.09504498541355133, 0.21119634807109833, -0.11564712226390839, 0.02010267972946167, -0.006001537665724754, -0.02949310839176178, -0.2544766962528229, -0.05689675360918045, 0.04819021001458168, -0.2945149540901184, -0.11574317514896393, -0.32110270857810974, 0.20006752014160156, -0.34209176898002625, -0.2144228219985962, 0.20015035569667816, 0.07369819283485413, -0.24719053506851196, 0.15517425537109375, 0.33101561665534973, 0.7855743169784546, -0.3409959077835083, -0.19675010442733765, 0.14200802147388458, -0.23525823652744293, 0.42728084325790405, 0.07222588360309601, 0.0314793735742569, -0.2381623238325119, -0.10820776224136353, 0.19985151290893555, 0.22828511893749237, -0.2964528203010559, -0.5613141655921936, 0.3526669442653656, -0.14336510002613068, 0.44181373715400696, 0.287405788898468, 0.2689878046512604, -0.005271788686513901, 0.06553168594837189, -0.17969411611557007, 0.45326265692710876, -0.2391604632139206, 0.1151987835764885, -0.21982964873313904, -0.3423493206501007, 0.06566008925437927, 0.09123256802558899, -0.20260335505008698, 0.24514880776405334, -0.08431673794984818, -0.13469839096069336, 0.24623334407806396, -0.04411855340003967, 0.08285833895206451, 0.29879552125930786, 0.3639185428619385, 0.5143231749534607, -0.08729251474142075, -0.06006325036287308, -0.3157569169998169, 0.005202017724514008, 0.25948238372802734, -0.05876735597848892, -0.1406971514225006, -0.30462774634361267, -0.11268305778503418, -0.1118159294128418, -0.13014864921569824, -0.27176040410995483, -0.08974528312683105, 0.3570290803909302, 0.010406143963336945, 0.1581808626651764, -0.25205472111701965, 0.6394380331039429, -0.30573219060897827, 0.0703011304140091, -0.32937440276145935, 0.2819627523422241, 0.055268794298172, -0.1244458258152008, -0.10177638381719589, 0.027833761647343636, 0.25616443157196045, -0.13299430906772614, -0.22694508731365204, 0.47762206196784973, -0.023789577186107635, 0.3679797649383545, 0.17905916273593903, 0.10546151548624039, 0.22582140564918518, -0.29266154766082764, -0.05371849238872528, 0.4521893262863159, 0.20454071462154388, 0.07871295511722565, -0.0881304144859314, 0.13729029893875122, 0.17433972656726837, 0.3208801746368408, 0.013663582503795624, 0.0269387885928154, 0.3029685318470001, 0.06580983102321625, -0.4229336380958557, -0.0053990185260772705, 0.49171239137649536, -0.1973726898431778, 0.27042099833488464, -0.18423648178577423, -0.4081289768218994, 0.1587074100971222, -0.20295368134975433, 0.07015952467918396, 0.050834279507398605, 0.014217838644981384, -0.06943699717521667, 0.05411176383495331, 0.07339268177747726, 0.3189176619052887, 0.3305712640285492, -0.006642013788223267, -0.2977479100227356, 0.2573304772377014, 0.06817448139190674, -0.1504477709531784, 0.0731198713183403, 0.02216276153922081, -0.011639639735221863, -0.037723083049058914, 0.054630205035209656, 0.0008874870836734772, -0.22154855728149414, -0.24358046054840088, -0.24473455548286438, 0.10676076263189316, -0.4775201082229614, 0.3995354473590851, -0.31389641761779785, -0.5643335580825806, 0.019193146377801895, -0.07295705378055573, -0.28453493118286133, -0.35705506801605225, -0.10267280787229538, 0.4141712486743927, -0.2882014811038971, 0.1659965217113495, -0.572260856628418, 0.15811733901500702, 0.16360881924629211, -0.33558693528175354, -0.3579131066799164, 0.058412402868270874, -0.07350121438503265, -0.08514094352722168, 0.16528965532779694, -0.03554706647992134, 0.341062992811203, -0.07309390604496002, -0.47141018509864807, -0.47819462418556213, -0.2081873118877411, -0.06612613797187805, 0.014708315953612328, 0.51402747631073, -0.006328873336315155, 0.5018916130065918, -0.126826211810112, -0.17721746861934662, 0.25401702523231506, -0.09444291889667511, 0.014031343162059784, -0.172775000333786, 0.004987951368093491, 0.15125805139541626, -0.05306190997362137, -0.02412731945514679, -0.3258481025695801, -0.258948415517807, -0.011732181534171104, -0.3907429277896881, -0.04173288866877556, 0.32463011145591736, -0.050387460738420486, -0.018216736614704132, -0.24578814208507538, -0.026791956275701523, -0.06763356924057007, -0.5982418060302734, 0.34345296025276184, 0.04736886918544769, -0.20433220267295837, 0.25842249393463135, 0.0884980633854866, -0.4514869451522827, 0.2561371922492981, -0.5263524055480957, -0.5181401968002319, -0.0498146116733551, -0.014057867228984833, -0.11052575707435608, -0.14799685776233673, 0.09859894216060638, -0.3329978287220001, 0.17147697508335114, -0.26419150829315186, -0.173152893781662, -0.0738460123538971, 0.0345451682806015, 0.4313580393791199, 0.07520586252212524, 0.651854395866394, -0.028307776898145676, 0.8042614459991455, 0.19607695937156677, 0.21522775292396545, 0.5497762560844421, -0.0850163921713829, 0.4102327227592468, 0.02721921168267727, -0.23114214837551117, 0.24145695567131042, 0.16596069931983948, -0.13627374172210693, -0.05719423666596413, 0.11027587205171585, 0.21696555614471436, -0.15429627895355225, 0.1275826096534729, -0.18968607485294342, -0.1642613261938095, -0.06129986047744751, -0.06209208071231842, 0.1385650932788849, 0.13301049172878265, 0.18598376214504242, 0.09935107827186584, -0.1895427405834198, -0.0945616215467453, 0.6295559406280518, 0.286629855632782, 0.21403954923152924, -0.03604816645383835, -0.14401330053806305, -0.7486265301704407, 0.2981637716293335, 0.15430869162082672, 0.3730795383453369, -0.27808594703674316, 0.02771647274494171, 0.08902601897716522, -0.1099562793970108, 0.6914041638374329, -0.06526241451501846, 0.1382099837064743, -0.09940777719020844, -0.06432328373193741, -0.3394482731819153, -0.1599959433078766, 0.18873408436775208, 0.29677245020866394, 0.291248619556427, -0.20315150916576385, -0.3358278274536133, 0.044332657009363174, 0.08181747794151306, -0.08669127523899078, 0.04635413736104965, -0.034693047404289246, -0.4340870678424835, -0.4152713418006897, -0.10895101726055145, -0.027813266962766647, -0.09629590809345245, 0.06542088091373444, 0.10489103943109512, 0.12971745431423187, 0.09827688336372375, 0.12349661439657211, -0.0706549808382988, -0.018357079476118088, 0.23386278748512268, 0.11111195385456085, 0.09225829690694809, 0.22619634866714478, 0.34705689549446106, 0.17038390040397644, 0.5770363807678223, 0.41242289543151855, -0.5341941714286804, -0.058586038649082184, 0.22237157821655273, -0.11988145858049393, 0.46205762028694153, -0.06681054830551147, 0.19214139878749847, 0.5077028274536133, 0.222234308719635, -0.22025662660598755, 0.24350959062576294, 0.3021419048309326, 0.09978292882442474, 0.03500779718160629, -0.6277351379394531, 0.39327675104141235, 0.04514608532190323, 0.15543676912784576, 0.4566407799720764, 0.30937573313713074, -0.15918371081352234, -0.041901953518390656, -0.18702679872512817, 0.8713453412055969, 0.1648179441690445, 0.02237231470644474, 0.34451204538345337, -0.012228906154632568, 0.400785893201828, -0.3713439106941223, 0.22326692938804626, -0.033627212047576904, -0.3419491648674011, -0.18955184519290924, -0.08342164754867554, 0.31712162494659424, -0.4777916967868805, -0.17128172516822815, 0.2838398814201355, 0.0055731236934661865, 0.12781697511672974, 0.004032246768474579, -0.022304795682430267, -0.5851518511772156, -0.08045125007629395, -0.5809133052825928, 0.011067606508731842, -0.28361448645591736, 0.38915494084358215, -0.049625176936388016, -0.04917723312973976, -0.14953558146953583, -0.14421088993549347, -0.4271498918533325, 0.29393309354782104, -0.4051881432533264, -0.20574849843978882, -0.1297280192375183, -0.11670199036598206, -0.03941767290234566, 0.0555352084338665, -0.05598417669534683, -0.11051690578460693, -0.4734390377998352, 0.4593771994113922, -0.2510908246040344, 0.04528658837080002, 0.018293004482984543, -0.12708699703216553, 0.21478061378002167, -0.005614481866359711, -0.24228352308273315, 0.05563889071345329, -0.12896636128425598, -0.36584436893463135, 0.05535277724266052, -0.23731763660907745, 0.3638421297073364, 0.06671302765607834, -0.1630413681268692, 0.003580896183848381, 0.23502066731452942, -0.09015596657991409, 0.003251538146287203, -0.013541627675294876, -0.25799843668937683, -0.015209697186946869, -0.06457559019327164, -0.23074820637702942, -0.13290897011756897, 0.48819372057914734, -0.38013529777526855, 0.24069538712501526, 0.5710016489028931, 0.2048702985048294, -0.06890466064214706, -0.02546120434999466, 0.08251011371612549, -0.27205395698547363, 0.015976890921592712, 0.13876648247241974, -0.005165353417396545, 0.051705747842788696, -0.2761502265930176, 0.08198608458042145, -0.19120827317237854, -0.18069006502628326, -0.028651364147663116, -0.5192692875862122, -0.07122261077165604, 0.0839361846446991, -0.1523618996143341, -0.010510335676372051, 0.20396468043327332, 0.22296041250228882, 0.1999986171722412, -0.14250242710113525, -0.1501440703868866, -0.15816442668437958, -0.09050062298774719, 0.08599871397018433, 0.26247960329055786, 0.262416809797287, 0.3306565582752228, -0.20345956087112427, -0.10135053098201752, 0.05732451751828194, -0.26939868927001953, -0.04114498943090439, -0.2186538726091385, 0.20948320627212524, 0.11903083324432373, -0.5831356048583984, -0.12307196110486984, -0.410800039768219, -0.12000523507595062, -0.10699084401130676, 0.13415300846099854, 0.4345023036003113, 0.009176786988973618, -0.2215774655342102, -0.049276333302259445, 0.16359591484069824, -0.1273781806230545, 0.11096715927124023, -0.09455743432044983, 0.40347570180892944, 0.11157198250293732, 0.04178185015916824, -0.0001775585114955902, 0.016882479190826416, -0.13877148926258087, -0.0749204084277153, 0.061374202370643616, 0.27369412779808044, 0.39140748977661133, -0.08827115595340729, 0.08422602713108063, 0.21510252356529236, 0.37429648637771606, 0.3119228482246399, -0.1397298276424408, 0.06658461689949036, 0.30020102858543396, 0.03463359922170639, -0.015142105519771576, 0.08403566479682922, 0.5395733118057251, 0.2528485953807831, 0.1699894517660141, 0.017166592180728912, -0.05850004032254219, 0.07376992702484131, 0.060891471803188324, 0.12014777958393097, 0.39905327558517456, 0.2622542679309845, 0.553747832775116, 0.12814462184906006, 0.008284933865070343, 0.23516684770584106, -0.14172226190567017, 0.044284965842962265, 0.15443651378154755, 0.34545135498046875, 0.018845994025468826, 0.28250303864479065, -0.053305864334106445, 0.15191590785980225, -0.30623579025268555, -0.45862194895744324, -0.06160404905676842, -0.02890702337026596, -0.22461050748825073, 0.3594284653663635, 0.029127996414899826, -0.012788113206624985, -0.49525946378707886, -0.10597649216651917, -0.18335983157157898, 0.2662735879421234, 0.04095613583922386, -0.18169867992401123, -0.18351036310195923, -0.046698346734046936, 0.2143591344356537, 0.19730190932750702, 0.10935401171445847, -0.06273123621940613, -0.03622719272971153, 0.061805713921785355, -0.11912471801042557, -0.3412235379219055, 0.02323038876056671, 0.061142951250076294, 0.433064341545105, -0.13788099586963654, 0.2034565657377243, 0.1274670660495758, 0.005427621304988861, 0.2837376594543457, 0.3856433033943176, 0.3396186828613281, 0.30867457389831543, 0.06298178434371948, 0.19169455766677856, 0.16035760939121246, -0.026822399348020554, -0.004735581576824188, 0.024374205619096756, 0.03020336478948593, -0.2599370777606964, 0.18454352021217346, 0.03454514592885971, -0.0555855892598629, 0.17117132246494293, -0.06106124445796013, 0.4467429220676422, -0.41717711091041565, 0.05436230078339577, -0.3791077136993408, 0.40146151185035706, -0.3366188108921051, -0.06298703700304031, -0.26576659083366394, 0.35509973764419556, 0.1809142827987671, -0.08654652535915375, 0.17016030848026276, -0.057843126356601715, -0.036946240812540054, -0.1602458953857422, 0.24721881747245789, 0.5211949944496155, -0.07461988925933838, -0.17821075022220612, -0.010812148451805115, -0.3810023367404938, 0.1046244278550148, -0.19176915287971497, -0.38657745718955994, -0.15450270473957062, 0.2059597223997116, -0.06904664635658264, 0.10094749927520752, 0.19281378388404846, 0.1284952014684677, 0.11017580330371857, 0.022850975394248962, -0.15052953362464905, -0.32025009393692017, -0.45179256796836853, 0.2344643920660019, -0.07598983496427536, -0.2175946831703186, 0.19065602123737335, 0.0807880163192749, -0.09141764789819717, 0.20512858033180237, -0.3578542470932007, -0.29089733958244324, -0.28937065601348877, 0.2648727297782898, 0.12521305680274963, 0.2236545830965042, -0.07140021026134491, -0.12250405550003052, -0.30515891313552856, -0.19684314727783203, -0.2463260293006897, -0.30150145292282104, -0.18703563511371613, 0.4626050889492035, -0.29790017008781433, -0.02859322354197502, -0.42774835228919983, 0.49970388412475586, 0.037033066153526306, -0.14751046895980835, -0.26338300108909607, 0.17361795902252197, -0.258623868227005, 0.2085319310426712, -0.289841890335083, 0.09477405995130539, -0.1401454210281372, 0.08165708184242249, -0.23623016476631165, -0.09587250649929047, 0.6885057687759399, -0.3225563168525696, -0.0036638453602790833, -0.1960640251636505, 0.061367910355329514, 0.3289841413497925, 0.05358196794986725, -0.2081199288368225, 0.28910762071609497, 0.07484700530767441, 0.05828755348920822, -0.0661453902721405, -0.020679190754890442, -0.13006216287612915, 0.10724542289972305, -0.07857806235551834, -0.0842774510383606, 0.169327974319458, -0.07491397112607956, 0.5188896656036377, -0.053097739815711975 ]
https://github.com/huggingface/datasets/issues/5971
Loading a local dataset also works the same way when `data_files` are not specified, so I agree we should make this info easier to discover cc @stevhliu
Docs: make "repository structure" easier to find
The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages.
27
Docs: make "repository structure" easier to find The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages. Loading a local dataset also works the same way when `data_files` are not specified, so I agree we should make this info easier to discover cc @stevhliu
[ -0.23497682809829712, 0.09987065196037292, -0.1013665497303009, 0.31530508399009705, 0.13123159110546112, -0.038293980062007904, -0.043238017708063126, 0.45117151737213135, 0.034013889729976654, 0.5910804271697998, 0.01932922750711441, 0.1766023337841034, 0.1995181143283844, 0.22821994125843048, 0.45318087935447693, 0.0723934918642044, -0.06094645708799362, 0.3619297742843628, 0.1876714825630188, -0.21024292707443237, -0.06139114871621132, 0.014494525268673897, 0.12320452183485031, -0.02506168559193611, 0.0569373220205307, 0.29033082723617554, -0.16520462930202484, 0.36364635825157166, -0.3361736238002777, -0.53647780418396, 0.014177471399307251, 0.263761967420578, 0.18511612713336945, 0.14578065276145935, -0.00010614944767439738, 0.025024637579917908, 0.23752951622009277, -0.08279525488615036, -0.5580800175666809, -0.0047617703676223755, -0.43448561429977417, -0.3924465775489807, 0.2181420624256134, -0.3248499035835266, -0.09820740669965744, -0.1443808227777481, 0.3790057599544525, 0.011681631207466125, -0.18849316239356995, -0.058563847094774246, 0.22374358773231506, 0.40135467052459717, -0.0745496153831482, -0.015910698100924492, 0.37844282388687134, 0.4688228368759155, -0.34968164563179016, 0.321332722902298, 0.28696972131729126, -0.06904831528663635, -0.21758663654327393, 0.37147724628448486, -0.10011520236730576, 0.007410997524857521, 0.3197551369667053, 0.3962818384170532, 0.2255060076713562, -0.30143338441848755, -0.010382244363427162, 0.3253110349178314, 0.6926302909851074, -0.2557043135166168, -0.18540191650390625, -0.4316325783729553, -0.17501500248908997, 0.15386122465133667, 0.03339914232492447, 0.2124762386083603, -0.06624612212181091, 0.44045424461364746, -0.23774974048137665, -0.45296981930732727, -0.013396680355072021, 0.13106976449489594, 0.29511401057243347, -0.011103559285402298, -0.06703437119722366, -0.15857166051864624, 0.21737101674079895, -0.06485350430011749, -0.06400617957115173, -0.11842431873083115, 0.12057141214609146, 0.31393498182296753, 0.18295136094093323, -0.18193969130516052, 0.1656361222267151, 0.20073659718036652, 0.4759634733200073, 0.0819963738322258, 0.1135203167796135, -0.02038412168622017, -0.20433823764324188, 0.23667743802070618, -0.01973103918135166, 0.06549861282110214, 0.06054896116256714, 0.02365197241306305, 0.40816205739974976, 0.18586120009422302, 0.26624077558517456, -0.1339963674545288, -0.21627014875411987, -0.03200335055589676, -0.15351898968219757, -0.16342830657958984, 0.3423568606376648, -0.13603337109088898, -0.050884343683719635, -0.10657854378223419, -0.03980109095573425, -0.2623482346534729, 0.19472818076610565, 0.3340763747692108, 0.15769949555397034, 0.14984437823295593, -0.16885775327682495, -0.19563749432563782, -0.25460219383239746, -0.14519718289375305, -0.19657698273658752, 0.03186361864209175, -0.022457629442214966, 0.3391713500022888, 0.14462430775165558, -0.41860029101371765, 0.3539782762527466, -0.24230220913887024, 0.02733493410050869, 0.09859270602464676, -0.055907655507326126, 0.23850111663341522, 0.28453803062438965, 0.4657718241214752, 0.14291948080062866, -0.14791005849838257, 0.03930613398551941, -0.20717963576316833, -0.4158887267112732, 0.00005402229726314545, -0.38105541467666626, -0.5211611390113831, -0.23772594332695007, 0.20924566686153412, 0.08394289016723633, 0.06380242109298706, -0.3569628596305847, 0.36783289909362793, -0.13074299693107605, -0.06304635852575302, 0.0037837885320186615, 0.4485313296318054, -0.2977164387702942, -0.19582787156105042, 0.23337595164775848, 0.7245703935623169, -0.02227339893579483, -0.1619676947593689, 0.0231519415974617, -0.31814247369766235, -0.06297643482685089, 0.038494329899549484, -0.257493793964386, 0.4914798140525818, -0.3863774538040161, 0.15948592126369476, 0.36136069893836975, -0.4690040051937103, -0.29960620403289795, 0.35472801327705383, -0.2875332534313202, -0.03130428493022919, 0.031099161133170128, 0.042113758623600006, 0.049933645874261856, -0.23386873304843903, -0.1451033651828766, -0.11264422535896301, -0.16275623440742493, 0.32070598006248474, -0.1120637059211731, -0.3001299500465393, -0.13181962072849274, 0.07727424055337906, -0.05995490029454231, 0.3744504451751709, 0.15089991688728333, -0.05875210836529732, 0.3948719799518585, -0.0616057924926281, -0.0874185860157013, 0.2384534776210785, 0.5275777578353882, 0.06126467511057854, 0.06111009046435356, -0.054785601794719696, -0.5702183246612549, 0.06487996876239777, 0.16686749458312988, -0.02302796021103859, -0.13823752105236053, -0.46258026361465454, -0.1457258015871048, 0.0006929785013198853, -0.08688046038150787, 0.07121910154819489, 0.09147566556930542, 0.016926392912864685, 0.1256639063358307, -0.09331314265727997, -0.22246749699115753, -0.009128233417868614, -0.18486520648002625, 0.30639803409576416, -0.4138405919075012, 0.11583073437213898, 0.12202353030443192, 0.2881748080253601, -0.006854534149169922, 0.011954404413700104, 0.16703003644943237, -0.2709476947784424, 0.09572230279445648, 0.39278414845466614, 0.058865003287792206, 0.0022226907312870026, 0.3353509306907654, 0.6731255650520325, 0.14518532156944275, 0.005373641848564148, 0.16247770190238953, -0.3677408695220947, -0.08513589948415756, 0.15284107625484467, -0.3771341145038605, -0.14247936010360718, 0.15233159065246582, 0.08572132140398026, 0.0692380964756012, -0.08438321948051453, 0.29624509811401367, 0.009451821446418762, -0.10073813050985336, -0.46781355142593384, 0.06357179582118988, 0.3194767236709595, 0.2779023051261902, 0.14893408119678497, -0.35486528277397156, 0.4865255355834961, 0.2813972234725952, -0.25720059871673584, -0.18795931339263916, 0.3906214237213135, 0.10032656788825989, 0.051351554691791534, 0.030069956555962563, -0.021066628396511078, 0.0819987803697586, 0.2914946377277374, 0.061109643429517746, 0.09233225882053375, 0.23761354386806488, -0.1530992090702057, 0.04118459299206734, 0.061397209763526917, -0.012448683381080627, -0.1235923171043396, 0.02676521986722946, 0.0041827671229839325, -0.3399942219257355, -0.20315314829349518, -0.26049184799194336, 0.20517981052398682, -0.20966973900794983, -0.04778791218996048, 0.04827076196670532, -0.3604885935783386, -0.15704800188541412, 0.08040539920330048, -0.043210405856370926, -0.3552241027355194, 0.2186119258403778, -0.08768065273761749, -0.21368807554244995, -0.029475519433617592, 0.03638620674610138, 0.5780830383300781, -0.18255051970481873, 0.14753086864948273, -0.062001634389162064, 0.0023825913667678833, 0.02143413946032524, 0.015693046152591705, 0.2528843581676483, 0.0900738537311554, 0.42810431122779846, -0.7599073648452759, 0.2570314407348633, -0.6589003205299377, -0.44315847754478455, 0.5164968967437744, 0.0385432094335556, -0.004700852558016777, 0.20486116409301758, 0.2982403039932251, 0.1559685617685318, -0.14251533150672913, -0.09363363683223724, 0.05421895533800125, -0.3447904586791992, -0.07996393740177155, 0.026182502508163452, -0.2331872582435608, -0.3735670745372772, -0.39978674054145813, -0.021798111498355865, -0.29788893461227417, 0.16066059470176697, 0.1722135841846466, 0.3473030626773834, 0.04194791242480278, -0.15426915884017944, 0.06642670184373856, -0.1849469542503357, 0.1690388321876526, -0.13154743611812592, -0.4852113723754883, 0.16917312145233154, -0.3268897235393524, -0.1867411732673645, -0.04827835410833359, -0.20601780712604523, -0.13038794696331024, -0.014570634812116623, -0.43518707156181335, -0.16288551688194275, -0.32671356201171875, 0.16937565803527832, 0.15539349615573883, 0.18720167875289917, 0.4840030372142792, 0.1624489724636078, -0.1472817063331604, 0.10747658461332321, -0.19402819871902466, -0.17202673852443695, 0.08505129814147949, 0.10374496132135391, -0.02329246699810028, 0.04114013537764549, -0.11910919845104218, 0.6001496315002441, 0.03206298500299454, 0.1507878452539444, -0.004173167049884796, -0.22489675879478455, 0.535537600517273, -0.14841055870056152, -0.029742661863565445, 0.015747420489788055, 0.10024263709783554, -0.16792090237140656, 0.3426661193370819, 0.3141738772392273, 0.1076011061668396, -0.0776267945766449, -0.05091458559036255, -0.34596988558769226, -0.2705523371696472, 0.04779406636953354, 0.06994318962097168, 0.16675253212451935, 0.17786920070648193, 0.18357183039188385, 0.01451161876320839, -0.04102962464094162, -0.000060852617025375366, 0.7014214992523193, 0.3012300133705139, 0.03003600612282753, -0.21387732028961182, 0.28425297141075134, -0.5628048777580261, -0.028200432658195496, 0.024647731333971024, -0.25579148530960083, -0.10854008793830872, -0.23258209228515625, 0.056427646428346634, 0.01503102108836174, 0.3179231584072113, -0.11006004363298416, -0.15390966832637787, -0.1421242356300354, -0.35177433490753174, 0.24969542026519775, 0.00912647694349289, 0.02341008186340332, 0.1476445496082306, 0.022949986159801483, 0.7447548508644104, -0.4556252956390381, -0.45509713888168335, 0.4525599181652069, 0.1957118809223175, -0.2886391580104828, -0.08688842505216599, -0.17550094425678253, -0.3107999563217163, -0.10857437551021576, -0.209255650639534, -0.01039176806807518, -0.14996260404586792, 0.062350980937480927, 0.09137466549873352, 0.1412869244813919, 0.23369021713733673, 0.11892780661582947, 0.37157416343688965, 0.2528078258037567, 0.1650971919298172, 0.06240968406200409, 0.7294909954071045, 0.4532146155834198, 0.33018583059310913, 0.6313202381134033, -0.4074835181236267, -0.2434837967157364, 0.044724538922309875, -0.1244698166847229, 0.393247127532959, 0.5258288979530334, -0.009724635630846024, -0.20252802968025208, 0.1172863319516182, 0.00916498526930809, -0.6129086017608643, 0.11278475821018219, -0.04315784573554993, -0.17619004845619202, -0.2620677351951599, -0.6412103772163391, 0.4878658354282379, 0.03680124878883362, -0.22973036766052246, 0.17744436860084534, 0.3633837401866913, -0.027284644544124603, 0.06766051054000854, -0.18510620296001434, 0.9303103685379028, -0.34686213731765747, 0.17197392880916595, 0.25350895524024963, -0.08414632081985474, 0.12816177308559418, -0.4807558059692383, -0.05769266560673714, -0.34841388463974, -0.028013557195663452, -0.1363019347190857, -0.03186232969164848, -0.2582169771194458, 0.043165192008018494, -0.14937712252140045, 0.3347136676311493, -0.07581290602684021, 0.2843623757362366, -0.1314004361629486, 0.48867809772491455, 0.11878425627946854, -0.23654651641845703, -0.07339281588792801, 0.12928324937820435, 0.03736317902803421, 0.2931239604949951, -0.00914078950881958, -0.14656367897987366, -0.12567128241062164, -0.2889958918094635, -0.13075359165668488, -0.2888447344303131, 0.11716663837432861, 0.1256471574306488, 0.347019761800766, -0.14732733368873596, -0.26605862379074097, 0.3478052318096161, 0.0977988988161087, 0.2493342012166977, -0.3703664541244507, -0.04690061882138252, -0.021317895501852036, 0.04801967740058899, 0.07048124819993973, -0.2025834023952484, 0.1064973846077919, 0.12207707017660141, -0.09570486843585968, -0.30484774708747864, -0.27750346064567566, -0.22212308645248413, -0.1499679833650589, 0.020533747971057892, -0.026348914951086044, -0.23120415210723877, -0.1317506730556488, 0.04486286640167236, -0.14756107330322266, -0.08302680402994156, 0.10693074017763138, 0.25673383474349976, 0.14600345492362976, -0.4020249843597412, 0.5745772123336792, -0.13543181121349335, -0.034707434475421906, 0.09075218439102173, -0.03169833868741989, -0.1783204823732376, -0.16242067515850067, -0.16279178857803345, -0.31183063983917236, -0.2238854020833969, 0.14564865827560425, 0.293417751789093, -0.06847313791513443, 0.06842440366744995, 0.08740219473838806, -0.014816835522651672, 0.002465061843395233, 0.17687709629535675, -0.07862929999828339, -0.28951361775398254, -0.11807577311992645, -0.1386713981628418, -0.2916896343231201, 0.2636635899543762, -0.21856524050235748, 0.2919539511203766, 0.18195289373397827, -0.18211053311824799, -0.1582680493593216, -0.02335336245596409, -0.36970847845077515, -0.14002637565135956, -0.28757375478744507, -0.13453646004199982, 0.1646038144826889, 0.4767991006374359, 0.22966784238815308, -0.2667297422885895, 0.046510063111782074, -0.27363064885139465, -0.18418161571025848, -0.1991765797138214, -0.03158368170261383, 0.13479778170585632, -0.14999425411224365, -0.02521415241062641, 0.21175993978977203, 0.16306737065315247, -0.03437553346157074, -0.38187992572784424, 0.3133598566055298, 0.2118791788816452, 0.21121060848236084, 0.23175249993801117, 0.050901077687740326, -0.06799007952213287, 0.1795804798603058, 0.3084096908569336, -0.01570906490087509, 0.4418787956237793, 0.0020145177841186523, -0.1460026353597641, -0.7249996066093445, -0.05657808482646942, 0.47816330194473267, 0.3827943801879883, 0.290562242269516, 0.28757426142692566, 0.05244622379541397, 0.1251828968524933, 0.21045099198818207, 0.23844251036643982, 0.09773381054401398, 0.06403301656246185, -0.36290499567985535, 0.16014742851257324, 0.11468060314655304, 0.20034721493721008, -0.2623831331729889, -0.21003369987010956, 0.2384597808122635, -0.06151675432920456, 0.1432303786277771, 0.2899874448776245, 0.28464874625205994, 0.03570680320262909, 0.03586431220173836, -0.006356723606586456, 0.18055254220962524, 0.06253586709499359, -0.12719818949699402, 0.1540098339319229, -0.04456814378499985, 0.22209477424621582, 0.20249482989311218, 0.14475272595882416, 0.12554733455181122, 0.2405930459499359, 0.0026889704167842865, 0.2332901656627655, 0.12235091626644135, 0.3260020315647125, 0.06112236529588699, -0.07647699862718582, 0.13774442672729492, 0.07341089099645615, 0.06733603030443192, -0.2534085512161255, 0.035524748265743256, 0.07328862696886063, 0.2189396768808365, 0.17168518900871277, -0.0630023255944252, -0.19645388424396515, -0.14975705742835999, 0.012631334364414215, 0.26580411195755005, -0.10747962445020676, 0.17971362173557281, -0.08645384013652802, -0.014457127079367638, -0.48051005601882935, 0.028556864708662033, -0.2442123293876648, 0.2861069142818451, -0.10202601552009583, 0.5188659429550171, 0.07431352138519287, 0.17306728661060333, -0.17013566195964813, -0.11139850318431854, -0.22235414385795593, 0.013119443319737911, 0.06389552354812622, 0.4556396007537842, 0.133768230676651, 0.3740905225276947, 0.305471271276474, -0.16260047256946564, -0.12111340463161469, -0.0591270849108696, -0.14237934350967407, -0.04442744702100754, -0.3117358386516571, -0.0975198894739151, 0.28635352849960327, 0.10197270661592484, -0.14637741446495056, 0.09742562472820282, 0.13752181828022003, -0.01999495178461075, 0.035981014370918274, -0.09473682194948196, -0.055563222616910934, -0.1205395758152008, -0.10829263180494308, 0.07728693634271622, -0.14307346940040588, -0.007843663915991783, 0.3638777732849121, 0.1599966287612915, 0.21663835644721985, -0.06817084550857544, 0.10903908312320709, 0.31785115599632263, 0.28603947162628174, 0.49387821555137634, 0.017952343448996544, -0.04771004244685173, -0.20515292882919312, -0.6347188353538513, -0.045788273215293884, -0.3792935609817505, -0.219782292842865, 0.17809835076332092, 0.2527485489845276, 0.11358769983053207, 0.2439926415681839, -0.10047613084316254, -0.21514083445072174, 0.008768323808908463, -0.27877992391586304, -0.13661928474903107, -0.4497314691543579, -0.03922837972640991, -0.031104637309908867, 0.02581655979156494, -0.25035420060157776, 0.1897275745868683, -0.17879121005535126, 0.03984146565198898, -0.23885449767112732, 0.44419676065444946, -0.001313522458076477, 0.07664424926042557, 0.10399918258190155, -0.14766241610050201, -0.07550743222236633, -0.2721317708492279, -0.2774782180786133, -0.19922317564487457, -0.02529950439929962, -0.075880266726017, 0.3593100905418396, -0.05651354044675827, -0.11654829978942871, -0.28624269366264343, -0.10092325508594513, -0.3586080074310303, -0.00556560605764389, 0.20846840739250183, 0.0392632894217968, -0.2072322517633438, 0.12236165255308151, 0.048479147255420685, -0.0787268579006195, 0.06939995288848877, -0.010862264782190323, -0.10501037538051605, -0.29369446635246277, 0.21783694624900818, -0.28090816736221313, 0.5382217168807983, 0.02191239595413208, 0.034749262034893036, 0.04951811954379082, 0.0597120001912117, 0.2647731900215149, 0.008093411102890968, -0.3543664216995239, 0.057448774576187134, 0.21832060813903809, -0.16173489391803741, -0.19921672344207764, 0.19352637231349945, -0.07396780699491501, 0.03219731152057648, -0.16533517837524414, 0.2933834195137024, 0.17099082469940186, -0.1314035952091217, -0.1444842517375946, -0.32738858461380005 ]
https://github.com/huggingface/datasets/issues/5971
@benjaminbrown038 Yes, it is. Maybe @stevhliu can give some pointers on improving this doc page's discoverability.
Docs: make "repository structure" easier to find
The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages.
16
Docs: make "repository structure" easier to find The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages. @benjaminbrown038 Yes, it is. Maybe @stevhliu can give some pointers on improving this doc page's discoverability.
[ -0.05660982429981232, 0.03940857946872711, -0.1552848368883133, 0.22599880397319794, 0.10666590929031372, 0.0058924853801727295, -0.18545351922512054, 0.4604344069957733, -0.10095638781785965, 0.3205561339855194, 0.030891314148902893, 0.16898559033870697, 0.09326285123825073, 0.1440245658159256, 0.4795737862586975, 0.05772528424859047, -0.060044385492801666, 0.32892584800720215, 0.27292388677597046, -0.1691301465034485, 0.0609842985868454, 0.028877241536974907, -0.0784202441573143, -0.04531840607523918, 0.08154040575027466, 0.1804763525724411, -0.22014181315898895, 0.29241710901260376, -0.4437292218208313, -0.30913302302360535, 0.11709131300449371, 0.3496450185775757, 0.081991046667099, 0.3375883400440216, -0.00010365178604843095, -0.14871487021446228, 0.0773904025554657, -0.011992882937192917, -0.45490896701812744, 0.06586921960115433, -0.340274840593338, -0.2534887492656708, -0.04860278218984604, -0.27915072441101074, -0.18305239081382751, 0.11050498485565186, 0.22256679832935333, 0.09828758239746094, -0.18152937293052673, 0.0006303377449512482, 0.27966970205307007, 0.3477756381034851, 0.23077429831027985, 0.12370122224092484, 0.3566068112850189, 0.425963431596756, -0.5681792497634888, 0.32482701539993286, 0.21415495872497559, 0.008013442158699036, -0.001827523112297058, 0.20233459770679474, -0.15184512734413147, -0.16835106909275055, 0.43948015570640564, 0.31623926758766174, 0.22658193111419678, -0.2563997209072113, -0.016024276614189148, 0.391643762588501, 0.6722391843795776, -0.3259146213531494, -0.13987377285957336, -0.2971620559692383, -0.15527404844760895, 0.10447527468204498, -0.1311386674642563, 0.19579707086086273, -0.025509223341941833, 0.30138689279556274, -0.2097024917602539, -0.6142026782035828, -0.011553972959518433, 0.026524679735302925, 0.21006101369857788, -0.02951325848698616, -0.08004333078861237, -0.2876899540424347, 0.2777636647224426, -0.10234306752681732, -0.1238623708486557, -0.042549945414066315, -0.0007361441385000944, 0.21050874888896942, 0.12245306372642517, -0.3031541705131531, 0.18965747952461243, 0.11727160215377808, 0.4749005436897278, 0.09174401313066483, 0.07773412019014359, 0.014621300622820854, -0.1274256706237793, 0.0796511098742485, 0.01932360976934433, 0.11980228126049042, -0.01705886423587799, 0.2151293158531189, 0.3346911370754242, 0.2797936201095581, 0.2099173367023468, -0.006080242805182934, -0.25478363037109375, -0.08355365693569183, -0.01769813522696495, -0.2463342696428299, 0.26909393072128296, -0.15188398957252502, -0.0014270618557929993, -0.17093347012996674, -0.21899329125881195, -0.22687241435050964, 0.14472870528697968, 0.2864540219306946, 0.31717509031295776, 0.03206319734454155, -0.16159431636333466, -0.10128094255924225, -0.3975018560886383, -0.08432671427726746, -0.13785648345947266, 0.2193661481142044, -0.08730790764093399, 0.19753646850585938, 0.0014647096395492554, -0.38244596123695374, 0.05245412141084671, -0.2665579319000244, 0.026119787245988846, -0.01804865151643753, -0.033067964017391205, 0.38017651438713074, 0.3548187017440796, 0.30428722500801086, 0.1195494681596756, -0.1928233653306961, 0.015697313472628593, -0.17211225628852844, -0.41494637727737427, -0.09861256927251816, -0.23606926202774048, -0.4110107421875, -0.14637188613414764, 0.21265839040279388, 0.16472816467285156, 0.008268252946436405, -0.23888720571994781, 0.296956330537796, 0.09410372376441956, -0.07603323459625244, 0.11490420997142792, 0.48107147216796875, -0.22227264940738678, -0.23753690719604492, 0.19894415140151978, 0.6126269698143005, 0.19877560436725616, -0.0508415512740612, 0.06821052730083466, -0.16653837263584137, -0.17129087448120117, 0.0471237413585186, -0.07121790200471878, 0.4194980263710022, -0.26575425267219543, 0.15623527765274048, 0.27986574172973633, -0.3699139654636383, -0.34983527660369873, 0.1795695573091507, -0.2343483567237854, 0.0006766095757484436, -0.03242010250687599, 0.0449383370578289, 0.11606031656265259, -0.3115767538547516, -0.19625979661941528, -0.20929382741451263, -0.18968583643436432, 0.20419487357139587, -0.15325087308883667, -0.09163808822631836, -0.12326657772064209, -0.11320410668849945, -0.017141254618763924, 0.28846651315689087, 0.00803009420633316, 0.05368475988507271, 0.33692798018455505, -0.10458646714687347, -0.013201089575886726, 0.3406890332698822, 0.5500690340995789, 0.012456394731998444, 0.032624538987874985, -0.09218575060367584, -0.4710770845413208, -0.11751703917980194, 0.3627777099609375, 0.08372128009796143, 0.04779136925935745, -0.4145675003528595, -0.1023467630147934, -0.18805241584777832, -0.01706073060631752, -0.10055360943078995, 0.15506574511528015, -0.0772944837808609, 0.12169268727302551, -0.10098738968372345, -0.22693032026290894, -0.03361989185214043, -0.07293669134378433, 0.3089474141597748, -0.45922839641571045, 0.18875831365585327, 0.089510977268219, 0.25714626908302307, 0.12002448737621307, 0.1473211646080017, 0.12710091471672058, -0.24705921113491058, 0.16644662618637085, 0.2575942873954773, 0.055842265486717224, -0.06502930819988251, 0.2334900200366974, 0.6606752872467041, 0.24429063498973846, -0.10871932655572891, 0.1465696096420288, -0.30964234471321106, -0.10328691452741623, -0.01694846898317337, -0.15664269030094147, -0.10534071922302246, 0.10684443265199661, 0.09655424952507019, 0.20406147837638855, 0.13168296217918396, 0.23665529489517212, -0.08061062544584274, -0.1859252154827118, -0.2981298565864563, 0.09184864908456802, 0.12374596297740936, 0.2175774872303009, 0.010306242853403091, -0.21092939376831055, 0.5631033778190613, 0.10227780044078827, -0.2718486189842224, -0.04650245979428291, 0.4293610453605652, 0.04836089164018631, 0.015413336455821991, -0.15713247656822205, -0.033951714634895325, 0.014843523502349854, 0.2511063516139984, 0.1872839331626892, 0.1804746836423874, 0.24460361897945404, 0.0010828673839569092, 0.13307946920394897, 0.07534267008304596, -0.015471907332539558, -0.18806593120098114, -0.0021816007792949677, 0.14444401860237122, -0.3046438992023468, -0.08525204658508301, -0.28663185238838196, 0.19758489727973938, -0.3222300410270691, 0.02247125655412674, 0.13088467717170715, -0.23365263640880585, -0.05771519988775253, -0.03873281553387642, 0.020518139004707336, -0.29303255677223206, 0.17410212755203247, -0.12587490677833557, -0.03119926154613495, 0.011895693838596344, 0.019985921680927277, 0.5935896635055542, -0.18325692415237427, 0.2388847917318344, -0.04518834128975868, -0.019922493025660515, 0.03688067942857742, 0.08237385749816895, 0.27872058749198914, 0.11736369878053665, 0.5337480902671814, -0.6603465676307678, 0.24659714102745056, -0.8284757137298584, -0.5493700504302979, 0.5296372771263123, -0.04387116804718971, -0.10544169694185257, 0.39467525482177734, 0.22884124517440796, -0.03853683918714523, -0.050456441938877106, -0.1695200353860855, -0.17281092703342438, -0.34083420038223267, -0.07008150219917297, -0.051600825041532516, -0.3479856550693512, -0.3003252148628235, -0.3488869369029999, 0.10027125477790833, -0.24888718128204346, 0.09445732831954956, 0.20928825438022614, 0.22397148609161377, -0.026620961725711823, -0.17424845695495605, -0.010042127221822739, -0.06383522599935532, 0.1543973684310913, -0.14490725100040436, -0.33476653695106506, 0.15048640966415405, -0.3320503234863281, -0.192055806517601, -0.07002955675125122, -0.19757361710071564, -0.0032350264955312014, -0.013823900371789932, -0.2818795442581177, -0.03136612847447395, -0.21962596476078033, 0.015140600502490997, 0.24141332507133484, 0.23305486142635345, 0.3539429008960724, 0.16180919110774994, -0.1031867265701294, 0.12888720631599426, -0.1809144914150238, -0.13745513558387756, 0.06808213889598846, 0.2563839256763458, -0.06511956453323364, 0.059165287762880325, -0.06713596731424332, 0.5099904537200928, 0.15421229600906372, 0.13732565939426422, -0.08878811448812485, -0.3069443106651306, 0.4748345911502838, 0.06817641854286194, -0.12459605187177658, 0.08097147941589355, 0.06254611909389496, -0.19032403826713562, 0.3037639558315277, 0.38804662227630615, -0.02416675165295601, 0.02721073478460312, -0.14855876564979553, -0.3478217124938965, -0.3130357265472412, -0.0947965681552887, -0.015447709709405899, 0.21227319538593292, 0.21878746151924133, 0.10008973628282547, -0.03903152793645859, 0.0018521696329116821, 0.062266476452350616, 0.6387028098106384, 0.28581926226615906, -0.03290466219186783, -0.16949769854545593, 0.4209657609462738, -0.6882840394973755, -0.08863955736160278, -0.016216706484556198, -0.41877859830856323, -0.0015709251165390015, -0.10863277316093445, -0.023950956761837006, -0.10041455179452896, 0.38253653049468994, -0.14086289703845978, -0.20384424924850464, 0.05424439162015915, -0.26637256145477295, 0.25053465366363525, 0.09733715653419495, 0.0004645213484764099, 0.12177357077598572, 0.17909835278987885, 0.4269087314605713, -0.4883425235748291, -0.24720385670661926, 0.4812241792678833, -0.026224782690405846, -0.19815325736999512, 0.033855635672807693, -0.153309166431427, -0.5423569679260254, -0.018377825617790222, -0.1665356457233429, 0.01959732174873352, -0.21802526712417603, 0.14077073335647583, -0.011108219623565674, 0.18154440820217133, 0.15882053971290588, 0.14723721146583557, 0.3530765473842621, 0.37063726782798767, -0.00767550989985466, 0.18969276547431946, 0.7164774537086487, 0.256866991519928, 0.3202575147151947, 0.5360461473464966, -0.34802624583244324, -0.18490561842918396, 0.017042260617017746, -0.09659914672374725, 0.38064441084861755, 0.4257480204105377, 0.08329044282436371, -0.2871835231781006, 0.014226607978343964, -0.024259772151708603, -0.5190608501434326, -0.1550787091255188, 0.17547807097434998, -0.1504421830177307, -0.43858209252357483, -0.6949371099472046, 0.4225028455257416, 0.11776714026927948, -0.13509969413280487, 0.15260520577430725, 0.6516661047935486, -0.08916880935430527, -0.07016769051551819, 0.018641553819179535, 0.9509751796722412, -0.2642657160758972, 0.18134663999080658, 0.4826374650001526, -0.16623488068580627, 0.07671649754047394, -0.5019407272338867, -0.03568487614393234, -0.46848076581954956, 0.032746609300374985, -0.16773243248462677, -0.08103694021701813, -0.3063620328903198, 0.005738772451877594, -0.28910040855407715, 0.31667253375053406, -0.19337117671966553, 0.30023354291915894, -0.11378201097249985, 0.33735769987106323, 0.16841857135295868, -0.09802074730396271, 0.028921328485012054, 0.17506009340286255, 0.15421834588050842, 0.21050052344799042, -0.12631922960281372, -0.20996512472629547, -0.10678315907716751, -0.28183454275131226, -0.34372478723526, -0.28508636355400085, 0.21949389576911926, 0.05611671879887581, 0.4542215168476105, -0.00969378650188446, 0.02211815118789673, 0.18741263449192047, 0.17826300859451294, 0.16757358610630035, -0.3372000753879547, 0.11722176522016525, 0.1809408813714981, 0.022419389337301254, 0.19660314917564392, -0.12312089651823044, -0.016157686710357666, 0.11212242394685745, -0.06680632382631302, -0.3254506587982178, -0.1616416573524475, -0.2025972604751587, -0.21208414435386658, -0.005303077399730682, 0.03893253952264786, -0.20918716490268707, -0.06227435916662216, 0.22570377588272095, -0.27820703387260437, -0.21191799640655518, 0.16085591912269592, 0.1644333302974701, 0.19283998012542725, -0.3421110212802887, 0.5992843508720398, 0.009337469935417175, 0.059313733130693436, -0.0018528811633586884, -0.014451539143919945, -0.11453893780708313, -0.20486944913864136, -0.09764736890792847, -0.4382632374763489, -0.3313707113265991, 0.10844871401786804, 0.2022092342376709, -0.013300150632858276, 0.10569961369037628, 0.003738824278116226, -0.026272818446159363, 0.1698351502418518, 0.21804536879062653, -0.06728087365627289, -0.18731722235679626, -0.23728029429912567, 0.04063459485769272, -0.006586980074644089, 0.18614248931407928, -0.1418992131948471, 0.29797226190567017, 0.011346466839313507, -0.226661816239357, -0.21458560228347778, 0.035473957657814026, -0.40794169902801514, -0.1646784543991089, -0.1974981129169464, -0.2894401550292969, 0.12366599589586258, 0.40800949931144714, 0.046742554754018784, -0.40355002880096436, 0.10006780922412872, -0.1537245362997055, -0.12121722847223282, -0.2558281421661377, -0.058265648782253265, 0.1106792688369751, -0.19557783007621765, -0.18336588144302368, 0.3434062898159027, 0.2929645776748657, -0.2782880663871765, -0.36714592576026917, 0.14828014373779297, 0.26652342081069946, 0.25637251138687134, 0.015073105692863464, -0.022633738815784454, -0.21543653309345245, 0.11817675828933716, 0.2787798047065735, 0.006750717759132385, 0.4237758219242096, 0.13600678741931915, -0.12822046875953674, -0.5903525948524475, -0.051713041961193085, 0.4532257318496704, 0.4689723551273346, 0.31737831234931946, 0.21211625635623932, 0.16539892554283142, 0.06425288319587708, 0.18322211503982544, 0.1564483791589737, 0.13502921164035797, 0.2233617901802063, -0.41261225938796997, 0.19289357960224152, -0.003347337245941162, 0.22065651416778564, -0.2450844794511795, -0.1848536729812622, 0.1733425408601761, -0.09075039625167847, 0.16235411167144775, 0.3219948410987854, 0.12551602721214294, 0.011042207479476929, -0.1693926453590393, -0.06112650781869888, 0.3771953284740448, -0.07101550698280334, -0.012109793722629547, 0.08471596986055374, -0.0464661531150341, 0.0829710066318512, 0.18995632231235504, 0.10305696725845337, 0.05482738837599754, 0.13837704062461853, 0.18619900941848755, 0.29174166917800903, 0.13871179521083832, 0.32068800926208496, 0.048513446003198624, 0.22484810650348663, 0.12930260598659515, 0.142828106880188, 0.06466012448072433, -0.26079848408699036, 0.12912237644195557, -0.0909743532538414, 0.2891243100166321, 0.09728413820266724, -0.15295517444610596, -0.06893031299114227, -0.040269557386636734, 0.07940195500850677, 0.3429045081138611, -0.09239441156387329, 0.2630389332771301, -0.18163010478019714, -0.05034050717949867, -0.44484227895736694, -0.01836112141609192, -0.1557832658290863, 0.44773876667022705, -0.14114658534526825, 0.5276249647140503, -0.11648383736610413, 0.26236552000045776, -0.13531358540058136, -0.15900985896587372, -0.2647903859615326, 0.07801485061645508, -0.13944987952709198, 0.4960708022117615, 0.22748857736587524, 0.2843187749385834, 0.15855169296264648, -0.22471599280834198, -0.2026020735502243, -0.01444728672504425, -0.03525032848119736, -0.08053364604711533, -0.21885377168655396, -0.26757174730300903, 0.1258588433265686, 0.12370362877845764, -0.18421657383441925, 0.10951384902000427, 0.21956956386566162, -0.10714635252952576, 0.09042347222566605, -0.12104379385709763, -0.28796231746673584, -0.024764634668827057, -0.1803271472454071, 0.07080520689487457, -0.061355359852313995, 0.021841835230588913, 0.33324459195137024, 0.020111195743083954, 0.21935194730758667, -0.037930142134428024, 0.1285650134086609, 0.4497200846672058, 0.3512672185897827, 0.3756357431411743, -0.037224460393190384, 0.06366756558418274, -0.23367434740066528, -0.5817906856536865, 0.021348003298044205, -0.4719603955745697, -0.3717430531978607, 0.16483338177204132, 0.2571278214454651, 0.08039985597133636, 0.17285393178462982, 0.019480012357234955, -0.2410546988248825, -0.09680388867855072, -0.3115657866001129, -0.12161731719970703, -0.25516432523727417, 0.02709183841943741, -0.01994791440665722, -0.09297788143157959, -0.2193913757801056, 0.15848618745803833, -0.16802337765693665, 0.06783154606819153, -0.15782518684864044, 0.5117437243461609, -0.07773130387067795, 0.10852484405040741, -0.00019123591482639313, -0.21827568113803864, -0.00022724643349647522, -0.289431095123291, -0.3904900550842285, -0.17876151204109192, 0.014660019427537918, 0.010754954069852829, 0.38259395956993103, 0.02397279441356659, -0.22030934691429138, -0.21217530965805054, -0.12278589606285095, -0.31974542140960693, -0.06669115275144577, 0.24669548869132996, 0.1658955067396164, -0.46613943576812744, 0.258714884519577, 0.22269585728645325, -0.09746366739273071, -0.019138697534799576, 0.04077751934528351, -0.27445337176322937, -0.23206578195095062, 0.1689067929983139, -0.23846518993377686, 0.6202187538146973, 0.0999239832162857, 0.04658373445272446, 0.05931792035698891, 0.10335896164178848, 0.31320011615753174, -0.13857270777225494, -0.2961839735507965, -0.03606293350458145, 0.130479097366333, -0.1128804087638855, -0.286429762840271, 0.2534443140029907, 0.02378520742058754, 0.014029055833816528, -0.10311076045036316, 0.4179480969905853, 0.01451142132282257, -0.04605131968855858, 0.030182860791683197, -0.2205115705728531 ]
https://github.com/huggingface/datasets/issues/5971
I think we can add a version of the [Main use-case](https://huggingface.co/docs/datasets/repository_structure#main-usecase) section to the [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset) tutorial. Currently, it doesn't tell you *how* to structure the repository; it only tells you how to create it. So adding the "main use-case" will help bridge the gap and make it easier to find. We should also add a link to the [Structure your repository](https://huggingface.co/docs/datasets/repository_structure) guide for users who want to learn about the other options.
Docs: make "repository structure" easier to find
The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages.
77
Docs: make "repository structure" easier to find The page https://huggingface.co/docs/datasets/repository_structure explains how to create a simple repository structure without a dataset script. It's the simplest way to create a dataset and should be easier to find, particularly on the docs' first pages. I think we can add a version of the [Main use-case](https://huggingface.co/docs/datasets/repository_structure#main-usecase) section to the [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset) tutorial. Currently, it doesn't tell you *how* to structure the repository; it only tells you how to create it. So adding the "main use-case" will help bridge the gap and make it easier to find. We should also add a link to the [Structure your repository](https://huggingface.co/docs/datasets/repository_structure) guide for users who want to learn about the other options.
[ -0.022013843059539795, -0.17372795939445496, -0.025757355615496635, 0.12676502764225006, 0.11845462024211884, 0.15033085644245148, -0.09882107377052307, 0.09547268599271774, -0.17971496284008026, 0.3140157461166382, 0.13280057907104492, 0.15143832564353943, 0.1374928504228592, 0.28451210260391235, 0.23392951488494873, -0.04413533955812454, 0.030300438404083252, 0.238870769739151, 0.2159000188112259, -0.012626826763153076, 0.15005934238433838, 0.02570650912821293, -0.059963978826999664, -0.0509510301053524, -0.19393792748451233, 0.04043686389923096, -0.1920853853225708, 0.346407413482666, -0.24061483144760132, -0.48443126678466797, 0.21912285685539246, 0.309439480304718, 0.14428742229938507, 0.2922142744064331, -0.0001085035692085512, -0.16301053762435913, 0.0707547664642334, -0.129899799823761, -0.4333961308002472, -0.1578936129808426, -0.28169408440589905, -0.06084572523832321, 0.20896252989768982, -0.11086514592170715, -0.09574257582426071, 0.3095284104347229, 0.36340630054473877, 0.176788330078125, -0.0003292672336101532, -0.06512108445167542, 0.2073836624622345, 0.35271698236465454, 0.1689276546239853, -0.25449883937835693, 0.047623246908187866, 0.3297334909439087, -0.5399630069732666, 0.6020947694778442, 0.45399218797683716, 0.14028170704841614, -0.01631876826286316, 0.2778407335281372, 0.10156895965337753, -0.13141967356204987, 0.45991602540016174, 0.13277962803840637, -0.10895858705043793, -0.2579279839992523, -0.0617816187441349, 0.20222359895706177, 0.559013843536377, -0.29757699370384216, -0.21926826238632202, -0.357207715511322, 0.03705878183245659, 0.09690079092979431, -0.1832941472530365, 0.17714644968509674, -0.01770610734820366, 0.3599477708339691, -0.20548948645591736, -0.5314760208129883, -0.06291626393795013, 0.23576973378658295, 0.3782069981098175, -0.003724627196788788, -0.15556049346923828, -0.047623906284570694, 0.3224864900112152, -0.18478946387767792, -0.13915805518627167, -0.08427492529153824, 0.11777052283287048, 0.045411791652441025, 0.1691206842660904, -0.2532811164855957, 0.2754683792591095, 0.3112889528274536, 0.4202941060066223, 0.13206717371940613, -0.037770770490169525, 0.03507812321186066, -0.02454836294054985, 0.15994027256965637, 0.07732093334197998, -0.019164957106113434, 0.12387607991695404, 0.10047165304422379, 0.3440468907356262, 0.3024366497993469, 0.32601988315582275, -0.15221524238586426, -0.25200000405311584, 0.0855402797460556, -0.20738202333450317, -0.19497357308864594, 0.2820081412792206, -0.10006162524223328, -0.041987620294094086, -0.4808026850223541, 0.010167114436626434, -0.06257166713476181, 0.24541929364204407, 0.1952078938484192, 0.3130756616592407, 0.025431174784898758, -0.29218941926956177, 0.07493574917316437, -0.15947680175304413, -0.051400355994701385, -0.15015549957752228, 0.1520012766122818, -0.19251631200313568, 0.420884907245636, 0.15011605620384216, -0.501567542552948, 0.19125622510910034, -0.007188916206359863, 0.18157732486724854, -0.07138411700725555, -0.009420417249202728, 0.24244444072246552, 0.07069887220859528, 0.16975592076778412, -0.05163757875561714, 0.03090851753950119, -0.024812500923871994, -0.09272363781929016, -0.38139820098876953, -0.2775613069534302, -0.5353763699531555, -0.5192666053771973, -0.336090087890625, 0.1468224674463272, 0.20781946182250977, 0.03749920427799225, -0.3679702579975128, 0.31982287764549255, -0.22182399034500122, 0.018091708421707153, 0.0165066197514534, 0.5832975506782532, -0.0688854455947876, -0.24373403191566467, 0.16258680820465088, 0.6091050505638123, 0.30301132798194885, -0.16031266748905182, -0.045649051666259766, -0.019893450662493706, -0.17896462976932526, -0.04137649014592171, -0.2825269103050232, 0.4326821267604828, -0.3540913462638855, 0.22280403971672058, 0.3623679280281067, -0.7067705988883972, -0.29205322265625, 0.16019824147224426, -0.2785227596759796, -0.12354118376970291, -0.016147255897521973, 0.11219620704650879, 0.09484557807445526, -0.2923913300037384, -0.17446164786815643, -0.03668925166130066, -0.16519410908222198, 0.2596329152584076, -0.00751224160194397, -0.22847682237625122, -0.1835487186908722, -0.007244527339935303, -0.37397682666778564, 0.2457742691040039, 0.07689560204744339, 0.1946273297071457, 0.10898652672767639, -0.12456832826137543, -0.007870946079492569, 0.17391934990882874, 0.4740650951862335, 0.0012508369982242584, -0.1582457423210144, -0.07265125215053558, -0.4774227738380432, 0.03033073991537094, 0.2637900710105896, 0.010335231199860573, -0.11206400394439697, -0.5108380913734436, -0.34285834431648254, -0.32155218720436096, -0.047540534287691116, -0.16833752393722534, 0.10687477886676788, -0.21567469835281372, 0.18308193981647491, -0.07584894448518753, -0.13584043085575104, 0.1604459583759308, -0.16963674128055573, 0.44785556197166443, -0.4935031533241272, 0.2706294357776642, -0.02508135512471199, 0.06908078491687775, 0.17097027599811554, 0.13345500826835632, 0.22023800015449524, -0.15319742262363434, 0.07181622087955475, 0.4868411421775818, -0.10343438386917114, 0.26515817642211914, 0.20505714416503906, 0.6089350581169128, 0.2629965841770172, 0.01860429346561432, -0.005531162954866886, -0.389423131942749, -0.10998468101024628, 0.19313417375087738, -0.44369298219680786, -0.09546755254268646, 0.15123040974140167, 0.11229094862937927, 0.17191757261753082, 0.13408008217811584, 0.03698396682739258, -0.03984036669135094, -0.18962788581848145, -0.3191349506378174, -0.13716721534729004, 0.11684591323137283, 0.09049439430236816, -0.037833355367183685, -0.29498907923698425, 0.5033541321754456, 0.3931441605091095, -0.15525567531585693, 0.1222342774271965, 0.38344064354896545, -0.003488108515739441, 0.1067885234951973, 0.2609154284000397, -0.10475872457027435, 0.03667943924665451, 0.21111507713794708, 0.11332722008228302, 0.10822072625160217, 0.09240440279245377, -0.14077433943748474, 0.09085848182439804, 0.10238917171955109, 0.04721832275390625, -0.3527800738811493, 0.013720180839300156, 0.07274561375379562, -0.11178915202617645, -0.20039954781532288, -0.3363645374774933, 0.08654353022575378, -0.29046937823295593, 0.011188872158527374, 0.002140052616596222, -0.16324767470359802, -0.03355463221669197, -0.07032398879528046, 0.025406047701835632, -0.3579263985157013, 0.1767583191394806, 0.16823247075080872, -0.1222083792090416, 0.010234035551548004, 0.03360418975353241, 0.42836666107177734, -0.24447354674339294, 0.3793516457080841, -0.08968627452850342, 0.11924244463443756, -0.00689093628898263, 0.06692363321781158, 0.27971991896629333, 0.20599046349525452, 0.4685063064098358, -0.6191545128822327, 0.2827128469944, -0.6539961695671082, -0.5511394739151001, 0.37608015537261963, 0.003173992969095707, -0.007564490661025047, 0.34193041920661926, 0.13107962906360626, -0.21186809241771698, -0.3895002007484436, -0.11349140107631683, -0.10586568713188171, -0.20198090374469757, -0.10290884971618652, -0.1000179797410965, -0.19045259058475494, -0.21888138353824615, -0.3783336579799652, 0.0653916671872139, -0.5057642459869385, 0.22748848795890808, -0.04282882809638977, 0.2512528896331787, -0.04819362983107567, 0.005165889859199524, 0.13408413529396057, -0.42157554626464844, 0.16109943389892578, -0.09802597761154175, -0.5900623798370361, 0.11010383069515228, -0.46863871812820435, -0.08917698264122009, 0.10426472127437592, -0.10660992562770844, 0.10932846367359161, -0.2132594734430313, -0.2462312877178192, -0.3545653820037842, -0.1868264377117157, 0.23122920095920563, 0.1371927112340927, 0.3456256687641144, 0.29717475175857544, 0.08585520088672638, -0.015924125909805298, 0.19361984729766846, -0.12390543520450592, -0.2068653255701065, 0.13887456059455872, 0.14370281994342804, -0.018772415816783905, -0.012506780214607716, 0.04594936966896057, 0.6105450391769409, 0.3092345595359802, 0.06567634642124176, -0.034378405660390854, 0.027457254007458687, 0.4548443555831909, -0.10972731560468674, -0.14047843217849731, 0.1754665970802307, 0.09732916206121445, 0.26144227385520935, 0.3148646354675293, 0.4601324796676636, 0.3443549871444702, 0.14080563187599182, -0.2145242989063263, -0.3156042695045471, -0.36479324102401733, -0.0674608126282692, -0.07787992805242538, 0.17918415367603302, -0.053518179804086685, 0.028982356190681458, -0.07193074375391006, 0.059113599359989166, 0.00073222815990448, 0.5912654995918274, 0.2683461010456085, 0.077386274933815, -0.24746550619602203, 0.12826085090637207, -0.558310329914093, -0.06269305944442749, -0.08311943709850311, -0.25876495242118835, -0.07324466109275818, -0.002590075135231018, 0.015555553138256073, 0.08216274529695511, 0.37114769220352173, -0.1241002157330513, -0.29176315665245056, -0.18013057112693787, -0.25739312171936035, 0.004670374095439911, 0.28404560685157776, 0.03475718945264816, 0.3529404401779175, 0.11579690873622894, 0.5739747285842896, -0.6456438302993774, -0.40376409888267517, 0.4006926417350769, -0.01071581244468689, 0.02553796023130417, 0.06283169239759445, 0.0710441917181015, -0.3865683078765869, -0.34975171089172363, -0.035314612090587616, 0.1409396231174469, -0.13229693472385406, 0.012926004827022552, -0.056672852486371994, 0.21077096462249756, 0.22914886474609375, 0.12427878379821777, 0.28855448961257935, 0.3823992609977722, 0.19724874198436737, 0.08392928540706635, 0.5912724733352661, 0.12777386605739594, 0.38883012533187866, 0.4367889165878296, -0.027488579973578453, -0.06254662573337555, 0.18060868978500366, 0.048457611352205276, 0.3845486044883728, 0.46092528104782104, 0.12680701911449432, 0.032678231596946716, -0.05937787517905235, 0.1642264723777771, -0.5947578549385071, -0.006596993654966354, 0.13096556067466736, -0.02671564742922783, -0.34691861271858215, -0.27875471115112305, 0.4421466290950775, 0.18079589307308197, -0.15538987517356873, 0.11305584013462067, 0.6324248909950256, -0.186588317155838, -0.09066106379032135, -0.11299958825111389, 0.992913007736206, -0.011919589713215828, 0.39186084270477295, 0.14369507133960724, -0.21615299582481384, 0.25599002838134766, -0.31488993763923645, -0.22996869683265686, -0.22131675481796265, 0.058702580630779266, -0.14381426572799683, -0.06263471394777298, -0.05488560348749161, -0.04976796731352806, -0.5112789273262024, 0.35250088572502136, -0.18888671696186066, 0.44381970167160034, -0.1145973727107048, 0.4621618688106537, -0.1930197924375534, -0.3535059988498688, -0.10520746558904648, 0.15494927763938904, 0.2012089341878891, 0.07601355016231537, -0.04453524947166443, -0.1568724364042282, -0.20746435225009918, -0.1931200623512268, -0.20885105431079865, -0.25829410552978516, 0.1267288625240326, 0.04801565408706665, 0.23392194509506226, 0.05033320188522339, 0.25931158661842346, 0.2103090137243271, 0.3640223741531372, 0.2532718777656555, -0.5078848600387573, 0.035377033054828644, -0.19767439365386963, -0.14817781746387482, -0.05604627728462219, -0.2111823409795761, 0.08370642364025116, 0.003161109983921051, -0.16534963250160217, -0.14373400807380676, -0.050839923322200775, -0.09677521139383316, -0.4009841978549957, -0.15535931289196014, -0.0724131390452385, -0.38371896743774414, -0.19645336270332336, 0.09757199883460999, -0.21856802701950073, -0.2540184259414673, 0.10899937897920609, 0.2479453980922699, 0.10446056723594666, -0.3421439826488495, 0.4677015542984009, 0.1371220052242279, -0.1040199026465416, -0.02527967095375061, -0.17222854495048523, -0.22653067111968994, -0.11849556863307953, -0.17044536769390106, -0.20682676136493683, -0.20567281544208527, 0.13050027191638947, 0.34000080823898315, -0.18894469738006592, 0.06146799027919769, 0.07831612229347229, -0.1096537709236145, -0.033796440809965134, 0.04056819528341293, -0.09298115223646164, -0.22338606417179108, -0.19082024693489075, 0.05408008396625519, -0.29375147819519043, 0.36571449041366577, 0.029421454295516014, 0.22239620983600616, -0.21802467107772827, 0.05827301740646362, -0.019299227744340897, 0.11084149777889252, -0.378274142742157, 0.0554664209485054, -0.3421834707260132, -0.10562407970428467, 0.11199505627155304, 0.29159966111183167, 0.11207640171051025, -0.3344559669494629, 0.018034934997558594, -0.10848528146743774, -0.16379161179065704, -0.18742792308330536, -0.1627056747674942, 0.13012921810150146, -0.03133893758058548, -0.11748628318309784, 0.34726738929748535, 0.20801469683647156, 0.024035997688770294, -0.28813034296035767, 0.34572792053222656, 0.297394722700119, 0.3041013181209564, 0.16369028389453888, 0.15147510170936584, 0.08375611901283264, 0.22263799607753754, 0.11339768767356873, 0.1798442155122757, 0.45095890760421753, 0.05950888246297836, -0.04292413592338562, -0.568636417388916, -0.08729366958141327, 0.37819284200668335, 0.4033965468406677, 0.4979574382305145, 0.16764943301677704, 0.12805749475955963, 0.3938952088356018, -0.016671806573867798, 0.07626068592071533, -0.006300441920757294, -0.14427544176578522, -0.29184985160827637, 0.16826623678207397, 0.14012813568115234, 0.17707490921020508, -0.00481954962015152, -0.12149564921855927, 0.18742188811302185, -0.2112695276737213, 0.21915307641029358, 0.2352897822856903, 0.2547180950641632, 0.1641264706850052, -0.14356285333633423, -0.05104527994990349, 0.2873705327510834, 0.10047999024391174, 0.2926805317401886, 0.05488011986017227, -0.16010351479053497, 0.10952569544315338, 0.2761475443840027, 0.005060708150267601, 0.2365366518497467, -0.14719457924365997, 0.06633581221103668, 0.6450892090797424, -0.023071056231856346, 0.07908247411251068, 0.4300100803375244, 0.2016495168209076, 0.054571423679590225, 0.08427976071834564, 0.14976826310157776, -0.2236640453338623, -0.03789915516972542, 0.12364908307790756, 0.05137763172388077, -0.14955675601959229, 0.044237226247787476, -0.00796105433255434, -0.030445296317338943, -0.12439824640750885, 0.24896565079689026, -0.0699729174375534, -0.04210282862186432, -0.2689933776855469, -0.12497366964817047, -0.5708935856819153, 0.23689427971839905, -0.3313542306423187, 0.2570505142211914, -0.1528124362230301, 0.3893387019634247, 0.17848612368106842, 0.30813801288604736, 0.07347461581230164, -0.02752053551375866, -0.1585090309381485, 0.004464328289031982, -0.13046354055404663, 0.5101006627082825, 0.3391340672969818, 0.08999568223953247, 0.22153858840465546, 0.025725699961185455, 0.18444150686264038, -0.023932132869958878, 0.020687449723482132, -0.13192084431648254, -0.2786632776260376, -0.16811828315258026, 0.004739459604024887, 0.1604781150817871, -0.2465692013502121, -0.018139507621526718, -0.12447045743465424, -0.14535732567310333, -0.14802028238773346, -0.004889916628599167, -0.297698050737381, -0.18480491638183594, 0.12310568988323212, 0.215359628200531, -0.15016937255859375, 0.07755009829998016, 0.4357050657272339, -0.07353075593709946, -0.02872219868004322, -0.2951785624027252, 0.10662795603275299, 0.5141807794570923, 0.29497382044792175, 0.3489455580711365, 0.058907367289066315, -0.12813566625118256, -0.32998090982437134, -0.4257943332195282, -0.019659802317619324, -0.36839014291763306, -0.14042559266090393, 0.1712845265865326, 0.115780770778656, 0.013967026025056839, 0.15485422313213348, -0.008824437856674194, -0.15607509016990662, -0.07175386697053909, -0.3229944109916687, -0.10060349106788635, -0.24146142601966858, -0.011616379022598267, -0.06420451402664185, 0.021664880216121674, -0.09799116104841232, 0.13026544451713562, -0.022617164999246597, -0.023523636162281036, -0.21912409365177155, 0.535742998123169, 0.15173935890197754, -0.16973552107810974, 0.12726110219955444, -0.046844013035297394, -0.1116081103682518, -0.25819331407546997, -0.46220698952674866, -0.23571337759494781, -0.17001518607139587, -0.0070619136095047, 0.07077229022979736, -0.08950631320476532, 0.018487147986888885, -0.330763578414917, -0.31174540519714355, -0.3057521879673004, -0.14731261134147644, 0.1385098099708557, 0.04282953217625618, -0.12519997358322144, 0.34459012746810913, 0.07867810130119324, -0.08423727005720139, 0.09332820028066635, 0.19736725091934204, -0.31973305344581604, -0.1326742172241211, 0.07821276783943176, -0.344588965177536, 0.38759496808052063, 0.1948511302471161, 0.011797353625297546, 0.13492557406425476, 0.07016057521104813, 0.13128501176834106, -0.06845736503601074, -0.4847896993160248, 0.01697687804698944, 0.1077817976474762, 0.005063032731413841, -0.17939899861812592, 0.32927748560905457, 0.10717232525348663, -0.1426040083169937, -0.07855047285556793, 0.43144601583480835, 0.13321903347969055, -0.12522830069065094, 0.24167169630527496, -0.21517020463943481 ]
https://github.com/huggingface/datasets/issues/5970
Here's a minimal way to reproduce the bug, for the sake of convenience. ```` from datasets import Dataset, DatasetInfo, load_dataset episodes_dict = {"test":[1,2,3],"test2": [1,2,4]} hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description="test_str") ) print(hugging_face_dataset.info) hugging_face_dataset.push_to_hub("balisujohn/minari_test", private=True) redownloaded_dataset= load_dataset("balisujohn/minari_test")["train"] print(redownloaded_dataset.info) ````
description disappearing from Info when Uploading a Dataset Created with `from_dict`
### Describe the bug When uploading a dataset created locally using `from_dict` with a specified `description` field. It appears before upload, but is missing after upload and re-download. ### Steps to reproduce the bug I think the most relevant pattern in the code might be the following lines: ``` description_json_str = json.dumps( { "dataset_id": dataset.spec.dataset_id, "env_name": dataset.spec.env_spec.id, "action_space": serialize_space(dataset.spec.action_space), "observation_space": serialize_space(dataset.spec.observation_space), } ) hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description=description_json_str) ) ``` Which comes from this function https://github.com/balisujohn/minarai/blob/8e023727f0a8488c4451651d9f7a79b981412c40/minari/integrations/hugging_face.py#L39 To replicate, clone this branch of my Minari fork https://github.com/balisujohn/minarai/tree/dev-huggingface then run ``` python3.8 -m venv env source env/bin/activate python3 -m pip install -e . python3 -m pip install pytest ``` The change the hugging face repo path in the test called `test_hugging_face_push_and_pull_dataset` in `tests/integrations/test_hugging_face.py` to one you have permissions to write to. Then run: ``` pytest tests/integrations/test_hugging_face.py::test_hugging_face_push_and_pull_dataset ``` ### Expected behavior DATASET INFO BEFORE UPLOADING DatasetInfo(description='{"dataset_id": "dummy-combo-test-v0", "env_name": "DummyComboEnv-v0", "action_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}]}", "observation_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"component_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [-1.0], \\"high\\": [1.0]}, \\"component_2\\": {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"subcomponent_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, \\"subcomponent_2\\": {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}, {\\"type\\": \\"Discrete\\", \\"dtype\\": \\"int64\\", \\"start\\": 0, \\"n\\": 10}]}}}}}]}]}"}', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ... DATASET INFO AFTER UPLOADING AND DOWNLOADING DatasetInfo(description='', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits={'train': SplitInfo(name='train', num_bytes=4846, num_examples=60, shard_lengths=None, dataset_name='parquet')}, download_checksums={'https://huggingface.co/datasets/balisujohn/minari_test/resolve/8217b614ff9ba5edc1a30c7df430e92a46f65363/data/train-00000-of-00001-7c5900b93b35745e.parquet': {'num_bytes': 9052, 'checksum': None}}, download_size=9052, post_processing_size=None, dataset_size=4846, size_in_bytes=13898) ... ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2
37
description disappearing from Info when Uploading a Dataset Created with `from_dict` ### Describe the bug When uploading a dataset created locally using `from_dict` with a specified `description` field. It appears before upload, but is missing after upload and re-download. ### Steps to reproduce the bug I think the most relevant pattern in the code might be the following lines: ``` description_json_str = json.dumps( { "dataset_id": dataset.spec.dataset_id, "env_name": dataset.spec.env_spec.id, "action_space": serialize_space(dataset.spec.action_space), "observation_space": serialize_space(dataset.spec.observation_space), } ) hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description=description_json_str) ) ``` Which comes from this function https://github.com/balisujohn/minarai/blob/8e023727f0a8488c4451651d9f7a79b981412c40/minari/integrations/hugging_face.py#L39 To replicate, clone this branch of my Minari fork https://github.com/balisujohn/minarai/tree/dev-huggingface then run ``` python3.8 -m venv env source env/bin/activate python3 -m pip install -e . python3 -m pip install pytest ``` The change the hugging face repo path in the test called `test_hugging_face_push_and_pull_dataset` in `tests/integrations/test_hugging_face.py` to one you have permissions to write to. Then run: ``` pytest tests/integrations/test_hugging_face.py::test_hugging_face_push_and_pull_dataset ``` ### Expected behavior DATASET INFO BEFORE UPLOADING DatasetInfo(description='{"dataset_id": "dummy-combo-test-v0", "env_name": "DummyComboEnv-v0", "action_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}]}", "observation_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"component_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [-1.0], \\"high\\": [1.0]}, \\"component_2\\": {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"subcomponent_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, \\"subcomponent_2\\": {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}, {\\"type\\": \\"Discrete\\", \\"dtype\\": \\"int64\\", \\"start\\": 0, \\"n\\": 10}]}}}}}]}]}"}', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ... DATASET INFO AFTER UPLOADING AND DOWNLOADING DatasetInfo(description='', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits={'train': SplitInfo(name='train', num_bytes=4846, num_examples=60, shard_lengths=None, dataset_name='parquet')}, download_checksums={'https://huggingface.co/datasets/balisujohn/minari_test/resolve/8217b614ff9ba5edc1a30c7df430e92a46f65363/data/train-00000-of-00001-7c5900b93b35745e.parquet': {'num_bytes': 9052, 'checksum': None}}, download_size=9052, post_processing_size=None, dataset_size=4846, size_in_bytes=13898) ... ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2 Here's a minimal way to reproduce the bug, for the sake of convenience. ```` from datasets import Dataset, DatasetInfo, load_dataset episodes_dict = {"test":[1,2,3],"test2": [1,2,4]} hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description="test_str") ) print(hugging_face_dataset.info) hugging_face_dataset.push_to_hub("balisujohn/minari_test", private=True) redownloaded_dataset= load_dataset("balisujohn/minari_test")["train"] print(redownloaded_dataset.info) ````
[ 0.2038726657629013, 0.06310242414474487, 0.08928681910037994, 0.23943296074867249, 0.43252235651016235, -0.08675259351730347, 0.1411246955394745, 0.22590745985507965, -0.469280481338501, 0.09071217477321625, 0.3411741256713867, 0.14465267956256866, 0.3179815709590912, 0.3623771071434021, 0.05406603217124939, -0.13739438354969025, 0.10540024936199188, 0.1337667852640152, -0.09870114922523499, 0.040926314890384674, 0.03745105862617493, -0.011511804535984993, -0.13642694056034088, -0.07381990551948547, -0.18263709545135498, 0.09854192286729813, -0.30102482438087463, 0.11811195313930511, -0.023706048727035522, -0.6718788146972656, 0.11284199357032776, -0.012212404049932957, -0.06628425419330597, -0.1265868991613388, -0.00012048561620758846, -0.10562755912542343, 0.30360710620880127, -0.07944556325674057, -0.3645419478416443, -0.18111684918403625, -0.04780210182070732, -0.35814470052719116, 0.41436558961868286, -0.09796443581581116, -0.20932559669017792, -0.025441445410251617, -0.008212165907025337, -0.18150445818901062, 0.06158948689699173, 0.008053701370954514, 0.08259525895118713, 0.23516640067100525, 0.007252953946590424, -0.11401106417179108, 0.059665776789188385, 0.8775275349617004, -0.21144697070121765, -0.08650947362184525, 0.23205803334712982, -0.11132651567459106, 0.08780644834041595, 0.3145624101161957, 0.026971884071826935, 0.06355652213096619, 0.269461989402771, 0.258325457572937, -0.0169842466711998, -0.02763380855321884, 0.05760669335722923, 0.1407589614391327, 0.6420240998268127, -0.374361515045166, -0.5635885000228882, -0.5048776865005493, 0.08715653419494629, -0.14637607336044312, 0.20531682670116425, 0.1619706153869629, -0.2691499590873718, 0.2612287104129791, -0.006030656397342682, 0.09469501674175262, -0.1023370772600174, 0.04752499610185623, -0.16504856944084167, -0.07487739622592926, -0.04968041926622391, 0.11035852879285812, -0.21196722984313965, -0.49363166093826294, -0.33247533440589905, -0.14817316830158234, -0.33522236347198486, 0.2710833251476288, 0.10882449895143509, -0.06460140645503998, 0.2765165865421295, -0.39419108629226685, 0.30422496795654297, -0.03030923195183277, -0.17210671305656433, -0.2658121883869171, -0.24161465466022491, -0.0013253865763545036, 0.7710030674934387, 0.18807925283908844, 0.2748739719390869, 0.12537214159965515, -0.19468113780021667, 0.1308915913105011, -0.10879690200090408, -0.18954041600227356, 0.18629483878612518, 0.4560913145542145, 0.2646971642971039, -0.2413511872291565, 0.3666260242462158, 0.02108624577522278, -0.48743435740470886, 0.1349882185459137, -0.3258037567138672, 0.13894282281398773, -0.17296992242336273, 0.21446415781974792, -0.28700199723243713, -0.03917597979307175, 0.2610890567302704, 0.09764590859413147, 0.002096228301525116, -0.11147017776966095, -0.2553161084651947, -0.05667579919099808, -0.2058115005493164, 0.09721317142248154, 0.009374573826789856, 0.05776447430253029, 0.36700013279914856, 0.16188931465148926, 0.3825380802154541, -0.17065249383449554, -0.4038136303424835, -0.11633328348398209, 0.16987717151641846, 0.35791078209877014, -0.25515204668045044, 0.1779250204563141, 0.12366807460784912, -0.40741264820098877, -0.05868811905384064, 0.2726479470729828, -0.008055401965975761, 0.07809020578861237, -0.420210599899292, 0.1063576489686966, -0.4162169396877289, 0.013818426057696342, 0.02397926338016987, -0.0568859726190567, 0.05612973868846893, 0.09188556671142578, 0.02236216515302658, 0.0729365274310112, -0.02768556773662567, -0.07655196636915207, 0.2997628450393677, 0.7388942241668701, -0.32589876651763916, -0.18118882179260254, -0.07147908210754395, 0.02163475751876831, 0.2865409851074219, -0.09913967549800873, -0.030072884634137154, 0.33360856771469116, -0.26300057768821716, 0.2619050145149231, -0.035772763192653656, -0.5211706161499023, -0.14097869396209717, 0.5474480390548706, -0.13819678127765656, 0.4284602403640747, 0.04409964010119438, -0.05170610174536705, 0.30255645513534546, 0.18884363770484924, 0.11546643078327179, 0.1903294324874878, 0.2572590112686157, 0.0027178749442100525, -0.19000279903411865, -0.2180955410003662, 0.08424192667007446, -0.1243172138929367, -0.20029304921627045, 0.26908808946609497, 0.11425350606441498, 0.04480643942952156, 0.5834052562713623, 0.3306834101676941, 0.24794337153434753, 0.28877633810043335, 0.351301908493042, 0.19452686607837677, 0.04926848039031029, 0.03762431442737579, -0.22902175784111023, 0.19353829324245453, 0.030275464057922363, 0.2978747487068176, -0.5137766003608704, -0.2106953263282776, -0.174932599067688, 0.35238027572631836, -0.3796674609184265, -0.5211957097053528, 0.11020811647176743, 0.15193313360214233, -0.11757704615592957, 0.15416981279850006, 0.08065880835056305, 0.2510654926300049, -0.3047093152999878, 0.2669777274131775, -0.08930589258670807, -0.03273436054587364, 0.015623223036527634, -0.26540467143058777, -0.18034757673740387, 0.1766653060913086, 0.2636694014072418, 0.25085967779159546, -0.12958978116512299, 0.3930705487728119, 0.2738274931907654, 0.416347861289978, -0.16612228751182556, -0.0961063802242279, 0.1655227541923523, -0.20181748270988464, 0.1809762865304947, 0.14187078177928925, 0.13870561122894287, 0.01073545217514038, -0.3431423008441925, 0.16655072569847107, 0.10261404514312744, 0.008501607924699783, -0.03008580207824707, 0.03313232958316803, 0.3093077540397644, 0.035660386085510254, -0.08197786659002304, -0.5925229787826538, -0.14487943053245544, 0.3098287284374237, 0.036332473158836365, -0.018007799983024597, -0.4379967451095581, 0.2649022936820984, 0.40413999557495117, 0.1180325597524643, 0.07253627479076385, 0.00048579531721770763, -0.3096091151237488, -0.21588006615638733, 0.12206728011369705, -0.09702109545469284, 0.257037490606308, 0.046008069068193436, -0.10519932955503464, 0.09031680971384048, 0.14854320883750916, -0.08137202262878418, 0.2568780481815338, -0.08623635768890381, -0.040981974452733994, 0.07871274650096893, 0.3097377419471741, 0.2796841263771057, -0.03295695409178734, -0.04694167524576187, -0.23280970752239227, 0.28006070852279663, -0.2571346163749695, 0.03411996364593506, -0.22738054394721985, -0.3213956654071808, -0.19179795682430267, -0.261730819940567, -0.4359314739704132, -0.12962427735328674, -0.1915244311094284, -0.13426947593688965, -0.29903078079223633, 0.04826882481575012, -0.08486627042293549, -0.23011937737464905, 0.2219410538673401, -0.3429642617702484, 0.13652834296226501, 0.07519888877868652, -0.023107171058654785, -0.07464925944805145, -0.15919215977191925, -0.05656846985220909, 0.17983774840831757, -0.02209443971514702, -0.11285293102264404, -0.23202553391456604, -0.3187532424926758, 0.22809717059135437, -0.0395255945622921, 0.34698179364204407, 0.04013587534427643, 0.36980921030044556, -0.059904586523771286, -0.19046014547348022, 0.2606060206890106, 0.17849205434322357, -0.44702520966529846, 0.01198916882276535, -0.01253737136721611, 0.16011008620262146, -0.2682918310165405, -0.18506312370300293, -0.03755152225494385, -0.15930719673633575, 0.44201141595840454, 0.003411605954170227, 0.0942005142569542, 0.7326540350914001, -0.01042991504073143, 0.21706876158714294, -0.2847181558609009, 0.40712273120880127, -0.09869570285081863, -0.4868558943271637, -0.11067812889814377, -0.001699596643447876, -0.26836487650871277, -0.040316276252269745, -0.1212700754404068, -0.12159432470798492, -0.030537422746419907, -0.4463786482810974, -0.07440131902694702, -0.05808710306882858, 0.3907678425312042, 0.059404779225587845, -0.2614458203315735, 0.4095500707626343, -0.03735373169183731, -0.00940445065498352, -0.1826162040233612, -0.372374027967453, 0.19830746948719025, 0.18484221398830414, 0.1813170164823532, -0.22665610909461975, -0.08328521996736526, -0.03952890634536743, 0.37642908096313477, 0.13879439234733582, 0.1221451386809349, 0.17910225689411163, -0.177781879901886, 0.3039509654045105, -0.29604893922805786, -0.3563903868198395, -0.0669836476445198, 0.013508178293704987, -0.3219742476940155, 0.0798218846321106, -0.09445096552371979, 0.14663651585578918, -0.06483110040426254, 0.23925192654132843, -0.47193193435668945, -0.14607392251491547, -0.10863743722438812, -0.10589762032032013, 0.464302122592926, -0.0473184734582901, 0.1527910679578781, 0.06856630742549896, -0.06027218699455261, -0.13733206689357758, 0.2772601246833801, 0.2618502676486969, -0.11486048996448517, -0.3628998398780823, -0.485765278339386, -0.11943930387496948, -0.3312716782093048, 0.31190258264541626, 0.2080409824848175, -0.1369887888431549, -0.5420898199081421, 0.17448310554027557, 0.15184283256530762, 0.48074662685394287, 0.19054552912712097, 0.09547138214111328, 0.13117024302482605, -0.22500211000442505, -0.2789972424507141, -0.0766751617193222, -0.06175287812948227, -0.2022581696510315, 0.3083096146583557, 0.5411056876182556, -0.16136090457439423, -0.21593603491783142, 0.14927256107330322, 0.028770875185728073, -0.0197300985455513, 0.006036899983882904, -0.2358892261981964, -0.05493414029479027, -0.018825508654117584, -0.15279364585876465, 0.02669011801481247, 0.44448983669281006, 0.12870416045188904, 0.06949134171009064, 0.08568907529115677, 0.2961440682411194, -0.055297575891017914, 0.028913915157318115, 0.5823785066604614, -0.29438427090644836, 0.5571115016937256, 0.11724280565977097, 0.2612747251987457, 0.4671490490436554, 0.5835771560668945, 0.14001572132110596, -0.40892666578292847, -0.13840588927268982, -0.0673157200217247, 0.28550195693969727, 0.4260829985141754, 0.26543334126472473, 0.353985071182251, -0.08210248500108719, -0.056987375020980835, -0.7506711483001709, -0.002826038748025894, 0.30905836820602417, -0.2933593690395355, 0.2108152210712433, -0.3051314949989319, 0.34047695994377136, -0.25243473052978516, 0.005992397665977478, 0.06636281311511993, 0.1168021485209465, -0.2038777768611908, 0.13766787946224213, -0.022149667143821716, 0.9581758975982666, 0.4218282699584961, 0.24605746567249298, 0.134119912981987, -0.1467840075492859, 0.2573746144771576, 0.11785455793142319, -0.01736532524228096, -0.42279061675071716, 0.13964474201202393, 0.0040844157338142395, -0.10889200866222382, 0.3849791884422302, -0.22072425484657288, -0.139481782913208, -0.37790024280548096, -0.28826040029525757, 0.31642967462539673, -0.0033255666494369507, 0.039463289082050323, -0.16094860434532166, -0.30105912685394287, -0.20077350735664368, -0.0271147433668375, -0.20986786484718323, 0.35528022050857544, 0.13510486483573914, -0.22898796200752258, -0.13752010464668274, -0.03812054917216301, -0.5306164622306824, 0.2080322951078415, -0.0018086135387420654, -0.07261283695697784, 0.31538718938827515, -0.494988352060318, -0.09194377809762955, 0.14165881276130676, 0.20337826013565063, 0.24553602933883667, -0.12669122219085693, 0.1895044595003128, -0.20920833945274353, 0.05255226418375969, 0.011243972927331924, 0.12428028881549835, 0.5116015076637268, -0.02204970270395279, -0.31624311208724976, -0.1265937238931656, -0.1752321720123291, 0.18689510226249695, -0.19004416465759277, -0.19681833684444427, -0.12945038080215454, -0.2991432249546051, 0.03362793102860451, 0.25990357995033264, 0.5818396210670471, -0.3408396244049072, 0.094220831990242, 0.42746061086654663, -0.2712441384792328, -0.05312719941139221, 0.05097686126828194, -0.18174542486667633, -0.10324163734912872, 0.2024630755186081, 0.21004214882850647, 0.05028628557920456, 0.5404573678970337, -0.03217095136642456, -0.10450062900781631, -0.16171696782112122, 0.5481776595115662, -0.19384612143039703, -0.0018380284309387207, 0.11729103326797485, 0.20940452814102173, 0.09008985757827759, -0.34390124678611755, 0.21270817518234253, -0.19143445789813995, -0.11232590675354004, -0.12412640452384949, -0.29756098985671997, -0.17713293433189392, 0.2772553265094757, -0.1445806622505188, -0.040516749024391174, -0.1450311839580536, 0.44474202394485474, 0.4050675928592682, 0.1473953127861023, -0.22761568427085876, -0.10010947287082672, 0.024835333228111267, 0.1993919014930725, 0.3057955205440521, 0.0715179294347763, 0.3712661564350128, -0.22862279415130615, 0.037457481026649475, 0.042200516909360886, 0.09393320977687836, -0.027151448652148247, -0.33816206455230713, 0.1283937394618988, -0.003839525394141674, -0.0232301726937294, 0.12641185522079468, -0.08870262652635574, 0.09517532587051392, -0.15010571479797363, 0.2968483567237854, 0.16644169390201569, -0.10429468005895615, 0.5835219621658325, -0.15957187116146088, 0.5103864669799805, 0.04554278403520584, -0.09570861607789993, 0.10217730700969696, 0.29157114028930664, 0.14201143383979797, 0.1124635562300682, -0.4001401364803314, -0.019004590809345245, 0.06500613689422607, 0.04143160209059715, -0.5805734395980835, 0.20873363316059113, 0.29496949911117554, -0.06736680865287781, -0.0777924507856369, -0.043977316468954086, 0.3626684546470642, -0.17784664034843445, -0.16157430410385132, -0.07330071181058884, 0.14008478820323944, 0.13992664217948914, -0.20376379787921906, -0.009428564459085464, -0.043790098279714584, -0.18246158957481384, -0.04063493013381958, 0.06036633998155594, -0.0898614153265953, 0.015224948525428772, -0.19359955191612244, 0.055439598858356476, 0.2834443151950836, 0.056273944675922394, 0.01562913879752159, 0.4201512634754181, -0.007565446197986603, 0.011576625518500805, 0.10913258790969849, 0.33664074540138245, 0.25815466046333313, 0.5147812366485596, 0.3127700984477997, 0.2409776896238327, 0.099842369556427, -0.13678109645843506, 0.037896811962127686, -0.24771952629089355, 0.22850622236728668, 0.11284162104129791, -0.43987223505973816, 0.059128765016794205, 0.010083703324198723, 0.28497588634490967, -0.15948709845542908, 0.16587069630622864, 0.037906110286712646, -0.0506894513964653, -0.37784501910209656, -0.06905536353588104, 0.013295844197273254, -0.12208716571331024, 0.17374004423618317, -0.23846320807933807, 0.3160952627658844, -0.33399221301078796, 0.27843743562698364, -0.19102135300636292, -0.17165717482566833, -0.29429545998573303, 0.014580180868506432, 0.05844289809465408, 0.24911712110042572, -0.2807347774505615, -0.08445713669061661, 0.1474703550338745, -0.09073349833488464, 0.015392104163765907, 0.36441662907600403, 0.6165199875831604, 0.05463511124253273, 0.04938219115138054, 0.0239800363779068, -0.18440429866313934, -0.2421242892742157, 0.07192760705947876, 0.2396588921546936, 0.026505429297685623, -0.055356528609991074, 0.11081443727016449, 0.01279602199792862, -0.06866522878408432, -0.09943068027496338, 0.4855175316333771, 0.1577874720096588, -0.4909498691558838, 0.38046860694885254, -0.12890425324440002, -0.21163342893123627, 0.04503285139799118, 0.09304288029670715, -0.14946496486663818, -0.42224422097206116, 0.5878377556800842, 0.26811033487319946, 0.08153429627418518, -0.2018386423587799, 0.02928503230214119, 0.013952653855085373, 0.22414983808994293, 0.5113010406494141, -0.20103123784065247, -0.02824525348842144, -0.07937956601381302, -0.43322473764419556, 0.0886443555355072, -0.04237481579184532, -0.2124665081501007, 0.12815649807453156, 0.37587496638298035, -0.01651027798652649, 0.03706628829240799, -0.02419726550579071, 0.14206388592720032, -0.23431745171546936, -0.15813800692558289, -0.20012138783931732, -0.31401327252388, -0.18350204825401306, 0.010602226480841637, -0.04990237206220627, 0.03477189689874649, 0.1269877552986145, -0.1186356395483017, 0.03251275420188904, -0.17739160358905792, -0.14322245121002197, 0.12547603249549866, 0.013494068756699562, 0.18655259907245636, 0.13036954402923584, 0.18874092400074005, 0.0460725873708725, -0.48581603169441223, 0.1675269901752472, -0.23970302939414978, 0.02915342152118683, 0.31801989674568176, 0.021623536944389343, 0.5560773611068726, 0.08252932876348495, -0.23207759857177734, -0.0913906991481781, 0.2559238374233246, -0.11727090924978256, -0.7371389269828796, -0.3296324610710144, -0.030138563364744186, 0.04232257604598999, 0.06409300118684769, -0.09338713437318802, 0.025030022487044334, -0.038833942264318466, 0.11937634646892548, -0.24730508029460907, -0.5278257131576538, 0.23389753699302673, -0.19820520281791687, -0.21734867990016937, -0.1434197872877121, 0.17329341173171997, -0.4479070007801056, 0.06122013181447983, -0.7910563349723816, 0.07841810584068298, 0.3812605142593384, -0.0420733243227005, -0.015168748795986176, -0.02938169613480568, -0.21297524869441986, 0.025464795529842377, 0.0466182678937912, 0.5954341888427734, 0.11840064823627472, 0.05429985374212265, 0.33263179659843445, -0.012653045356273651 ]
https://github.com/huggingface/datasets/issues/5970
Thanks for reporting ! For now I would recommend uploading a separate JSON file for your metadata. Alternatively you can upload a second configuration of the dataset containing your metadata but this feature is not released yet (though you can already use it from [here](https://github.com/huggingface/datasets/pull/5331), it will be released soon)
description disappearing from Info when Uploading a Dataset Created with `from_dict`
### Describe the bug When uploading a dataset created locally using `from_dict` with a specified `description` field. It appears before upload, but is missing after upload and re-download. ### Steps to reproduce the bug I think the most relevant pattern in the code might be the following lines: ``` description_json_str = json.dumps( { "dataset_id": dataset.spec.dataset_id, "env_name": dataset.spec.env_spec.id, "action_space": serialize_space(dataset.spec.action_space), "observation_space": serialize_space(dataset.spec.observation_space), } ) hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description=description_json_str) ) ``` Which comes from this function https://github.com/balisujohn/minarai/blob/8e023727f0a8488c4451651d9f7a79b981412c40/minari/integrations/hugging_face.py#L39 To replicate, clone this branch of my Minari fork https://github.com/balisujohn/minarai/tree/dev-huggingface then run ``` python3.8 -m venv env source env/bin/activate python3 -m pip install -e . python3 -m pip install pytest ``` The change the hugging face repo path in the test called `test_hugging_face_push_and_pull_dataset` in `tests/integrations/test_hugging_face.py` to one you have permissions to write to. Then run: ``` pytest tests/integrations/test_hugging_face.py::test_hugging_face_push_and_pull_dataset ``` ### Expected behavior DATASET INFO BEFORE UPLOADING DatasetInfo(description='{"dataset_id": "dummy-combo-test-v0", "env_name": "DummyComboEnv-v0", "action_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}]}", "observation_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"component_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [-1.0], \\"high\\": [1.0]}, \\"component_2\\": {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"subcomponent_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, \\"subcomponent_2\\": {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}, {\\"type\\": \\"Discrete\\", \\"dtype\\": \\"int64\\", \\"start\\": 0, \\"n\\": 10}]}}}}}]}]}"}', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ... DATASET INFO AFTER UPLOADING AND DOWNLOADING DatasetInfo(description='', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits={'train': SplitInfo(name='train', num_bytes=4846, num_examples=60, shard_lengths=None, dataset_name='parquet')}, download_checksums={'https://huggingface.co/datasets/balisujohn/minari_test/resolve/8217b614ff9ba5edc1a30c7df430e92a46f65363/data/train-00000-of-00001-7c5900b93b35745e.parquet': {'num_bytes': 9052, 'checksum': None}}, download_size=9052, post_processing_size=None, dataset_size=4846, size_in_bytes=13898) ... ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2
50
description disappearing from Info when Uploading a Dataset Created with `from_dict` ### Describe the bug When uploading a dataset created locally using `from_dict` with a specified `description` field. It appears before upload, but is missing after upload and re-download. ### Steps to reproduce the bug I think the most relevant pattern in the code might be the following lines: ``` description_json_str = json.dumps( { "dataset_id": dataset.spec.dataset_id, "env_name": dataset.spec.env_spec.id, "action_space": serialize_space(dataset.spec.action_space), "observation_space": serialize_space(dataset.spec.observation_space), } ) hugging_face_dataset = Dataset.from_dict( episodes_dict, info=DatasetInfo(description=description_json_str) ) ``` Which comes from this function https://github.com/balisujohn/minarai/blob/8e023727f0a8488c4451651d9f7a79b981412c40/minari/integrations/hugging_face.py#L39 To replicate, clone this branch of my Minari fork https://github.com/balisujohn/minarai/tree/dev-huggingface then run ``` python3.8 -m venv env source env/bin/activate python3 -m pip install -e . python3 -m pip install pytest ``` The change the hugging face repo path in the test called `test_hugging_face_push_and_pull_dataset` in `tests/integrations/test_hugging_face.py` to one you have permissions to write to. Then run: ``` pytest tests/integrations/test_hugging_face.py::test_hugging_face_push_and_pull_dataset ``` ### Expected behavior DATASET INFO BEFORE UPLOADING DatasetInfo(description='{"dataset_id": "dummy-combo-test-v0", "env_name": "DummyComboEnv-v0", "action_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}]}", "observation_space": "{\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"component_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [-1.0], \\"high\\": [1.0]}, \\"component_2\\": {\\"type\\": \\"Dict\\", \\"subspaces\\": {\\"subcomponent_1\\": {\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [2.0], \\"high\\": [3.0]}, \\"subcomponent_2\\": {\\"type\\": \\"Tuple\\", \\"subspaces\\": [{\\"type\\": \\"Box\\", \\"dtype\\": \\"float32\\", \\"shape\\": [1], \\"low\\": [4.0], \\"high\\": [5.0]}, {\\"type\\": \\"Discrete\\", \\"dtype\\": \\"int64\\", \\"start\\": 0, \\"n\\": 10}]}}}}}]}]}"}', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ... DATASET INFO AFTER UPLOADING AND DOWNLOADING DatasetInfo(description='', citation='', homepage='', license='', features={'observations': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': {'component_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'component_2': {'subcomponent_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'subcomponent_2': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Value(dtype='int64', id=None)}}}}}, 'actions': {'_index_0': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), '_index_1': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None)}, 'rewards': Value(dtype='int64', id=None), 'truncations': Value(dtype='bool', id=None), 'terminations': Value(dtype='bool', id=None), 'episode_ids': Value(dtype='int64', id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name=None, config_name=None, version=None, splits={'train': SplitInfo(name='train', num_bytes=4846, num_examples=60, shard_lengths=None, dataset_name='parquet')}, download_checksums={'https://huggingface.co/datasets/balisujohn/minari_test/resolve/8217b614ff9ba5edc1a30c7df430e92a46f65363/data/train-00000-of-00001-7c5900b93b35745e.parquet': {'num_bytes': 9052, 'checksum': None}}, download_size=9052, post_processing_size=None, dataset_size=4846, size_in_bytes=13898) ... ### Environment info - `datasets` version: 2.13.0 - Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.2 Thanks for reporting ! For now I would recommend uploading a separate JSON file for your metadata. Alternatively you can upload a second configuration of the dataset containing your metadata but this feature is not released yet (though you can already use it from [here](https://github.com/huggingface/datasets/pull/5331), it will be released soon)
[ 0.2038726657629013, 0.06310242414474487, 0.08928681910037994, 0.23943296074867249, 0.43252235651016235, -0.08675259351730347, 0.1411246955394745, 0.22590745985507965, -0.469280481338501, 0.09071217477321625, 0.3411741256713867, 0.14465267956256866, 0.3179815709590912, 0.3623771071434021, 0.05406603217124939, -0.13739438354969025, 0.10540024936199188, 0.1337667852640152, -0.09870114922523499, 0.040926314890384674, 0.03745105862617493, -0.011511804535984993, -0.13642694056034088, -0.07381990551948547, -0.18263709545135498, 0.09854192286729813, -0.30102482438087463, 0.11811195313930511, -0.023706048727035522, -0.6718788146972656, 0.11284199357032776, -0.012212404049932957, -0.06628425419330597, -0.1265868991613388, -0.00012048561620758846, -0.10562755912542343, 0.30360710620880127, -0.07944556325674057, -0.3645419478416443, -0.18111684918403625, -0.04780210182070732, -0.35814470052719116, 0.41436558961868286, -0.09796443581581116, -0.20932559669017792, -0.025441445410251617, -0.008212165907025337, -0.18150445818901062, 0.06158948689699173, 0.008053701370954514, 0.08259525895118713, 0.23516640067100525, 0.007252953946590424, -0.11401106417179108, 0.059665776789188385, 0.8775275349617004, -0.21144697070121765, -0.08650947362184525, 0.23205803334712982, -0.11132651567459106, 0.08780644834041595, 0.3145624101161957, 0.026971884071826935, 0.06355652213096619, 0.269461989402771, 0.258325457572937, -0.0169842466711998, -0.02763380855321884, 0.05760669335722923, 0.1407589614391327, 0.6420240998268127, -0.374361515045166, -0.5635885000228882, -0.5048776865005493, 0.08715653419494629, -0.14637607336044312, 0.20531682670116425, 0.1619706153869629, -0.2691499590873718, 0.2612287104129791, -0.006030656397342682, 0.09469501674175262, -0.1023370772600174, 0.04752499610185623, -0.16504856944084167, -0.07487739622592926, -0.04968041926622391, 0.11035852879285812, -0.21196722984313965, -0.49363166093826294, -0.33247533440589905, -0.14817316830158234, -0.33522236347198486, 0.2710833251476288, 0.10882449895143509, -0.06460140645503998, 0.2765165865421295, -0.39419108629226685, 0.30422496795654297, -0.03030923195183277, -0.17210671305656433, -0.2658121883869171, -0.24161465466022491, -0.0013253865763545036, 0.7710030674934387, 0.18807925283908844, 0.2748739719390869, 0.12537214159965515, -0.19468113780021667, 0.1308915913105011, -0.10879690200090408, -0.18954041600227356, 0.18629483878612518, 0.4560913145542145, 0.2646971642971039, -0.2413511872291565, 0.3666260242462158, 0.02108624577522278, -0.48743435740470886, 0.1349882185459137, -0.3258037567138672, 0.13894282281398773, -0.17296992242336273, 0.21446415781974792, -0.28700199723243713, -0.03917597979307175, 0.2610890567302704, 0.09764590859413147, 0.002096228301525116, -0.11147017776966095, -0.2553161084651947, -0.05667579919099808, -0.2058115005493164, 0.09721317142248154, 0.009374573826789856, 0.05776447430253029, 0.36700013279914856, 0.16188931465148926, 0.3825380802154541, -0.17065249383449554, -0.4038136303424835, -0.11633328348398209, 0.16987717151641846, 0.35791078209877014, -0.25515204668045044, 0.1779250204563141, 0.12366807460784912, -0.40741264820098877, -0.05868811905384064, 0.2726479470729828, -0.008055401965975761, 0.07809020578861237, -0.420210599899292, 0.1063576489686966, -0.4162169396877289, 0.013818426057696342, 0.02397926338016987, -0.0568859726190567, 0.05612973868846893, 0.09188556671142578, 0.02236216515302658, 0.0729365274310112, -0.02768556773662567, -0.07655196636915207, 0.2997628450393677, 0.7388942241668701, -0.32589876651763916, -0.18118882179260254, -0.07147908210754395, 0.02163475751876831, 0.2865409851074219, -0.09913967549800873, -0.030072884634137154, 0.33360856771469116, -0.26300057768821716, 0.2619050145149231, -0.035772763192653656, -0.5211706161499023, -0.14097869396209717, 0.5474480390548706, -0.13819678127765656, 0.4284602403640747, 0.04409964010119438, -0.05170610174536705, 0.30255645513534546, 0.18884363770484924, 0.11546643078327179, 0.1903294324874878, 0.2572590112686157, 0.0027178749442100525, -0.19000279903411865, -0.2180955410003662, 0.08424192667007446, -0.1243172138929367, -0.20029304921627045, 0.26908808946609497, 0.11425350606441498, 0.04480643942952156, 0.5834052562713623, 0.3306834101676941, 0.24794337153434753, 0.28877633810043335, 0.351301908493042, 0.19452686607837677, 0.04926848039031029, 0.03762431442737579, -0.22902175784111023, 0.19353829324245453, 0.030275464057922363, 0.2978747487068176, -0.5137766003608704, -0.2106953263282776, -0.174932599067688, 0.35238027572631836, -0.3796674609184265, -0.5211957097053528, 0.11020811647176743, 0.15193313360214233, -0.11757704615592957, 0.15416981279850006, 0.08065880835056305, 0.2510654926300049, -0.3047093152999878, 0.2669777274131775, -0.08930589258670807, -0.03273436054587364, 0.015623223036527634, -0.26540467143058777, -0.18034757673740387, 0.1766653060913086, 0.2636694014072418, 0.25085967779159546, -0.12958978116512299, 0.3930705487728119, 0.2738274931907654, 0.416347861289978, -0.16612228751182556, -0.0961063802242279, 0.1655227541923523, -0.20181748270988464, 0.1809762865304947, 0.14187078177928925, 0.13870561122894287, 0.01073545217514038, -0.3431423008441925, 0.16655072569847107, 0.10261404514312744, 0.008501607924699783, -0.03008580207824707, 0.03313232958316803, 0.3093077540397644, 0.035660386085510254, -0.08197786659002304, -0.5925229787826538, -0.14487943053245544, 0.3098287284374237, 0.036332473158836365, -0.018007799983024597, -0.4379967451095581, 0.2649022936820984, 0.40413999557495117, 0.1180325597524643, 0.07253627479076385, 0.00048579531721770763, -0.3096091151237488, -0.21588006615638733, 0.12206728011369705, -0.09702109545469284, 0.257037490606308, 0.046008069068193436, -0.10519932955503464, 0.09031680971384048, 0.14854320883750916, -0.08137202262878418, 0.2568780481815338, -0.08623635768890381, -0.040981974452733994, 0.07871274650096893, 0.3097377419471741, 0.2796841263771057, -0.03295695409178734, -0.04694167524576187, -0.23280970752239227, 0.28006070852279663, -0.2571346163749695, 0.03411996364593506, -0.22738054394721985, -0.3213956654071808, -0.19179795682430267, -0.261730819940567, -0.4359314739704132, -0.12962427735328674, -0.1915244311094284, -0.13426947593688965, -0.29903078079223633, 0.04826882481575012, -0.08486627042293549, -0.23011937737464905, 0.2219410538673401, -0.3429642617702484, 0.13652834296226501, 0.07519888877868652, -0.023107171058654785, -0.07464925944805145, -0.15919215977191925, -0.05656846985220909, 0.17983774840831757, -0.02209443971514702, -0.11285293102264404, -0.23202553391456604, -0.3187532424926758, 0.22809717059135437, -0.0395255945622921, 0.34698179364204407, 0.04013587534427643, 0.36980921030044556, -0.059904586523771286, -0.19046014547348022, 0.2606060206890106, 0.17849205434322357, -0.44702520966529846, 0.01198916882276535, -0.01253737136721611, 0.16011008620262146, -0.2682918310165405, -0.18506312370300293, -0.03755152225494385, -0.15930719673633575, 0.44201141595840454, 0.003411605954170227, 0.0942005142569542, 0.7326540350914001, -0.01042991504073143, 0.21706876158714294, -0.2847181558609009, 0.40712273120880127, -0.09869570285081863, -0.4868558943271637, -0.11067812889814377, -0.001699596643447876, -0.26836487650871277, -0.040316276252269745, -0.1212700754404068, -0.12159432470798492, -0.030537422746419907, -0.4463786482810974, -0.07440131902694702, -0.05808710306882858, 0.3907678425312042, 0.059404779225587845, -0.2614458203315735, 0.4095500707626343, -0.03735373169183731, -0.00940445065498352, -0.1826162040233612, -0.372374027967453, 0.19830746948719025, 0.18484221398830414, 0.1813170164823532, -0.22665610909461975, -0.08328521996736526, -0.03952890634536743, 0.37642908096313477, 0.13879439234733582, 0.1221451386809349, 0.17910225689411163, -0.177781879901886, 0.3039509654045105, -0.29604893922805786, -0.3563903868198395, -0.0669836476445198, 0.013508178293704987, -0.3219742476940155, 0.0798218846321106, -0.09445096552371979, 0.14663651585578918, -0.06483110040426254, 0.23925192654132843, -0.47193193435668945, -0.14607392251491547, -0.10863743722438812, -0.10589762032032013, 0.464302122592926, -0.0473184734582901, 0.1527910679578781, 0.06856630742549896, -0.06027218699455261, -0.13733206689357758, 0.2772601246833801, 0.2618502676486969, -0.11486048996448517, -0.3628998398780823, -0.485765278339386, -0.11943930387496948, -0.3312716782093048, 0.31190258264541626, 0.2080409824848175, -0.1369887888431549, -0.5420898199081421, 0.17448310554027557, 0.15184283256530762, 0.48074662685394287, 0.19054552912712097, 0.09547138214111328, 0.13117024302482605, -0.22500211000442505, -0.2789972424507141, -0.0766751617193222, -0.06175287812948227, -0.2022581696510315, 0.3083096146583557, 0.5411056876182556, -0.16136090457439423, -0.21593603491783142, 0.14927256107330322, 0.028770875185728073, -0.0197300985455513, 0.006036899983882904, -0.2358892261981964, -0.05493414029479027, -0.018825508654117584, -0.15279364585876465, 0.02669011801481247, 0.44448983669281006, 0.12870416045188904, 0.06949134171009064, 0.08568907529115677, 0.2961440682411194, -0.055297575891017914, 0.028913915157318115, 0.5823785066604614, -0.29438427090644836, 0.5571115016937256, 0.11724280565977097, 0.2612747251987457, 0.4671490490436554, 0.5835771560668945, 0.14001572132110596, -0.40892666578292847, -0.13840588927268982, -0.0673157200217247, 0.28550195693969727, 0.4260829985141754, 0.26543334126472473, 0.353985071182251, -0.08210248500108719, -0.056987375020980835, -0.7506711483001709, -0.002826038748025894, 0.30905836820602417, -0.2933593690395355, 0.2108152210712433, -0.3051314949989319, 0.34047695994377136, -0.25243473052978516, 0.005992397665977478, 0.06636281311511993, 0.1168021485209465, -0.2038777768611908, 0.13766787946224213, -0.022149667143821716, 0.9581758975982666, 0.4218282699584961, 0.24605746567249298, 0.134119912981987, -0.1467840075492859, 0.2573746144771576, 0.11785455793142319, -0.01736532524228096, -0.42279061675071716, 0.13964474201202393, 0.0040844157338142395, -0.10889200866222382, 0.3849791884422302, -0.22072425484657288, -0.139481782913208, -0.37790024280548096, -0.28826040029525757, 0.31642967462539673, -0.0033255666494369507, 0.039463289082050323, -0.16094860434532166, -0.30105912685394287, -0.20077350735664368, -0.0271147433668375, -0.20986786484718323, 0.35528022050857544, 0.13510486483573914, -0.22898796200752258, -0.13752010464668274, -0.03812054917216301, -0.5306164622306824, 0.2080322951078415, -0.0018086135387420654, -0.07261283695697784, 0.31538718938827515, -0.494988352060318, -0.09194377809762955, 0.14165881276130676, 0.20337826013565063, 0.24553602933883667, -0.12669122219085693, 0.1895044595003128, -0.20920833945274353, 0.05255226418375969, 0.011243972927331924, 0.12428028881549835, 0.5116015076637268, -0.02204970270395279, -0.31624311208724976, -0.1265937238931656, -0.1752321720123291, 0.18689510226249695, -0.19004416465759277, -0.19681833684444427, -0.12945038080215454, -0.2991432249546051, 0.03362793102860451, 0.25990357995033264, 0.5818396210670471, -0.3408396244049072, 0.094220831990242, 0.42746061086654663, -0.2712441384792328, -0.05312719941139221, 0.05097686126828194, -0.18174542486667633, -0.10324163734912872, 0.2024630755186081, 0.21004214882850647, 0.05028628557920456, 0.5404573678970337, -0.03217095136642456, -0.10450062900781631, -0.16171696782112122, 0.5481776595115662, -0.19384612143039703, -0.0018380284309387207, 0.11729103326797485, 0.20940452814102173, 0.09008985757827759, -0.34390124678611755, 0.21270817518234253, -0.19143445789813995, -0.11232590675354004, -0.12412640452384949, -0.29756098985671997, -0.17713293433189392, 0.2772553265094757, -0.1445806622505188, -0.040516749024391174, -0.1450311839580536, 0.44474202394485474, 0.4050675928592682, 0.1473953127861023, -0.22761568427085876, -0.10010947287082672, 0.024835333228111267, 0.1993919014930725, 0.3057955205440521, 0.0715179294347763, 0.3712661564350128, -0.22862279415130615, 0.037457481026649475, 0.042200516909360886, 0.09393320977687836, -0.027151448652148247, -0.33816206455230713, 0.1283937394618988, -0.003839525394141674, -0.0232301726937294, 0.12641185522079468, -0.08870262652635574, 0.09517532587051392, -0.15010571479797363, 0.2968483567237854, 0.16644169390201569, -0.10429468005895615, 0.5835219621658325, -0.15957187116146088, 0.5103864669799805, 0.04554278403520584, -0.09570861607789993, 0.10217730700969696, 0.29157114028930664, 0.14201143383979797, 0.1124635562300682, -0.4001401364803314, -0.019004590809345245, 0.06500613689422607, 0.04143160209059715, -0.5805734395980835, 0.20873363316059113, 0.29496949911117554, -0.06736680865287781, -0.0777924507856369, -0.043977316468954086, 0.3626684546470642, -0.17784664034843445, -0.16157430410385132, -0.07330071181058884, 0.14008478820323944, 0.13992664217948914, -0.20376379787921906, -0.009428564459085464, -0.043790098279714584, -0.18246158957481384, -0.04063493013381958, 0.06036633998155594, -0.0898614153265953, 0.015224948525428772, -0.19359955191612244, 0.055439598858356476, 0.2834443151950836, 0.056273944675922394, 0.01562913879752159, 0.4201512634754181, -0.007565446197986603, 0.011576625518500805, 0.10913258790969849, 0.33664074540138245, 0.25815466046333313, 0.5147812366485596, 0.3127700984477997, 0.2409776896238327, 0.099842369556427, -0.13678109645843506, 0.037896811962127686, -0.24771952629089355, 0.22850622236728668, 0.11284162104129791, -0.43987223505973816, 0.059128765016794205, 0.010083703324198723, 0.28497588634490967, -0.15948709845542908, 0.16587069630622864, 0.037906110286712646, -0.0506894513964653, -0.37784501910209656, -0.06905536353588104, 0.013295844197273254, -0.12208716571331024, 0.17374004423618317, -0.23846320807933807, 0.3160952627658844, -0.33399221301078796, 0.27843743562698364, -0.19102135300636292, -0.17165717482566833, -0.29429545998573303, 0.014580180868506432, 0.05844289809465408, 0.24911712110042572, -0.2807347774505615, -0.08445713669061661, 0.1474703550338745, -0.09073349833488464, 0.015392104163765907, 0.36441662907600403, 0.6165199875831604, 0.05463511124253273, 0.04938219115138054, 0.0239800363779068, -0.18440429866313934, -0.2421242892742157, 0.07192760705947876, 0.2396588921546936, 0.026505429297685623, -0.055356528609991074, 0.11081443727016449, 0.01279602199792862, -0.06866522878408432, -0.09943068027496338, 0.4855175316333771, 0.1577874720096588, -0.4909498691558838, 0.38046860694885254, -0.12890425324440002, -0.21163342893123627, 0.04503285139799118, 0.09304288029670715, -0.14946496486663818, -0.42224422097206116, 0.5878377556800842, 0.26811033487319946, 0.08153429627418518, -0.2018386423587799, 0.02928503230214119, 0.013952653855085373, 0.22414983808994293, 0.5113010406494141, -0.20103123784065247, -0.02824525348842144, -0.07937956601381302, -0.43322473764419556, 0.0886443555355072, -0.04237481579184532, -0.2124665081501007, 0.12815649807453156, 0.37587496638298035, -0.01651027798652649, 0.03706628829240799, -0.02419726550579071, 0.14206388592720032, -0.23431745171546936, -0.15813800692558289, -0.20012138783931732, -0.31401327252388, -0.18350204825401306, 0.010602226480841637, -0.04990237206220627, 0.03477189689874649, 0.1269877552986145, -0.1186356395483017, 0.03251275420188904, -0.17739160358905792, -0.14322245121002197, 0.12547603249549866, 0.013494068756699562, 0.18655259907245636, 0.13036954402923584, 0.18874092400074005, 0.0460725873708725, -0.48581603169441223, 0.1675269901752472, -0.23970302939414978, 0.02915342152118683, 0.31801989674568176, 0.021623536944389343, 0.5560773611068726, 0.08252932876348495, -0.23207759857177734, -0.0913906991481781, 0.2559238374233246, -0.11727090924978256, -0.7371389269828796, -0.3296324610710144, -0.030138563364744186, 0.04232257604598999, 0.06409300118684769, -0.09338713437318802, 0.025030022487044334, -0.038833942264318466, 0.11937634646892548, -0.24730508029460907, -0.5278257131576538, 0.23389753699302673, -0.19820520281791687, -0.21734867990016937, -0.1434197872877121, 0.17329341173171997, -0.4479070007801056, 0.06122013181447983, -0.7910563349723816, 0.07841810584068298, 0.3812605142593384, -0.0420733243227005, -0.015168748795986176, -0.02938169613480568, -0.21297524869441986, 0.025464795529842377, 0.0466182678937912, 0.5954341888427734, 0.11840064823627472, 0.05429985374212265, 0.33263179659843445, -0.012653045356273651 ]
https://github.com/huggingface/datasets/issues/5968
The issue commes from the dataset itself and is not related to the `datasets` lib see https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1/blob/2c475b3b88e0f2e5828f830a4b91618a25ff20b7/common_voice_6_1.py#L148-L152
Common Voice datasets still need `use_auth_token=True`
### Describe the bug We don't need to pass `use_auth_token=True` anymore to download gated datasets or models, so the following should work if correctly logged in. ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` However it throws an error - probably because something weird is hardcoded into the dataset loading script. ### Steps to reproduce the bug 1.) ``` huggingface-cli login ``` 2.) Make sure that you have accepted the license here: https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1 3.) Run: ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` 4.) You'll get: ``` File ~/hf/lib/python3.10/site-packages/datasets/builder.py:963, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 961 split_dict = SplitDict(dataset_name=self.name) 962 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 963 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 965 # Checksums verification 966 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_6_1/f4d7854c466f5bd4908988dbd39044ec4fc634d89e0515ab0c51715c0127ffe3/common_voice_6_1.py:150, in CommonVoice._split_generators(self, dl_manager) 148 hf_auth_token = dl_manager.download_config.use_auth_token 149 if hf_auth_token is None: --> 150 raise ConnectionError( 151 "Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset" 152 ) 154 bundle_url_template = STATS["bundleURLTemplate"] 155 bundle_version = bundle_url_template.split("/")[0] ConnectionError: Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset ``` ### Expected behavior One should not have to pass `use_auth_token=True`. Also see discussion here: https://github.com/huggingface/blog/pull/1243#discussion_r1235131150 ### Environment info ``` - `datasets` version: 2.13.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 ```
17
Common Voice datasets still need `use_auth_token=True` ### Describe the bug We don't need to pass `use_auth_token=True` anymore to download gated datasets or models, so the following should work if correctly logged in. ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` However it throws an error - probably because something weird is hardcoded into the dataset loading script. ### Steps to reproduce the bug 1.) ``` huggingface-cli login ``` 2.) Make sure that you have accepted the license here: https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1 3.) Run: ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` 4.) You'll get: ``` File ~/hf/lib/python3.10/site-packages/datasets/builder.py:963, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 961 split_dict = SplitDict(dataset_name=self.name) 962 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 963 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 965 # Checksums verification 966 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_6_1/f4d7854c466f5bd4908988dbd39044ec4fc634d89e0515ab0c51715c0127ffe3/common_voice_6_1.py:150, in CommonVoice._split_generators(self, dl_manager) 148 hf_auth_token = dl_manager.download_config.use_auth_token 149 if hf_auth_token is None: --> 150 raise ConnectionError( 151 "Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset" 152 ) 154 bundle_url_template = STATS["bundleURLTemplate"] 155 bundle_version = bundle_url_template.split("/")[0] ConnectionError: Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset ``` ### Expected behavior One should not have to pass `use_auth_token=True`. Also see discussion here: https://github.com/huggingface/blog/pull/1243#discussion_r1235131150 ### Environment info ``` - `datasets` version: 2.13.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 ``` The issue commes from the dataset itself and is not related to the `datasets` lib see https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1/blob/2c475b3b88e0f2e5828f830a4b91618a25ff20b7/common_voice_6_1.py#L148-L152
[ -0.19967004656791687, 0.01185956597328186, 0.1525600701570511, -0.005796443670988083, 0.44708141684532166, 0.05265425145626068, 0.5136598348617554, 0.12041813135147095, 0.031704775989055634, -0.047319553792476654, -0.5297954678535461, 0.042947519570589066, 0.03492205962538719, -0.029982902109622955, 0.02069898694753647, 0.140645369887352, 0.058938007801771164, -0.10698094964027405, 0.07509633898735046, -0.12610048055648804, -0.17410755157470703, 0.15782491862773895, -0.26827472448349, 0.20281097292900085, -0.28944504261016846, -0.15474799275398254, 0.09749960899353027, 0.35906782746315, 0.03130515664815903, -0.2894136905670166, 0.3442499339580536, 0.3093809187412262, 0.07892784476280212, 0.24943889677524567, -0.00011565391469048336, 0.13892391324043274, 0.20841443538665771, -0.17052355408668518, -0.2634650766849518, -0.22062858939170837, -0.16799363493919373, 0.19017404317855835, -0.03443882614374161, 0.018202126026153564, 0.04138040542602539, -0.2771683931350708, -0.08910606801509857, -0.4667785167694092, 0.7673097848892212, 0.4816017150878906, 0.14320015907287598, 0.20158404111862183, 0.035703226923942566, -0.0999787300825119, -0.13640069961547852, 0.1118389293551445, 0.00770607590675354, 0.45517873764038086, 0.2252427637577057, -0.06973040848970413, 0.23236820101737976, 0.18818828463554382, -0.13062840700149536, -0.1564839482307434, 0.4328203797340393, -0.13590538501739502, -0.3640206456184387, -0.44513532519340515, -0.0068957265466451645, 0.3984825015068054, 0.08575945347547531, -0.27323976159095764, -0.27649611234664917, -0.2705610990524292, 0.02598080411553383, 0.04118582606315613, 0.14899860322475433, 0.2440682202577591, -0.20735692977905273, 0.33277377486228943, -0.361224889755249, -0.11593429744243622, 0.07403186708688736, 0.01667175628244877, 0.10027708113193512, 0.3666422963142395, 0.06504841148853302, 0.12149947881698608, 0.2157701551914215, -0.06989678740501404, -0.07613345980644226, 0.031321462243795395, -0.06653743982315063, 0.275959312915802, -0.089149609208107, 0.0509636253118515, -0.06763744354248047, 0.0341670848429203, 0.42344430088996887, 0.07835085690021515, -0.2892245948314667, 0.031509771943092346, -0.22601068019866943, 0.024575751274824142, 0.030801162123680115, 0.20403525233268738, 0.1898018717765808, 0.17540007829666138, 0.3190698027610779, 0.30236467719078064, 0.13143125176429749, -0.03444486856460571, -0.08615478128194809, -0.004106730222702026, -0.038888685405254364, 0.001300683245062828, 0.2891808748245239, -0.1982976794242859, -0.33598896861076355, 0.025808177888393402, -0.2545510232448578, -0.02693682350218296, 0.18037855625152588, 0.560332715511322, 0.03483711555600166, -0.04685142636299133, 0.03888477385044098, 0.2961576581001282, -0.11830524355173111, -0.43817174434661865, -0.11431090533733368, -0.17002452909946442, -0.057733204215765, 0.15411311388015747, 0.18270570039749146, -0.505229651927948, 0.22740712761878967, 0.12611627578735352, 0.14066429436206818, -0.08463562279939651, -0.11264503002166748, 0.17380522191524506, 0.07481817901134491, 0.1452641785144806, 0.09010869264602661, 0.2137690633535385, 0.2449711114168167, -0.13199235498905182, -0.20265743136405945, 0.0652339980006218, -0.30444660782814026, -0.42688682675361633, 0.04217514395713806, 0.11779534071683884, -0.28430283069610596, -0.11914898455142975, 0.14616604149341583, 0.02629419043660164, 0.18836599588394165, -0.22172889113426208, 0.05738404393196106, -0.17395660281181335, -0.32233643531799316, 0.06878077238798141, 0.3510397970676422, 0.45562654733657837, -0.1206042617559433, -0.3489544987678528, -0.13473913073539734, -0.3133920133113861, 0.031409233808517456, 0.19831551611423492, -0.31044766306877136, 0.12080340087413788, -0.2684648633003235, 0.42273563146591187, 0.3624856770038605, -0.5514575242996216, -0.6021081209182739, 0.18462719023227692, 0.1446058601140976, 0.18325749039649963, 0.08488781750202179, -0.17177429795265198, 0.19754937291145325, 0.06572525203227997, 0.17060551047325134, 0.3689936697483063, 0.14093159139156342, 0.10046331584453583, -0.06605411320924759, -0.32099321484565735, 0.16932354867458344, 0.12405697256326675, -0.10097286105155945, 0.17603106796741486, 0.26679763197898865, 0.023715917021036148, 0.470065712928772, -0.06798118352890015, 0.014472909271717072, 0.012035086750984192, 0.3619646430015564, -0.12593869864940643, 0.029019121080636978, -0.01592504233121872, -0.36445295810699463, 0.2727113962173462, 0.02543114870786667, 0.2714279890060425, -0.2721702456474304, -0.3569618761539459, -0.4229493737220764, -0.009531717747449875, -0.4269677698612213, -0.1738620400428772, -0.06345422565937042, -0.02861565724015236, -0.030212007462978363, 0.06766931712627411, -0.0870416909456253, 0.3223363161087036, -0.026391364634037018, 0.2965121567249298, 0.005536902695894241, 0.10166740417480469, -0.06268048286437988, 0.047805242240428925, -0.024524718523025513, 0.17669424414634705, 0.20490360260009766, 0.0039154402911663055, -0.12771345674991608, 0.5666518807411194, -0.11672592163085938, 0.1716209203004837, -0.4950207769870758, 0.05301810801029205, 0.15459248423576355, -0.21098746359348297, -0.045613713562488556, 0.2166626751422882, 0.04825930669903755, 0.027266107499599457, -0.03503024950623512, 0.49335694313049316, 0.42567598819732666, 0.10818266868591309, 0.010802850127220154, 0.23293906450271606, 0.17597199976444244, -0.016100727021694183, -0.09042464196681976, -0.2206849604845047, 0.09842120856046677, -0.1780942976474762, 0.2690635025501251, -0.06360124051570892, -0.12641823291778564, 0.009929187595844269, 0.5413870215415955, -0.00404907763004303, 0.23355719447135925, -0.03538290783762932, -0.12833762168884277, -0.019539259374141693, 0.3000519275665283, 0.15062624216079712, 0.42970001697540283, 0.08026917278766632, -0.011373776942491531, 0.4063607454299927, -0.04235214367508888, -0.2325873076915741, 0.26402854919433594, -0.004372194409370422, -0.21981889009475708, 0.04341185465455055, -0.06802770495414734, -0.0570935495197773, -0.5199130773544312, -0.29388079047203064, -0.04429648816585541, 0.09537127614021301, -0.6486205458641052, 0.12149602174758911, -0.2761078476905823, 0.015122219920158386, -0.08642220497131348, -0.04416355490684509, -0.42319726943969727, -0.2736916244029999, -0.026466570794582367, 0.2257348597049713, 0.13003858923912048, 0.4081447720527649, -0.4250074625015259, 0.23459777235984802, -0.025327276438474655, -0.11869999766349792, -0.15359902381896973, 0.06970024108886719, -0.30035102367401123, -0.0025765523314476013, 0.40417301654815674, -0.1604374200105667, -0.006615267135202885, -0.11793000996112823, -0.03689539059996605, -0.25702154636383057, -0.20097704231739044, 0.19872763752937317, -0.12010831385850906, 0.30650782585144043, -0.038975249975919724, -0.10216690599918365, 0.20781664550304413, -0.07300888746976852, 0.115040123462677, -0.06600146740674973, -0.21517488360404968, 0.006825804710388184, -0.12549205124378204, -0.05413605272769928, -0.3875771760940552, -0.33228057622909546, -0.13555337488651276, -0.3437674343585968, 0.2194879949092865, -0.18652716279029846, 0.05617879703640938, 0.4111565351486206, 0.08236406743526459, 0.11105424910783768, -0.47452470660209656, 0.22359080612659454, -0.3340977132320404, -0.3026641011238098, 0.30157172679901123, -0.11320185661315918, -0.30772751569747925, -0.0317305251955986, -0.04493163153529167, 0.42570412158966064, 0.014717597514390945, -0.2878663241863251, -0.1312905251979828, -0.2188817709684372, 0.29502931237220764, -0.09061183035373688, 0.0923524796962738, 0.1756124347448349, -0.010370764881372452, 0.09061378240585327, -0.06147883087396622, 0.013962127268314362, 0.04504911229014397, -0.16222265362739563, 0.19522109627723694, -0.08335364609956741, 0.441736102104187, 0.015525341033935547, 0.8501541614532471, 0.19012995064258575, 0.09351074695587158, 0.294450581073761, -0.23492217063903809, 0.5599885582923889, -0.08920568227767944, -0.3922698199748993, 0.05138399451971054, 0.11191724985837936, 0.20929783582687378, 0.24674835801124573, 0.06897705793380737, 0.14829054474830627, -0.2345919907093048, -0.21000200510025024, -0.016956105828285217, -0.40014633536338806, -0.17632408440113068, 0.0051288846880197525, 0.12115645408630371, 0.2561870217323303, 0.5062915086746216, 0.033355146646499634, -0.1631016880273819, 0.21697944402694702, 0.25714829564094543, 0.0018925219774246216, 0.14376932382583618, -0.25208598375320435, 0.15048736333847046, -0.3330167531967163, 0.2986648976802826, 0.09876100718975067, 0.36866524815559387, -0.21233999729156494, -0.19410398602485657, 0.08047991991043091, 0.12260137498378754, 0.2642045021057129, 0.11692120134830475, 0.11307935416698456, -0.15154318511486053, 0.22230657935142517, -0.26481354236602783, -0.13444574177265167, 0.0025172159075737, -0.3443145751953125, 0.5452451109886169, 0.2977007329463959, -0.2791062295436859, -0.07800813019275665, -0.2144424170255661, -0.01828676089644432, -0.15181465446949005, -0.09318764507770538, -0.33406028151512146, -0.3505459427833557, -0.6033843755722046, 0.1947292983531952, 0.2134242057800293, 0.14876136183738708, -0.31903767585754395, 0.07938310503959656, 0.15556547045707703, -0.2729765474796295, 0.3246963918209076, 0.2341059446334839, 0.06229731813073158, 0.013998456299304962, 0.26318493485450745, 0.3190914988517761, -0.03266526013612747, 0.036495380103588104, 0.7873034477233887, 0.1961086541414261, -0.484924852848053, -0.20225144922733307, 0.14487236738204956, 0.27517762780189514, 0.4503690302371979, -0.14811839163303375, 0.028916742652654648, 0.6284186244010925, 0.07694374024868011, 0.011515352874994278, 0.20114967226982117, 0.2624666094779968, -0.003424178808927536, -0.2714434862136841, -0.36012697219848633, 0.03732620179653168, -0.08375657349824905, -0.1033983826637268, 0.07546475529670715, 0.29165351390838623, -0.2175339162349701, -0.13652315735816956, -0.2748097777366638, 1.0740822553634644, 0.19549718499183655, 0.4446520209312439, 0.5033267140388489, 0.035273127257823944, 0.1428411602973938, -0.1079191267490387, 0.029965147376060486, -0.10831599682569504, -0.032280586659908295, -0.09906089305877686, -0.08670470118522644, 0.035906173288822174, -0.10297088325023651, -0.1062215268611908, 0.29958394169807434, -0.09211347997188568, 0.13099931180477142, 0.24259167909622192, 0.3117241859436035, -0.5273445248603821, -0.14761026203632355, 0.11428151279687881, 0.06708908081054688, 0.05443103611469269, 0.386206716299057, -0.0187368281185627, -0.2319929599761963, -0.131217822432518, -0.4715614914894104, -0.2218976765871048, 0.36954784393310547, -0.31387975811958313, 0.18511170148849487, 0.3833577334880829, 0.17527516186237335, 0.48324018716812134, 0.12556883692741394, 0.25657346844673157, 0.1694881021976471, -0.37781932950019836, 0.2259274274110794, 0.134969562292099, -0.031000783666968346, 0.04857867956161499, 0.04221276938915253, 0.5060519576072693, -0.04554877430200577, -0.3122697174549103, -0.03264486789703369, -0.04569873586297035, -0.2386971414089203, -0.5057772994041443, 0.0069265831261873245, 0.1470494270324707, -0.5170873999595642, 0.07442943751811981, -0.03889122232794762, 0.2722443640232086, -0.2112111747264862, 0.033083442598581314, 0.08952032029628754, -0.0114128477871418, -0.04733961820602417, 0.06289035081863403, -0.1749088168144226, -0.12594351172447205, 0.3988235294818878, -0.17835009098052979, -0.0011376366019248962, 0.6932650208473206, -0.026089437305927277, -0.10399647802114487, -0.12633077800273895, -0.11838871240615845, 0.29085657000541687, -0.4218575656414032, 0.013024337589740753, 0.04177026450634003, -0.05383977293968201, -0.3729829788208008, 0.3259011507034302, -0.06062483415007591, 0.07396170496940613, 0.17957749962806702, -0.3744766116142273, -0.3701027035713196, 0.053916968405246735, -0.20053108036518097, -0.004915802739560604, 0.02701779454946518, 0.3099624812602997, -0.062499403953552246, -0.06647781282663345, -0.2518196105957031, 0.06220293790102005, 0.13959181308746338, -0.17382435500621796, 0.31369227170944214, -0.12835149466991425, 0.14822274446487427, -0.03977813944220543, 0.047632165253162384, 0.14752721786499023, -0.2290404736995697, -0.12589918076992035, -0.4106469452381134, 0.18540973961353302, 0.20939311385154724, -0.32747897505760193, 0.11082451045513153, 0.020648352801799774, -0.24978107213974, -0.05869697034358978, 0.18140581250190735, 0.3759949207305908, 0.07538434863090515, -0.0791526734828949, 0.04726308211684227, 0.27551913261413574, -0.0920572355389595, -0.011704080738127232, -0.18151041865348816, 0.029789544641971588, 0.05531870573759079, 0.14910517632961273, -0.37387552857398987, -0.038201361894607544, -0.2721814513206482, 0.17634044587612152, 0.47769126296043396, 0.13782621920108795, 0.3850650489330292, -0.02648300677537918, -0.06083045154809952, 0.07602570950984955, 0.329637348651886, 0.2874133884906769, -0.2876240015029907, -0.02011191099882126, 0.3103315830230713, 0.12153342366218567, -0.38855212926864624, -0.0007527396082878113, -0.1648004651069641, -0.025443365797400475, -0.0707038938999176, 0.2017575353384018, -0.03242775797843933, -0.08234524726867676, 0.10291893035173416, -0.14491626620292664, 0.145528182387352, 0.3210325837135315, 0.18805381655693054, 0.10194934904575348, -0.26014453172683716, 0.04655827581882477, 0.5241184830665588, -0.19081999361515045, 0.13957339525222778, 0.21581587195396423, -0.6616795063018799, 0.15115143358707428, -0.17693880200386047, 0.1171235740184784, 0.37080997228622437, -0.4541515111923218, -0.03340763598680496, -0.21037952601909637, -0.23558998107910156, -0.13418050110340118, -0.18206757307052612, 0.6025288701057434, -0.28915682435035706, -0.17018423974514008, -0.25215330719947815, 0.40415897965431213, -0.17790618538856506, -0.09773402661085129, 0.02894199639558792, -0.2053396999835968, -0.1671108603477478, -0.004730328917503357, -0.03921293094754219, -0.38948559761047363, 0.00036673247814178467, 0.054899632930755615, -0.2183641493320465, -0.28116899728775024, -0.18298906087875366, 0.24225813150405884, 0.09259156882762909, -0.25359195470809937, 0.17036613821983337, 0.0303623266518116, -0.22968453168869019, 0.28095200657844543, 0.3193264901638031, 0.5767746567726135, 0.21581649780273438, 0.36615267395973206, 0.09250257164239883, 0.05168735608458519, 0.17888544499874115, 0.09042195975780487, 0.36525264382362366, 0.47268277406692505, 0.49534448981285095, 0.18124732375144958, 0.06535453349351883, -0.12230437994003296, -0.27844709157943726, -0.1927615851163864, 0.1271558254957199, -0.29729095101356506, 0.6858866214752197, -0.36700639128685, -0.03731998801231384, -0.38561156392097473, 0.14515793323516846, -0.2521495819091797, 0.13652485609054565, 0.2881774306297302, 0.23117130994796753, 0.27045753598213196, -0.7385329008102417, 0.015625659376382828, 0.09784448146820068, 0.1973351538181305, 0.36551433801651, -0.018189389258623123, -0.06113164871931076, 0.09633760154247284, -0.6876359581947327, 0.2753639817237854, 0.01908397302031517, 0.0552307590842247, -0.24654187262058258, -0.16592280566692352, 0.03169354796409607, 0.06631018221378326, 0.005911603569984436, 0.07694993913173676, -0.21926306188106537, -0.26123183965682983, 0.038160644471645355, -0.007692147046327591, -0.10218825936317444, 0.04495412856340408, 0.07196718454360962, -0.44902539253234863, 0.3801150321960449, -0.44360703229904175, -0.048782408237457275, 0.22464075684547424, -0.07538587599992752, -0.026186056435108185, -0.1440148949623108, 0.49324485659599304, 0.1005529835820198, 0.5112240314483643, 0.12986892461776733, 0.043141938745975494, -0.3018602728843689, -0.13398441672325134, -0.2425849735736847, 0.13189370930194855, -0.10363298654556274, 0.2718275487422943, -0.0774872675538063, -0.24107986688613892, -0.3769107460975647, 0.43450823426246643, 0.08869390934705734, -0.513383150100708, -0.24393311142921448, 0.10267475992441177, -0.3314085900783539, 0.2083011418581009, 0.1350538283586502, 0.028670893982052803, -0.23297138512134552, 0.06446456909179688, -0.3771367073059082, -0.5159609317779541, 0.593290388584137, -0.3806721568107605, -0.1650967001914978, -0.3119678497314453, 0.39829787611961365, 0.3860667645931244, -0.3337630033493042, -0.38375574350357056, 0.1210966408252716, 0.2853690981864929, -0.11066802591085434, -0.10271158814430237, 0.03913198783993721, -0.16561415791511536, 0.024602696299552917, -0.1485714465379715, 0.2408539056777954, 0.15691165626049042, -0.4241068661212921, 0.3962043523788452, -0.13980840146541595 ]
https://github.com/huggingface/datasets/issues/5968
Addressed in: * `mozilla-foundation/common_voice_1_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_1_0/discussions/4) * `mozilla-foundation/common_voice_2_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_2_0/discussions/3) * `mozilla-foundation/common_voice_3_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_3_0/discussions/3) * `mozilla-foundation/common_voice_4_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_4_0/discussions/3) * `mozilla-foundation/common_voice_5_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_5_0/discussions/3) * `mozilla-foundation/common_voice_5_1` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_5_1/discussions/3) * `mozilla-foundation/common_voice_6_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_6_0/discussions/3) * `mozilla-foundation/common_voice_6_1` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1/discussions/3) * `mozilla-foundation/common_voice_7_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0/discussions/3) * `mozilla-foundation/common_voice_8_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0/discussions/7) * `mozilla-foundation/common_voice_9_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_9_0/discussions/8) * `mozilla-foundation/common_voice_10_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_10_0/discussions/7)
Common Voice datasets still need `use_auth_token=True`
### Describe the bug We don't need to pass `use_auth_token=True` anymore to download gated datasets or models, so the following should work if correctly logged in. ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` However it throws an error - probably because something weird is hardcoded into the dataset loading script. ### Steps to reproduce the bug 1.) ``` huggingface-cli login ``` 2.) Make sure that you have accepted the license here: https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1 3.) Run: ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` 4.) You'll get: ``` File ~/hf/lib/python3.10/site-packages/datasets/builder.py:963, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 961 split_dict = SplitDict(dataset_name=self.name) 962 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 963 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 965 # Checksums verification 966 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_6_1/f4d7854c466f5bd4908988dbd39044ec4fc634d89e0515ab0c51715c0127ffe3/common_voice_6_1.py:150, in CommonVoice._split_generators(self, dl_manager) 148 hf_auth_token = dl_manager.download_config.use_auth_token 149 if hf_auth_token is None: --> 150 raise ConnectionError( 151 "Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset" 152 ) 154 bundle_url_template = STATS["bundleURLTemplate"] 155 bundle_version = bundle_url_template.split("/")[0] ConnectionError: Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset ``` ### Expected behavior One should not have to pass `use_auth_token=True`. Also see discussion here: https://github.com/huggingface/blog/pull/1243#discussion_r1235131150 ### Environment info ``` - `datasets` version: 2.13.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 ```
38
Common Voice datasets still need `use_auth_token=True` ### Describe the bug We don't need to pass `use_auth_token=True` anymore to download gated datasets or models, so the following should work if correctly logged in. ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` However it throws an error - probably because something weird is hardcoded into the dataset loading script. ### Steps to reproduce the bug 1.) ``` huggingface-cli login ``` 2.) Make sure that you have accepted the license here: https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1 3.) Run: ```py from datasets import load_dataset load_dataset("mozilla-foundation/common_voice_6_1", "tr", split="train+validation") ``` 4.) You'll get: ``` File ~/hf/lib/python3.10/site-packages/datasets/builder.py:963, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 961 split_dict = SplitDict(dataset_name=self.name) 962 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 963 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 965 # Checksums verification 966 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_6_1/f4d7854c466f5bd4908988dbd39044ec4fc634d89e0515ab0c51715c0127ffe3/common_voice_6_1.py:150, in CommonVoice._split_generators(self, dl_manager) 148 hf_auth_token = dl_manager.download_config.use_auth_token 149 if hf_auth_token is None: --> 150 raise ConnectionError( 151 "Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset" 152 ) 154 bundle_url_template = STATS["bundleURLTemplate"] 155 bundle_version = bundle_url_template.split("/")[0] ConnectionError: Please set use_auth_token=True or use_auth_token='<TOKEN>' to download this dataset ``` ### Expected behavior One should not have to pass `use_auth_token=True`. Also see discussion here: https://github.com/huggingface/blog/pull/1243#discussion_r1235131150 ### Environment info ``` - `datasets` version: 2.13.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 ``` Addressed in: * `mozilla-foundation/common_voice_1_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_1_0/discussions/4) * `mozilla-foundation/common_voice_2_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_2_0/discussions/3) * `mozilla-foundation/common_voice_3_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_3_0/discussions/3) * `mozilla-foundation/common_voice_4_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_4_0/discussions/3) * `mozilla-foundation/common_voice_5_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_5_0/discussions/3) * `mozilla-foundation/common_voice_5_1` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_5_1/discussions/3) * `mozilla-foundation/common_voice_6_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_6_0/discussions/3) * `mozilla-foundation/common_voice_6_1` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_6_1/discussions/3) * `mozilla-foundation/common_voice_7_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_7_0/discussions/3) * `mozilla-foundation/common_voice_8_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0/discussions/7) * `mozilla-foundation/common_voice_9_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_9_0/discussions/8) * `mozilla-foundation/common_voice_10_0` [PR](https://huggingface.co/datasets/mozilla-foundation/common_voice_10_0/discussions/7)
[ -0.19967004656791687, 0.01185956597328186, 0.1525600701570511, -0.005796443670988083, 0.44708141684532166, 0.05265425145626068, 0.5136598348617554, 0.12041813135147095, 0.031704775989055634, -0.047319553792476654, -0.5297954678535461, 0.042947519570589066, 0.03492205962538719, -0.029982902109622955, 0.02069898694753647, 0.140645369887352, 0.058938007801771164, -0.10698094964027405, 0.07509633898735046, -0.12610048055648804, -0.17410755157470703, 0.15782491862773895, -0.26827472448349, 0.20281097292900085, -0.28944504261016846, -0.15474799275398254, 0.09749960899353027, 0.35906782746315, 0.03130515664815903, -0.2894136905670166, 0.3442499339580536, 0.3093809187412262, 0.07892784476280212, 0.24943889677524567, -0.00011565391469048336, 0.13892391324043274, 0.20841443538665771, -0.17052355408668518, -0.2634650766849518, -0.22062858939170837, -0.16799363493919373, 0.19017404317855835, -0.03443882614374161, 0.018202126026153564, 0.04138040542602539, -0.2771683931350708, -0.08910606801509857, -0.4667785167694092, 0.7673097848892212, 0.4816017150878906, 0.14320015907287598, 0.20158404111862183, 0.035703226923942566, -0.0999787300825119, -0.13640069961547852, 0.1118389293551445, 0.00770607590675354, 0.45517873764038086, 0.2252427637577057, -0.06973040848970413, 0.23236820101737976, 0.18818828463554382, -0.13062840700149536, -0.1564839482307434, 0.4328203797340393, -0.13590538501739502, -0.3640206456184387, -0.44513532519340515, -0.0068957265466451645, 0.3984825015068054, 0.08575945347547531, -0.27323976159095764, -0.27649611234664917, -0.2705610990524292, 0.02598080411553383, 0.04118582606315613, 0.14899860322475433, 0.2440682202577591, -0.20735692977905273, 0.33277377486228943, -0.361224889755249, -0.11593429744243622, 0.07403186708688736, 0.01667175628244877, 0.10027708113193512, 0.3666422963142395, 0.06504841148853302, 0.12149947881698608, 0.2157701551914215, -0.06989678740501404, -0.07613345980644226, 0.031321462243795395, -0.06653743982315063, 0.275959312915802, -0.089149609208107, 0.0509636253118515, -0.06763744354248047, 0.0341670848429203, 0.42344430088996887, 0.07835085690021515, -0.2892245948314667, 0.031509771943092346, -0.22601068019866943, 0.024575751274824142, 0.030801162123680115, 0.20403525233268738, 0.1898018717765808, 0.17540007829666138, 0.3190698027610779, 0.30236467719078064, 0.13143125176429749, -0.03444486856460571, -0.08615478128194809, -0.004106730222702026, -0.038888685405254364, 0.001300683245062828, 0.2891808748245239, -0.1982976794242859, -0.33598896861076355, 0.025808177888393402, -0.2545510232448578, -0.02693682350218296, 0.18037855625152588, 0.560332715511322, 0.03483711555600166, -0.04685142636299133, 0.03888477385044098, 0.2961576581001282, -0.11830524355173111, -0.43817174434661865, -0.11431090533733368, -0.17002452909946442, -0.057733204215765, 0.15411311388015747, 0.18270570039749146, -0.505229651927948, 0.22740712761878967, 0.12611627578735352, 0.14066429436206818, -0.08463562279939651, -0.11264503002166748, 0.17380522191524506, 0.07481817901134491, 0.1452641785144806, 0.09010869264602661, 0.2137690633535385, 0.2449711114168167, -0.13199235498905182, -0.20265743136405945, 0.0652339980006218, -0.30444660782814026, -0.42688682675361633, 0.04217514395713806, 0.11779534071683884, -0.28430283069610596, -0.11914898455142975, 0.14616604149341583, 0.02629419043660164, 0.18836599588394165, -0.22172889113426208, 0.05738404393196106, -0.17395660281181335, -0.32233643531799316, 0.06878077238798141, 0.3510397970676422, 0.45562654733657837, -0.1206042617559433, -0.3489544987678528, -0.13473913073539734, -0.3133920133113861, 0.031409233808517456, 0.19831551611423492, -0.31044766306877136, 0.12080340087413788, -0.2684648633003235, 0.42273563146591187, 0.3624856770038605, -0.5514575242996216, -0.6021081209182739, 0.18462719023227692, 0.1446058601140976, 0.18325749039649963, 0.08488781750202179, -0.17177429795265198, 0.19754937291145325, 0.06572525203227997, 0.17060551047325134, 0.3689936697483063, 0.14093159139156342, 0.10046331584453583, -0.06605411320924759, -0.32099321484565735, 0.16932354867458344, 0.12405697256326675, -0.10097286105155945, 0.17603106796741486, 0.26679763197898865, 0.023715917021036148, 0.470065712928772, -0.06798118352890015, 0.014472909271717072, 0.012035086750984192, 0.3619646430015564, -0.12593869864940643, 0.029019121080636978, -0.01592504233121872, -0.36445295810699463, 0.2727113962173462, 0.02543114870786667, 0.2714279890060425, -0.2721702456474304, -0.3569618761539459, -0.4229493737220764, -0.009531717747449875, -0.4269677698612213, -0.1738620400428772, -0.06345422565937042, -0.02861565724015236, -0.030212007462978363, 0.06766931712627411, -0.0870416909456253, 0.3223363161087036, -0.026391364634037018, 0.2965121567249298, 0.005536902695894241, 0.10166740417480469, -0.06268048286437988, 0.047805242240428925, -0.024524718523025513, 0.17669424414634705, 0.20490360260009766, 0.0039154402911663055, -0.12771345674991608, 0.5666518807411194, -0.11672592163085938, 0.1716209203004837, -0.4950207769870758, 0.05301810801029205, 0.15459248423576355, -0.21098746359348297, -0.045613713562488556, 0.2166626751422882, 0.04825930669903755, 0.027266107499599457, -0.03503024950623512, 0.49335694313049316, 0.42567598819732666, 0.10818266868591309, 0.010802850127220154, 0.23293906450271606, 0.17597199976444244, -0.016100727021694183, -0.09042464196681976, -0.2206849604845047, 0.09842120856046677, -0.1780942976474762, 0.2690635025501251, -0.06360124051570892, -0.12641823291778564, 0.009929187595844269, 0.5413870215415955, -0.00404907763004303, 0.23355719447135925, -0.03538290783762932, -0.12833762168884277, -0.019539259374141693, 0.3000519275665283, 0.15062624216079712, 0.42970001697540283, 0.08026917278766632, -0.011373776942491531, 0.4063607454299927, -0.04235214367508888, -0.2325873076915741, 0.26402854919433594, -0.004372194409370422, -0.21981889009475708, 0.04341185465455055, -0.06802770495414734, -0.0570935495197773, -0.5199130773544312, -0.29388079047203064, -0.04429648816585541, 0.09537127614021301, -0.6486205458641052, 0.12149602174758911, -0.2761078476905823, 0.015122219920158386, -0.08642220497131348, -0.04416355490684509, -0.42319726943969727, -0.2736916244029999, -0.026466570794582367, 0.2257348597049713, 0.13003858923912048, 0.4081447720527649, -0.4250074625015259, 0.23459777235984802, -0.025327276438474655, -0.11869999766349792, -0.15359902381896973, 0.06970024108886719, -0.30035102367401123, -0.0025765523314476013, 0.40417301654815674, -0.1604374200105667, -0.006615267135202885, -0.11793000996112823, -0.03689539059996605, -0.25702154636383057, -0.20097704231739044, 0.19872763752937317, -0.12010831385850906, 0.30650782585144043, -0.038975249975919724, -0.10216690599918365, 0.20781664550304413, -0.07300888746976852, 0.115040123462677, -0.06600146740674973, -0.21517488360404968, 0.006825804710388184, -0.12549205124378204, -0.05413605272769928, -0.3875771760940552, -0.33228057622909546, -0.13555337488651276, -0.3437674343585968, 0.2194879949092865, -0.18652716279029846, 0.05617879703640938, 0.4111565351486206, 0.08236406743526459, 0.11105424910783768, -0.47452470660209656, 0.22359080612659454, -0.3340977132320404, -0.3026641011238098, 0.30157172679901123, -0.11320185661315918, -0.30772751569747925, -0.0317305251955986, -0.04493163153529167, 0.42570412158966064, 0.014717597514390945, -0.2878663241863251, -0.1312905251979828, -0.2188817709684372, 0.29502931237220764, -0.09061183035373688, 0.0923524796962738, 0.1756124347448349, -0.010370764881372452, 0.09061378240585327, -0.06147883087396622, 0.013962127268314362, 0.04504911229014397, -0.16222265362739563, 0.19522109627723694, -0.08335364609956741, 0.441736102104187, 0.015525341033935547, 0.8501541614532471, 0.19012995064258575, 0.09351074695587158, 0.294450581073761, -0.23492217063903809, 0.5599885582923889, -0.08920568227767944, -0.3922698199748993, 0.05138399451971054, 0.11191724985837936, 0.20929783582687378, 0.24674835801124573, 0.06897705793380737, 0.14829054474830627, -0.2345919907093048, -0.21000200510025024, -0.016956105828285217, -0.40014633536338806, -0.17632408440113068, 0.0051288846880197525, 0.12115645408630371, 0.2561870217323303, 0.5062915086746216, 0.033355146646499634, -0.1631016880273819, 0.21697944402694702, 0.25714829564094543, 0.0018925219774246216, 0.14376932382583618, -0.25208598375320435, 0.15048736333847046, -0.3330167531967163, 0.2986648976802826, 0.09876100718975067, 0.36866524815559387, -0.21233999729156494, -0.19410398602485657, 0.08047991991043091, 0.12260137498378754, 0.2642045021057129, 0.11692120134830475, 0.11307935416698456, -0.15154318511486053, 0.22230657935142517, -0.26481354236602783, -0.13444574177265167, 0.0025172159075737, -0.3443145751953125, 0.5452451109886169, 0.2977007329463959, -0.2791062295436859, -0.07800813019275665, -0.2144424170255661, -0.01828676089644432, -0.15181465446949005, -0.09318764507770538, -0.33406028151512146, -0.3505459427833557, -0.6033843755722046, 0.1947292983531952, 0.2134242057800293, 0.14876136183738708, -0.31903767585754395, 0.07938310503959656, 0.15556547045707703, -0.2729765474796295, 0.3246963918209076, 0.2341059446334839, 0.06229731813073158, 0.013998456299304962, 0.26318493485450745, 0.3190914988517761, -0.03266526013612747, 0.036495380103588104, 0.7873034477233887, 0.1961086541414261, -0.484924852848053, -0.20225144922733307, 0.14487236738204956, 0.27517762780189514, 0.4503690302371979, -0.14811839163303375, 0.028916742652654648, 0.6284186244010925, 0.07694374024868011, 0.011515352874994278, 0.20114967226982117, 0.2624666094779968, -0.003424178808927536, -0.2714434862136841, -0.36012697219848633, 0.03732620179653168, -0.08375657349824905, -0.1033983826637268, 0.07546475529670715, 0.29165351390838623, -0.2175339162349701, -0.13652315735816956, -0.2748097777366638, 1.0740822553634644, 0.19549718499183655, 0.4446520209312439, 0.5033267140388489, 0.035273127257823944, 0.1428411602973938, -0.1079191267490387, 0.029965147376060486, -0.10831599682569504, -0.032280586659908295, -0.09906089305877686, -0.08670470118522644, 0.035906173288822174, -0.10297088325023651, -0.1062215268611908, 0.29958394169807434, -0.09211347997188568, 0.13099931180477142, 0.24259167909622192, 0.3117241859436035, -0.5273445248603821, -0.14761026203632355, 0.11428151279687881, 0.06708908081054688, 0.05443103611469269, 0.386206716299057, -0.0187368281185627, -0.2319929599761963, -0.131217822432518, -0.4715614914894104, -0.2218976765871048, 0.36954784393310547, -0.31387975811958313, 0.18511170148849487, 0.3833577334880829, 0.17527516186237335, 0.48324018716812134, 0.12556883692741394, 0.25657346844673157, 0.1694881021976471, -0.37781932950019836, 0.2259274274110794, 0.134969562292099, -0.031000783666968346, 0.04857867956161499, 0.04221276938915253, 0.5060519576072693, -0.04554877430200577, -0.3122697174549103, -0.03264486789703369, -0.04569873586297035, -0.2386971414089203, -0.5057772994041443, 0.0069265831261873245, 0.1470494270324707, -0.5170873999595642, 0.07442943751811981, -0.03889122232794762, 0.2722443640232086, -0.2112111747264862, 0.033083442598581314, 0.08952032029628754, -0.0114128477871418, -0.04733961820602417, 0.06289035081863403, -0.1749088168144226, -0.12594351172447205, 0.3988235294818878, -0.17835009098052979, -0.0011376366019248962, 0.6932650208473206, -0.026089437305927277, -0.10399647802114487, -0.12633077800273895, -0.11838871240615845, 0.29085657000541687, -0.4218575656414032, 0.013024337589740753, 0.04177026450634003, -0.05383977293968201, -0.3729829788208008, 0.3259011507034302, -0.06062483415007591, 0.07396170496940613, 0.17957749962806702, -0.3744766116142273, -0.3701027035713196, 0.053916968405246735, -0.20053108036518097, -0.004915802739560604, 0.02701779454946518, 0.3099624812602997, -0.062499403953552246, -0.06647781282663345, -0.2518196105957031, 0.06220293790102005, 0.13959181308746338, -0.17382435500621796, 0.31369227170944214, -0.12835149466991425, 0.14822274446487427, -0.03977813944220543, 0.047632165253162384, 0.14752721786499023, -0.2290404736995697, -0.12589918076992035, -0.4106469452381134, 0.18540973961353302, 0.20939311385154724, -0.32747897505760193, 0.11082451045513153, 0.020648352801799774, -0.24978107213974, -0.05869697034358978, 0.18140581250190735, 0.3759949207305908, 0.07538434863090515, -0.0791526734828949, 0.04726308211684227, 0.27551913261413574, -0.0920572355389595, -0.011704080738127232, -0.18151041865348816, 0.029789544641971588, 0.05531870573759079, 0.14910517632961273, -0.37387552857398987, -0.038201361894607544, -0.2721814513206482, 0.17634044587612152, 0.47769126296043396, 0.13782621920108795, 0.3850650489330292, -0.02648300677537918, -0.06083045154809952, 0.07602570950984955, 0.329637348651886, 0.2874133884906769, -0.2876240015029907, -0.02011191099882126, 0.3103315830230713, 0.12153342366218567, -0.38855212926864624, -0.0007527396082878113, -0.1648004651069641, -0.025443365797400475, -0.0707038938999176, 0.2017575353384018, -0.03242775797843933, -0.08234524726867676, 0.10291893035173416, -0.14491626620292664, 0.145528182387352, 0.3210325837135315, 0.18805381655693054, 0.10194934904575348, -0.26014453172683716, 0.04655827581882477, 0.5241184830665588, -0.19081999361515045, 0.13957339525222778, 0.21581587195396423, -0.6616795063018799, 0.15115143358707428, -0.17693880200386047, 0.1171235740184784, 0.37080997228622437, -0.4541515111923218, -0.03340763598680496, -0.21037952601909637, -0.23558998107910156, -0.13418050110340118, -0.18206757307052612, 0.6025288701057434, -0.28915682435035706, -0.17018423974514008, -0.25215330719947815, 0.40415897965431213, -0.17790618538856506, -0.09773402661085129, 0.02894199639558792, -0.2053396999835968, -0.1671108603477478, -0.004730328917503357, -0.03921293094754219, -0.38948559761047363, 0.00036673247814178467, 0.054899632930755615, -0.2183641493320465, -0.28116899728775024, -0.18298906087875366, 0.24225813150405884, 0.09259156882762909, -0.25359195470809937, 0.17036613821983337, 0.0303623266518116, -0.22968453168869019, 0.28095200657844543, 0.3193264901638031, 0.5767746567726135, 0.21581649780273438, 0.36615267395973206, 0.09250257164239883, 0.05168735608458519, 0.17888544499874115, 0.09042195975780487, 0.36525264382362366, 0.47268277406692505, 0.49534448981285095, 0.18124732375144958, 0.06535453349351883, -0.12230437994003296, -0.27844709157943726, -0.1927615851163864, 0.1271558254957199, -0.29729095101356506, 0.6858866214752197, -0.36700639128685, -0.03731998801231384, -0.38561156392097473, 0.14515793323516846, -0.2521495819091797, 0.13652485609054565, 0.2881774306297302, 0.23117130994796753, 0.27045753598213196, -0.7385329008102417, 0.015625659376382828, 0.09784448146820068, 0.1973351538181305, 0.36551433801651, -0.018189389258623123, -0.06113164871931076, 0.09633760154247284, -0.6876359581947327, 0.2753639817237854, 0.01908397302031517, 0.0552307590842247, -0.24654187262058258, -0.16592280566692352, 0.03169354796409607, 0.06631018221378326, 0.005911603569984436, 0.07694993913173676, -0.21926306188106537, -0.26123183965682983, 0.038160644471645355, -0.007692147046327591, -0.10218825936317444, 0.04495412856340408, 0.07196718454360962, -0.44902539253234863, 0.3801150321960449, -0.44360703229904175, -0.048782408237457275, 0.22464075684547424, -0.07538587599992752, -0.026186056435108185, -0.1440148949623108, 0.49324485659599304, 0.1005529835820198, 0.5112240314483643, 0.12986892461776733, 0.043141938745975494, -0.3018602728843689, -0.13398441672325134, -0.2425849735736847, 0.13189370930194855, -0.10363298654556274, 0.2718275487422943, -0.0774872675538063, -0.24107986688613892, -0.3769107460975647, 0.43450823426246643, 0.08869390934705734, -0.513383150100708, -0.24393311142921448, 0.10267475992441177, -0.3314085900783539, 0.2083011418581009, 0.1350538283586502, 0.028670893982052803, -0.23297138512134552, 0.06446456909179688, -0.3771367073059082, -0.5159609317779541, 0.593290388584137, -0.3806721568107605, -0.1650967001914978, -0.3119678497314453, 0.39829787611961365, 0.3860667645931244, -0.3337630033493042, -0.38375574350357056, 0.1210966408252716, 0.2853690981864929, -0.11066802591085434, -0.10271158814430237, 0.03913198783993721, -0.16561415791511536, 0.024602696299552917, -0.1485714465379715, 0.2408539056777954, 0.15691165626049042, -0.4241068661212921, 0.3962043523788452, -0.13980840146541595 ]
https://github.com/huggingface/datasets/issues/5967
This must be due to DatasetInfo.from_merge which drops them and is used in `concatenate_datasets`. And you're experiencing this issue because multiprocessing does concatenate the resulting datasets from each process. Maybe they should be kept if all the subdatasets share the same values for config_name and split
Config name / split name lost after map with multiproc
### Describe the bug Performing a `.map` method on a dataset loses it's config name / split name only if run with multiproc ### Steps to reproduce the bug ```python from datasets import Audio, load_dataset from transformers import AutoFeatureExtractor import numpy as np # load dummy dataset libri = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean") # make train / test splits libri = libri["validation"].train_test_split(seed=42, shuffle=True, test_size=0.1) # example feature extractor model_id = "ntu-spml/distilhubert" feature_extractor = AutoFeatureExtractor.from_pretrained(model_id, do_normalize=True, return_attention_mask=True) sampling_rate = feature_extractor.sampling_rate libri = libri.cast_column("audio", Audio(sampling_rate=sampling_rate)) max_duration = 30.0 def preprocess_function(examples): audio_arrays = [x["array"] for x in examples["audio"]] inputs = feature_extractor( audio_arrays, sampling_rate=feature_extractor.sampling_rate, max_length=int(feature_extractor.sampling_rate * max_duration), truncation=True, return_attention_mask=True, ) return inputs # single proc map libri_encoded = libri.map( preprocess_function, remove_columns=["audio", "file"], batched=True, num_proc=1 ) print(10 * "=" ,"Single processing", 10 * "=") print("Config name before: ", libri["train"].config_name, " Split name before: ", libri["train"].split) print("Config name after: ", libri_encoded["train"].config_name, " Split name after: ", libri_encoded["train"].split) # multi proc map libri_encoded = libri.map( preprocess_function, remove_columns=["audio", "file"], batched=True, num_proc=2 ) print(10 * "=" ,"Multi processing", 10 * "=") print("Config name before: ", libri["train"].config_name, " Split name before: ", libri["train"].split) print("Config name after: ", libri_encoded["train"].config_name, " Split name after: ", libri_encoded["train"].split) ``` **Print Output:** ``` ========== Single processing ========== Config name before: clean Split name before: validation Config name after: clean Split name after: validation ========== Multi processing ========== Config name before: clean Split name before: validation Config name after: None Split name after: None ``` => we can see that the config/split names are lost in the multiprocessing setting ### Expected behavior Should retain both config / split names in the multiproc setting ### Environment info - `datasets` version: 2.13.1.dev0 - Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
46
Config name / split name lost after map with multiproc ### Describe the bug Performing a `.map` method on a dataset loses it's config name / split name only if run with multiproc ### Steps to reproduce the bug ```python from datasets import Audio, load_dataset from transformers import AutoFeatureExtractor import numpy as np # load dummy dataset libri = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean") # make train / test splits libri = libri["validation"].train_test_split(seed=42, shuffle=True, test_size=0.1) # example feature extractor model_id = "ntu-spml/distilhubert" feature_extractor = AutoFeatureExtractor.from_pretrained(model_id, do_normalize=True, return_attention_mask=True) sampling_rate = feature_extractor.sampling_rate libri = libri.cast_column("audio", Audio(sampling_rate=sampling_rate)) max_duration = 30.0 def preprocess_function(examples): audio_arrays = [x["array"] for x in examples["audio"]] inputs = feature_extractor( audio_arrays, sampling_rate=feature_extractor.sampling_rate, max_length=int(feature_extractor.sampling_rate * max_duration), truncation=True, return_attention_mask=True, ) return inputs # single proc map libri_encoded = libri.map( preprocess_function, remove_columns=["audio", "file"], batched=True, num_proc=1 ) print(10 * "=" ,"Single processing", 10 * "=") print("Config name before: ", libri["train"].config_name, " Split name before: ", libri["train"].split) print("Config name after: ", libri_encoded["train"].config_name, " Split name after: ", libri_encoded["train"].split) # multi proc map libri_encoded = libri.map( preprocess_function, remove_columns=["audio", "file"], batched=True, num_proc=2 ) print(10 * "=" ,"Multi processing", 10 * "=") print("Config name before: ", libri["train"].config_name, " Split name before: ", libri["train"].split) print("Config name after: ", libri_encoded["train"].config_name, " Split name after: ", libri_encoded["train"].split) ``` **Print Output:** ``` ========== Single processing ========== Config name before: clean Split name before: validation Config name after: clean Split name after: validation ========== Multi processing ========== Config name before: clean Split name before: validation Config name after: None Split name after: None ``` => we can see that the config/split names are lost in the multiprocessing setting ### Expected behavior Should retain both config / split names in the multiproc setting ### Environment info - `datasets` version: 2.13.1.dev0 - Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 This must be due to DatasetInfo.from_merge which drops them and is used in `concatenate_datasets`. And you're experiencing this issue because multiprocessing does concatenate the resulting datasets from each process. Maybe they should be kept if all the subdatasets share the same values for config_name and split
[ -0.3114316463470459, -0.3305574655532837, 0.0021502934396266937, 0.09281058609485626, 0.29288220405578613, -0.11196547001600266, 0.59432053565979, 0.13082531094551086, -0.08384830504655838, 0.6229397058486938, 0.04151308536529541, 0.5787537097930908, -0.13195489346981049, 0.30740639567375183, -0.07507695257663727, -0.061750590801239014, -0.09710538387298584, -0.05591646209359169, 0.09768274426460266, -0.0052314698696136475, -0.1347939819097519, 0.18270370364189148, -0.36322176456451416, 0.19126081466674805, -0.4240999221801758, 0.07106433808803558, -0.07250963896512985, 0.16130925714969635, 0.261799693107605, -0.1584635078907013, -0.012004375457763672, -0.22846931219100952, -0.1707535684108734, 0.44365596771240234, -0.00011207081115571782, -0.04711224138736725, 0.1709091067314148, -0.17416304349899292, 0.19318825006484985, -0.028944626450538635, -0.35838764905929565, 0.1876598596572876, -0.1462670862674713, -0.33918505907058716, -0.14593060314655304, 0.3824138641357422, -0.1860712170600891, -0.43799424171447754, -0.06199813261628151, 0.1661083996295929, 0.23286072909832, 0.1553596407175064, -0.14405441284179688, 0.04784039407968521, -0.03900229558348656, 0.019553687423467636, -0.12594448029994965, -0.12415363639593124, 0.024082928895950317, -0.20917364954948425, -0.036657340824604034, 0.36285555362701416, -0.07661306858062744, -0.07666809856891632, -0.2732625901699066, -0.034177735447883606, 0.007048644125461578, -0.4120888113975525, 0.23202528059482574, 0.14820869266986847, -0.10643041133880615, -0.2535122036933899, -0.01729496382176876, -0.03664351999759674, 0.0337395966053009, -0.19189706444740295, 0.00943770445883274, 0.027865279465913773, -0.008490107953548431, -0.04240152984857559, -0.31236955523490906, -0.040473584085702896, 0.17416608333587646, -0.03438050299882889, -0.085528165102005, 0.43796679377555847, -0.010209672152996063, 0.3469558656215668, 0.10514050722122192, -0.05091000348329544, -0.2000030130147934, -0.07784275710582733, 0.042198460549116135, 0.15269427001476288, -0.09991168975830078, -0.16487208008766174, 0.07929766923189163, -0.4276772141456604, -0.1676013469696045, -0.20689231157302856, -0.13359060883522034, 0.036179929971694946, 0.03015841171145439, 0.2850860059261322, 0.07478715479373932, -0.0640106350183487, 0.23253485560417175, 0.4675109386444092, 0.13546040654182434, 0.007148325443267822, -0.290712833404541, -0.024348903447389603, 0.3928108811378479, -0.06647465378046036, 0.022998884320259094, 0.15475451946258545, 0.0960620641708374, -0.17573228478431702, -0.17199338972568512, -0.034088607877492905, -0.42008572816848755, -0.07457338273525238, 0.15495148301124573, 0.21955855190753937, 0.23812676966190338, 0.3076168894767761, -0.033384181559085846, 0.014388542622327805, -0.2197837233543396, 0.05965656414628029, -0.28423744440078735, -0.11894580721855164, -0.23556222021579742, 0.2310391366481781, 0.08211769163608551, 0.04397974908351898, 0.3553106188774109, -0.07203394919633865, -0.08337875455617905, -0.3352762758731842, -0.044855453073978424, 0.018165044486522675, 0.2500622868537903, 0.19846762716770172, -0.08304233849048615, 0.052153974771499634, -0.15309929847717285, -0.1483474224805832, -0.11560018360614777, -0.02707844227552414, -0.31544262170791626, -0.17614279687404633, 0.07359111309051514, 0.27296677231788635, 0.14094087481498718, 0.35270196199417114, 0.21190574765205383, -0.02409418672323227, 0.4831635653972626, -0.13257575035095215, 0.15816113352775574, -0.17023465037345886, -0.25157585740089417, -0.15766267478466034, 0.10577606409788132, 0.06209409236907959, 0.10244636237621307, -0.2997228503227234, 0.03461616486310959, -0.02060369960963726, 0.2227770835161209, 0.035672418773174286, -0.09572432935237885, 0.1441728174686432, -0.09502013027667999, 0.4506304860115051, 0.20565368235111237, -0.2909029424190521, -0.12640315294265747, 0.22875967621803284, -0.2928469181060791, 0.0733630508184433, -0.014492519199848175, -0.3018265664577484, 0.10952853411436081, -0.037644162774086, 0.3874124586582184, 0.21082857251167297, -0.08257663249969482, 0.20443984866142273, -0.1953854262828827, -0.29730504751205444, -0.317438006401062, -0.08449909090995789, 0.13046123087406158, 0.09567919373512268, 0.20875073969364166, -0.12517938017845154, 0.6217349171638489, -0.03561874479055405, 0.2007397711277008, 0.28084978461265564, 0.12019114941358566, -0.06580977141857147, -0.10279086232185364, -0.4304737448692322, -0.14459875226020813, 0.08793488889932632, -0.014770746231079102, -0.12332380563020706, 0.023478727787733078, -0.2028573453426361, 0.15068092942237854, -0.0972052738070488, -0.10835328698158264, -0.37693923711776733, 0.12968581914901733, 0.4743819236755371, -0.349452942609787, -0.25730809569358826, 0.07857908308506012, 0.17160403728485107, 0.3702518939971924, -0.13133057951927185, -0.32364755868911743, 0.17834849655628204, -0.07882646471261978, -0.17156746983528137, -0.28656256198883057, 0.3531739413738251, 0.2506336569786072, -0.02052253484725952, -0.23921117186546326, 0.5454875230789185, 0.21645709872245789, -0.15690182149410248, -0.16024476289749146, -0.15596430003643036, 0.11722581088542938, -0.17815393209457397, -0.009177465923130512, 0.07692397385835648, 0.09295978397130966, -0.16547584533691406, -0.023172322660684586, 0.31896576285362244, 0.20712225139141083, 0.15132054686546326, 0.004177667200565338, 0.13609948754310608, 0.08691227436065674, -0.12535983324050903, 0.11823906749486923, -0.31324052810668945, -0.2641686499118805, -0.0018234774470329285, 0.17096945643424988, 0.10589229315519333, -0.2744395136833191, -0.03168225288391113, 0.7665879726409912, -0.04950304329395294, -0.27993959188461304, -0.22416408360004425, -0.15869396924972534, 0.04475819319486618, 0.22105707228183746, 0.24561259150505066, 0.5302677750587463, 0.17067107558250427, -0.07036155462265015, -0.19068175554275513, -0.17511685192584991, -0.010966062545776367, 0.17983773350715637, 0.04574819281697273, 0.2970397472381592, 0.1747438907623291, 0.16124922037124634, -0.04150504991412163, -0.07682065665721893, -0.32563942670822144, 0.24134036898612976, -0.1852225512266159, -0.2557970881462097, 0.17759111523628235, -0.11934172362089157, 0.427058607339859, -0.2022610902786255, -0.4261833727359772, -0.07344740629196167, -0.23688173294067383, -0.09705837070941925, 0.1688043624162674, -0.34315186738967896, 0.33084356784820557, 0.0036187171936035156, -0.324154257774353, -0.07489021867513657, -0.344942182302475, 0.19808802008628845, 0.09739701449871063, -0.23216676712036133, 0.001218903809785843, -0.08761851489543915, -0.2161574810743332, 0.03598860651254654, 0.3346642851829529, -0.38968855142593384, -0.20235751569271088, -0.013673000037670135, 0.1807127296924591, -0.010323084890842438, 0.0925842672586441, 0.04162618890404701, -0.2797577679157257, 0.1626218557357788, -0.5951725840568542, 0.11847736686468124, 0.001515306532382965, 0.022146202623844147, 0.11199571192264557, 0.22140614688396454, -0.16661342978477478, -0.42094290256500244, -0.434907466173172, -0.2603777348995209, -0.1785244345664978, 0.19903862476348877, -0.30291664600372314, 0.19271034002304077, 0.2740100026130676, -0.07459894567728043, 0.0685957819223404, -0.1371595561504364, -0.08321975916624069, -0.3433581590652466, 0.04115474224090576, -0.1259213387966156, -0.18998916447162628, 0.098337322473526, -0.23750674724578857, -0.022201847285032272, 0.11268305778503418, 0.22509723901748657, -0.0945788025856018, 0.10970564931631088, -0.014723481610417366, 0.30003267526626587, 0.17931827902793884, 0.11007390916347504, 0.3949924111366272, 0.4789348542690277, -0.12602537870407104, -0.18554863333702087, -0.2967078685760498, 0.26271796226501465, 0.21895918250083923, 0.2459661364555359, 0.052257709205150604, -0.07995258271694183, -0.11580446362495422, 0.500769853591919, 0.2118545025587082, -0.21906396746635437, 0.0650186836719513, -0.17945247888565063, -0.13480544090270996, -0.21548771858215332, -0.34580886363983154, 0.07493554055690765, -0.17748388648033142, 0.009540736675262451, 0.19887179136276245, -0.028631433844566345, -0.5573024749755859, -0.024059627205133438, 0.2607627809047699, -0.21212947368621826, -0.4175105392932892, -0.07489963620901108, -0.03479579836130142, 0.25590255856513977, 0.09693147242069244, 0.2685827612876892, -0.08252398669719696, 0.10862869024276733, 0.09295571595430374, -0.1604698747396469, -0.17303377389907837, -0.3231145739555359, -0.4141862392425537, -0.12492085993289948, -0.08002085238695145, 0.3220698833465576, 0.21576352417469025, 0.364543080329895, -0.12114425003528595, -0.3216428756713867, -0.06946639716625214, 0.1585582196712494, 0.4073804020881653, -0.4188511073589325, 0.07418375462293625, 0.3782845437526703, 0.22355619072914124, 0.10126694291830063, -0.2628272771835327, -0.3129294514656067, 0.27249521017074585, 0.4753219485282898, 0.5593694448471069, 0.0031739622354507446, -0.3458525538444519, 0.4115965962409973, -0.003398790955543518, 0.02523346245288849, 0.2671124041080475, -0.089415043592453, -0.05508888512849808, 0.01300308108329773, -0.027146901935338974, -0.11036641895771027, 0.21281486749649048, -0.17453807592391968, -0.2602199614048004, 0.1958460509777069, -0.20294705033302307, 0.10354817658662796, 0.11760126054286957, 0.22615709900856018, 0.07893051207065582, 0.24237105250358582, -0.02969277650117874, 0.17400789260864258, 0.05362675338983536, 0.22448524832725525, -0.41261282563209534, -0.002139899879693985, 0.23516115546226501, -0.15842339396476746, 0.4650293290615082, 0.36983275413513184, 0.04127557575702667, 0.07456822693347931, -0.05713832378387451, 0.5412480235099792, -0.16332237422466278, 0.1194613128900528, 0.40044549107551575, 0.2495657056570053, -0.15795311331748962, -0.23462674021720886, 0.25286898016929626, 0.06221231818199158, -0.30342936515808105, 0.5142503380775452, -0.2793354094028473, -0.3818325400352478, 0.4123767912387848, -0.27372363209724426, 0.6523391008377075, 0.06447330862283707, -0.048536334186792374, 0.0005214568227529526, -0.12173116207122803, -0.24826227128505707, -0.09908697009086609, 0.20903241634368896, -0.1713547706604004, -0.07658383995294571, 0.09227164089679718, -0.0630669891834259, 0.20011083781719208, 0.279356986284256, -0.336116760969162, 0.3477392792701721, 0.09093613922595978, 0.18017925322055817, 0.01219794899225235, -0.017111219465732574, 0.25025296211242676, -0.4420279860496521, 0.1904531568288803, 0.07118698209524155, 0.059942685067653656, 0.15537060797214508, 0.23483802378177643, -0.07894428819417953, 0.16361072659492493, -0.2586476504802704, -0.1114119365811348, 0.31956392526626587, -0.5948031544685364, 0.21893662214279175, -0.0036174338310956955, 0.15469671785831451, -0.01893598958849907, 0.21688984334468842, -0.3163885176181793, 0.34165602922439575, -0.0323026217520237, 0.16292554140090942, 0.4881926476955414, 0.412760853767395, 0.04620286077260971, -0.07049768418073654, 0.3014472424983978, 0.14974194765090942, -0.43448102474212646, 0.1056353747844696, -0.14343632757663727, 0.00023583322763442993, 0.027171596884727478, 0.18200251460075378, 0.22267849743366241, -0.3984694480895996, 0.09558209031820297, 0.2115599364042282, 0.07969580590724945, -0.27658557891845703, 0.1487923562526703, -0.11759990453720093, -0.5439035892486572, 0.46280285716056824, -0.1107938289642334, -0.3251751661300659, -0.07013779878616333, 0.22892417013645172, 0.0541265606880188, 0.15496090054512024, 0.16307573020458221, -0.2966604232788086, -0.06681767851114273, -0.33405521512031555, 0.04797030985355377, -0.2513708472251892, -0.1003129854798317, -0.049852173775434494, -0.08908256888389587, -0.4859747290611267, 0.10188714414834976, -0.06820601224899292, -0.15005144476890564, 0.3670768141746521, -0.3248288035392761, -0.16470377147197723, -0.2483949214220047, 0.014401309192180634, -0.08318573981523514, 0.2143678367137909, -0.017551638185977936, 0.5040220022201538, -0.06293497234582901, 0.32849812507629395, -0.3257564902305603, 0.16056561470031738, -0.15681570768356323, 0.5510057210922241, 0.017687667161226273, -0.014450548216700554, 0.22639207541942596, -0.21015921235084534, 0.3344839811325073, -0.03217248618602753, -0.05196335166692734, -0.21500486135482788, -0.25965458154678345, 0.041508764028549194, -0.15244540572166443, 0.12930136919021606, -0.005451776087284088, 0.05091217905282974, -0.08703365921974182, -0.30370065569877625, 0.25080573558807373, 0.256786048412323, 0.0413140244781971, 0.33260807394981384, 0.12818622589111328, -0.20600059628486633, 0.1097312867641449, 0.06716601550579071, -0.14384666085243225, 0.07799376547336578, -0.028121571987867355, 0.3763413429260254, -0.31007111072540283, -0.0858796238899231, -0.12439627945423126, -0.16769671440124512, -0.24506354331970215, 0.32462605834007263, 0.05801434814929962, -0.07504580914974213, -0.29225224256515503, 0.032597824931144714, 0.15538504719734192, 0.014781343750655651, -0.20012401044368744, -0.1405077874660492, 0.06405356526374817, 0.31921640038490295, -0.12836472690105438, -0.1968589425086975, 0.10340633988380432, -0.10140350461006165, 0.32141461968421936, 0.3332046866416931, -0.02705145627260208, -0.059579744935035706, 0.0609666183590889, 0.02516724169254303, -0.17861995100975037, 0.0012375600636005402, 0.21375733613967896, 0.4601649045944214, -0.049785714596509933, 0.22651150822639465, 0.1930004060268402, -0.1865159124135971, 0.052912209182977676, 0.4079936742782593, 0.3107633888721466, 0.25682681798934937, 0.11297404766082764, -0.034420695155858994, 0.20294196903705597, -0.2822921872138977, -0.06854808330535889, -0.10118179023265839, -0.44932761788368225, 0.44228869676589966, 0.07166840136051178, 0.2390093207359314, -0.46801304817199707, -0.260303795337677, 0.15454143285751343, 0.29727157950401306, -0.29520243406295776, -0.3123868703842163, 0.25304657220840454, -0.038830965757369995, -0.10793142020702362, 0.07458774000406265, 0.2944086790084839, 0.33237314224243164, 1.0903176069259644, 0.08352653682231903, -0.04952266812324524, 0.2520178556442261, -0.2791768014431, 0.12799017131328583, 0.43594691157341003, -0.3676645755767822, 0.28737160563468933, -0.0958399623632431, 0.052380114793777466, -0.13823282718658447, -0.014571359381079674, 0.1922547072172165, -0.06302988529205322, -0.11354197561740875, -0.00535598024725914, 0.1858096867799759, -0.10059930384159088, 0.04262491688132286, -0.05115272104740143, 0.10883025825023651, -0.03430798277258873, 0.21224886178970337, 0.1702980250120163, -0.17734655737876892, -0.17136968672275543, 0.38008713722229004, 0.27650734782218933, -0.16090619564056396, 0.4408351182937622, 0.054584894329309464, -0.3453037142753601, -0.05800178274512291, -0.1495789885520935, -0.41530919075012207, 0.0374702624976635, 0.45765888690948486, -0.27448776364326477, 0.44366079568862915, 0.15498630702495575, 0.08364985138177872, 0.0601809024810791, 0.09318224340677261, -0.11356526613235474, -0.10811245441436768, -0.25064027309417725, -0.16012969613075256, -0.14420750737190247, -0.1593005508184433, -0.04033180698752403, -0.06357685476541519, -0.10788872838020325, 0.18283845484256744, 0.05919273942708969, -0.16622376441955566, 0.1526075154542923, -0.2385891079902649, 0.3655460476875305, 0.39302051067352295, -0.5613922476768494, -0.029050420969724655, -0.15241041779518127, 0.10538987815380096, 0.4545225203037262, -0.6810576319694519, 0.05484948307275772, 0.08395490050315857, 0.08062246441841125, -0.045136675238609314, -0.05469377711415291, 0.21007633209228516, 0.03841877728700638, 0.2979159951210022, 0.004547014832496643, 0.18285241723060608, -0.4457201063632965, -0.11970654129981995, -0.016378115862607956, 0.07530172169208527, -0.05862327665090561, -0.20186078548431396, 0.1986900418996811, 0.39218464493751526, -0.025948017835617065, 0.19128838181495667, -0.25206315517425537, 0.08724594116210938, 0.14274828135967255, 0.07628048956394196, -0.21565333008766174, 0.132594034075737, 0.010181620717048645, 0.12023492902517319, 0.014796759933233261, 0.45298564434051514, -0.15637324750423431, 0.23479138314723969, -0.13598541915416718, -0.41634371876716614, 0.6493306159973145, 0.05638131499290466, -0.36834925413131714, -0.2659912407398224, 0.546818733215332, -0.27326643466949463, 0.04149729758501053, -0.5601427555084229, -0.22092965245246887, 0.3590870797634125, -0.1025194376707077, -0.6033438444137573, 0.023712992668151855, -0.05007690563797951, -0.11060620844364166, 0.06052829325199127, 0.3215143382549286, 0.2018677145242691, -0.36171600222587585, 0.2860015630722046, 0.016084633767604828 ]
https://github.com/huggingface/datasets/issues/5965
Thanks for reporting! Specifying the target features explicitly should avoid this error: ```python dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, features=datasets.Features({"texts": datasets.Sequence(datasets.Value("string"))}) ) ``` This error stems from our type promotion not handling the nested case. But this promotion/casting allocates memory in most scenarios, which can be problematic for large datasets, so explicitly passing the features is the optimal solution.
"Couldn't cast array of type" in complex datasets
### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux
61
"Couldn't cast array of type" in complex datasets ### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux Thanks for reporting! Specifying the target features explicitly should avoid this error: ```python dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, features=datasets.Features({"texts": datasets.Sequence(datasets.Value("string"))}) ) ``` This error stems from our type promotion not handling the nested case. But this promotion/casting allocates memory in most scenarios, which can be problematic for large datasets, so explicitly passing the features is the optimal solution.
[ -0.3982987403869629, -0.056902915239334106, -0.04033725708723068, 0.17765331268310547, 0.4318235218524933, 0.226649209856987, 0.33259859681129456, 0.3314976692199707, 0.3767266571521759, -0.019378453493118286, 0.023040346801280975, 0.3431892991065979, -0.15088258683681488, 0.02486550062894821, 0.030931346118450165, -0.08824338763952255, 0.1402876079082489, 0.19609206914901733, -0.21512819826602936, -0.0379830002784729, -0.22037731111049652, -0.06677928566932678, -0.3868851959705353, -0.019873347133398056, 0.08640722930431366, -0.3364105522632599, -0.14185653626918793, -0.12421470880508423, -0.109559066593647, -0.3847695291042328, 0.3289003074169159, -0.3240495026111603, 0.15686433017253876, 0.2976699471473694, -0.00011155125685036182, 0.15764425694942474, 0.3483608365058899, 0.03217849135398865, -0.18421384692192078, -0.12119806557893753, -0.3748065233230591, -0.2226884663105011, -0.15669165551662445, -0.30277490615844727, 0.08711588382720947, -0.07472194731235504, -0.0405162051320076, -0.36844900250434875, -0.16893471777439117, 0.1778658628463745, 0.18865826725959778, 0.4982253611087799, 0.001331821084022522, -0.18427890539169312, 0.15275107324123383, 0.06477850675582886, -0.19486723840236664, -0.12267559766769409, 0.3001418113708496, 0.15865236520767212, 0.049949489533901215, -0.0008362457156181335, -0.4528648853302002, -0.21816276013851166, 0.13382597267627716, -0.04392268881201744, 0.2762894332408905, -0.2904151678085327, -0.16900116205215454, 0.12227438390254974, 0.3683268427848816, -0.2635713219642639, -0.27735140919685364, -0.2502695918083191, -0.17474466562271118, 0.09625483304262161, -0.0472911037504673, 0.04677427560091019, 0.02491239458322525, 0.1941068172454834, -0.35565072298049927, 0.3164064586162567, 0.10977998375892639, 0.22104117274284363, -0.0005164816975593567, 0.015657790005207062, 0.09858265519142151, 0.17983630299568176, -0.09532910585403442, -0.22516269981861115, 0.16425921022891998, -0.512212336063385, -0.09868593513965607, 0.2980858087539673, -0.08567561209201813, -0.11584607511758804, 0.22477544844150543, 0.008556710556149483, 0.23935183882713318, -0.17544062435626984, 0.0351397879421711, 0.004304293543100357, 0.07433326542377472, 0.1809624284505844, 0.5464469194412231, 0.1034679114818573, 0.038617536425590515, 0.013715539127588272, 0.022139765322208405, -0.1252303123474121, -0.018902823328971863, 0.027756474912166595, 0.042470552027225494, -0.025236496701836586, 0.1958099603652954, 0.12534478306770325, 0.2855916917324066, -0.017526082694530487, -0.21408125758171082, 0.14586272835731506, -0.4794706702232361, 0.19877389073371887, 0.21111521124839783, 0.2570607364177704, 0.04072047397494316, 0.39586660265922546, 0.041635364294052124, 0.1814596951007843, -0.050427619367837906, -0.23049655556678772, -0.2001199722290039, -0.18854689598083496, -0.3150932192802429, -0.327295184135437, 0.04260431230068207, 0.14476490020751953, 0.06247798353433609, 0.14164116978645325, -0.2240636944770813, 0.08633221685886383, -0.10320782661437988, -0.16692803800106049, 0.2768693268299103, 0.3331468999385834, 0.22188574075698853, 0.2902708649635315, 0.2477274090051651, -0.060666218400001526, -0.1569904237985611, 0.36035099625587463, -0.18982625007629395, -0.19694110751152039, -0.04336240887641907, 0.18081527948379517, -0.2734302282333374, 0.07437343895435333, -0.7257806062698364, 0.03204706311225891, 0.4068147838115692, -0.2675914168357849, 0.03590206429362297, -0.3142436742782593, 0.18733753263950348, -0.36399343609809875, -0.043999023735523224, 0.18830570578575134, -0.2290777713060379, 0.1614474058151245, -0.2298705279827118, -0.11316490173339844, 0.08068488538265228, 0.4565396308898926, -0.15648867189884186, 0.4134402871131897, -0.36763638257980347, 0.4682583808898926, 0.20694765448570251, 0.057995155453681946, -0.2253406047821045, 0.21765737235546112, 0.27750369906425476, 0.17585860192775726, -0.19049933552742004, 0.20880012214183807, 0.30955207347869873, -0.34630921483039856, -0.1501530259847641, 0.3266209065914154, -0.34921586513519287, 0.2300003618001938, -0.3290557265281677, -0.07702210545539856, 0.27066493034362793, -0.05439186468720436, 0.19699309766292572, 0.3359839916229248, 0.056673794984817505, 0.021988246589899063, 0.22061967849731445, -0.28354477882385254, 0.2941349446773529, 0.05711391568183899, 0.3532875180244446, 0.053560566157102585, 0.0018459223210811615, -0.35053277015686035, -0.5408236384391785, 0.19890838861465454, -0.06351905316114426, 0.09549213200807571, -0.07192058861255646, -0.16940352320671082, -0.0684572160243988, 0.14434939622879028, -0.0926864743232727, 0.3304100036621094, 0.12883150577545166, -0.06020374223589897, -0.025532152503728867, -0.12558820843696594, -0.036221615970134735, -0.17406877875328064, -0.1351386308670044, -0.1767245978116989, -0.2640955448150635, 0.22010363638401031, -0.18869131803512573, -0.22206830978393555, -0.28137636184692383, 0.04833296686410904, 0.21039673686027527, -0.03408260643482208, 0.00847514346241951, 0.2208159863948822, -0.0831628292798996, -0.1552075892686844, -0.23698651790618896, 0.24950285255908966, -0.16290901601314545, -0.3530406355857849, -0.11512929946184158, 0.262494295835495, 0.31696614623069763, -0.16256988048553467, 0.02505609765648842, 0.3321639895439148, 0.015203826129436493, 0.21822687983512878, -0.2330925166606903, 0.20974797010421753, 0.32370901107788086, -0.04380853474140167, -0.02371900901198387, -0.16451823711395264, -0.11386561393737793, 0.0021903738379478455, 0.053669609129428864, 0.1220487430691719, -0.25387656688690186, 0.04448121786117554, 0.31824421882629395, -0.19456559419631958, 0.23211772739887238, -0.036331452429294586, -0.0012292545288801193, 0.06682445108890533, 0.10088945180177689, -0.0417683944106102, 0.2667433023452759, 0.12491428852081299, -0.09167841821908951, -0.02759157493710518, -0.0643002986907959, 0.1151653379201889, 0.3590776026248932, 0.05846445634961128, 0.34441468119621277, -0.0757916271686554, 0.10292542725801468, 0.10597537457942963, -0.06792401522397995, -0.24811935424804688, 0.20804138481616974, 0.28620025515556335, -0.4603844881057739, 0.06866594403982162, -0.2398962378501892, 0.008067376911640167, -0.04891368746757507, 0.015595827251672745, 0.07336428016424179, -0.43566733598709106, -0.22127757966518402, 0.3823997378349304, -0.386979341506958, 0.2557774782180786, -0.21470968425273895, 0.09878389537334442, 0.1520710289478302, -0.17822185158729553, -0.39671123027801514, -0.08081930875778198, -0.08192029595375061, 0.044527944177389145, 0.5053490400314331, -0.1465427279472351, 0.16515494883060455, 0.09142126142978668, -0.034938618540763855, -0.2427101731300354, -0.2758493721485138, 0.02650311030447483, -0.28776735067367554, 0.06291761249303818, 0.33538681268692017, 0.38200846314430237, -0.08209699392318726, -0.1669592261314392, 0.30184119939804077, -0.3575623631477356, -0.37481871247291565, 0.2896735668182373, -0.116573266685009, -0.38777485489845276, -0.31132858991622925, -0.12563592195510864, -0.1846807599067688, -0.3401942253112793, 0.004580322653055191, -0.3655581474304199, -0.06664726138114929, 0.2010815143585205, 0.34997111558914185, 0.008739400655031204, 0.0061373524367809296, -0.30537015199661255, -0.11062337458133698, 0.17287473380565643, 0.33982402086257935, -0.04823129251599312, -0.2551821768283844, -0.0031362920999526978, -0.23245353996753693, 0.04834708943963051, 0.19947372376918793, -0.2912505269050598, 0.3903251588344574, -0.20016242563724518, 0.3545483350753784, 0.09132079780101776, -0.05769835412502289, 0.30536070466041565, 0.22115537524223328, 0.0018109269440174103, -0.39140796661376953, -0.08785904198884964, -0.036621395498514175, 0.046249814331531525, 0.2069655954837799, 0.059425000101327896, 0.43292292952537537, 0.17165300250053406, 0.3451787829399109, 0.1391526162624359, -0.2561638355255127, 0.2966752350330353, -0.09590905159711838, 0.24117502570152283, -0.215684175491333, -0.20542483031749725, -0.04469863697886467, -0.03260383754968643, -0.28616371750831604, -0.03020920604467392, -0.33809927105903625, -0.6134926676750183, 0.24391692876815796, 0.07117816060781479, -0.2568027973175049, -0.20462888479232788, 0.3733392357826233, -0.25057148933410645, 0.1204986646771431, 0.1377401053905487, -0.06091131269931793, -0.2960360050201416, -0.07747794687747955, -0.005701005458831787, -0.13155189156532288, 0.07353672385215759, 0.036194074898958206, -0.2893303632736206, -0.20725545287132263, -0.05393987521529198, 0.27963417768478394, 0.20374621450901031, 0.38638484477996826, 0.031423419713974, -0.04342394694685936, -0.11047393083572388, 0.08160261064767838, 0.7921385169029236, -0.39298442006111145, 0.14109638333320618, 0.2259669303894043, 0.32780784368515015, -0.36489158868789673, -0.03387800604104996, -0.16061124205589294, 0.373187780380249, 0.26526394486427307, 0.14528335630893707, -0.34966379404067993, 0.14138448238372803, -0.043402962386608124, 0.16774150729179382, -0.020194165408611298, 0.04426625370979309, -0.04156561568379402, -0.4001169800758362, -0.10157015919685364, 0.05187298730015755, 0.5569097995758057, 0.22003579139709473, -0.021162262186408043, -0.04793953523039818, -0.4475386142730713, 0.23431043326854706, 0.03368663042783737, 0.06676948815584183, 0.4606055021286011, -0.07812359929084778, 0.33061492443084717, -0.43427830934524536, -0.005042671225965023, 0.4487893581390381, 0.5028223395347595, 0.0015918053686618805, -0.09510795772075653, 0.21875329315662384, 0.013008277863264084, 0.3109695017337799, 0.05222172290086746, -0.036374546587467194, -0.06927533447742462, 0.2546387016773224, 0.16816608607769012, -0.07594215124845505, -0.15308497846126556, 0.2868950664997101, 0.05230031535029411, -0.5290563106536865, -0.4393804669380188, 0.263996958732605, 0.0988554060459137, -0.038070909678936005, 0.1012265682220459, 0.020654678344726562, -0.3764946758747101, 0.6231356859207153, 0.2331874817609787, 0.8570387959480286, -0.13991576433181763, 0.11338158696889877, 0.434704452753067, 0.20373527705669403, 0.18643468618392944, 0.29275277256965637, 0.08603661507368088, -0.4036332368850708, 0.1858527511358261, -0.009298939257860184, -0.07320259511470795, 0.15319788455963135, 0.3547826111316681, -0.3052141070365906, -0.0429764948785305, -0.03547216206789017, 0.49276962876319885, 0.09732798486948013, -0.11662915349006653, -0.06578738987445831, -0.21919840574264526, -0.4653312861919403, 0.18437457084655762, 0.10790395736694336, -0.15328861773014069, -0.024001087993383408, -0.29261499643325806, -0.1892489194869995, -0.12670695781707764, -0.2633209824562073, 0.12289249897003174, -0.13717103004455566, 0.2635822892189026, 0.19767826795578003, -0.04010068625211716, 0.18671123683452606, 0.28177592158317566, -0.011911556124687195, 0.05887261778116226, -0.06841938197612762, 0.04976760223507881, 0.2763684391975403, 0.1378067582845688, 0.17823560535907745, -0.1554277539253235, 0.3335948884487152, 0.10343031585216522, -0.11654114723205566, -0.042432062327861786, -0.2606746554374695, -0.16936302185058594, -0.05391262471675873, 0.19822333753108978, -0.03360472992062569, -0.5134413242340088, -0.43101298809051514, -0.05766822770237923, 0.10860860347747803, -0.024187736213207245, 0.10693781077861786, 0.07315242290496826, -0.06758035719394684, 0.5152415037155151, -0.2272104173898697, -0.057447969913482666, 0.11995400488376617, 0.2368398904800415, 0.13043418526649475, 0.11298222839832306, 0.2691706418991089, 0.0787447839975357, -0.14622467756271362, -0.18547675013542175, 0.22807544469833374, 0.17025698721408844, -0.6268270611763, 0.28532421588897705, -0.22607216238975525, -0.281514972448349, 0.12994402647018433, 0.5647776126861572, -0.038800887763500214, 0.14722010493278503, -0.28669461607933044, -0.2581219971179962, -0.14387044310569763, 0.32035890221595764, 0.14955121278762817, 0.31182053685188293, 0.1740947812795639, 0.3910980522632599, -0.084974005818367, -0.3364950120449066, -0.3306780457496643, -0.08370102941989899, -0.3653358221054077, 0.3747389614582062, -0.3797122836112976, 0.08809370547533035, 0.13554474711418152, -0.2086508572101593, 0.1021478995680809, 0.09957754611968994, -0.11996546387672424, -0.18154248595237732, -0.061579033732414246, 0.10408526659011841, 0.19200952351093292, 0.02446673810482025, 0.12907612323760986, -0.2266404628753662, -0.17619848251342773, -0.27655157446861267, -0.01240679994225502, 0.34281283617019653, -0.08613291382789612, -0.051978424191474915, 0.2773022949695587, 0.014348537661135197, -0.20551608502864838, 0.19514861702919006, -0.17365820705890656, -0.1987898200750351, -0.08971795439720154, 0.2787747383117676, -0.004116430878639221, 0.04851283133029938, 0.18986621499061584, 0.1933051347732544, 0.13979603350162506, 0.16200311481952667, 0.6201661825180054, -0.2460731863975525, 0.006964176893234253, 0.4891505539417267, 0.32078486680984497, -0.10628718882799149, -0.2443944811820984, -0.09618747234344482, 0.06621943414211273, 0.220779150724411, -0.26681041717529297, 0.07451401650905609, 0.2116241455078125, 0.0633547306060791, 0.11466547846794128, 0.3049684762954712, 0.03134237974882126, -0.22549253702163696, 0.11020886898040771, -0.03560440242290497, 0.804750919342041, -0.1278124451637268, 0.1441962718963623, 0.3858983516693115, -0.039545319974422455, 0.1377418041229248, 0.09140068292617798, -0.0014338335022330284, 0.2678656578063965, 0.5077898502349854, 0.04669533669948578, 0.1312389224767685, 0.14515820145606995, 0.021943744271993637, 0.05296783149242401, -0.3793625235557556, 0.18708719313144684, 0.15021756291389465, 0.0376092791557312, 0.26007694005966187, 0.06966671347618103, 0.11003565788269043, -0.26797619462013245, -0.3534982204437256, -0.033430516719818115, 0.13536830246448517, -0.4147183299064636, 0.12655109167099, -0.4492883086204529, -0.07004908472299576, 0.17844420671463013, -0.34349989891052246, -0.06520458310842514, -0.17704057693481445, 0.423014372587204, 0.0519959032535553, 0.03814677894115448, -0.14747826755046844, -0.18330168724060059, 0.19445130228996277, 0.19034765660762787, -0.19141356647014618, 0.24775591492652893, 0.03816705942153931, -0.2569960653781891, 0.0538765974342823, 0.5058435797691345, 0.6003215909004211, 0.46662938594818115, 0.14306940138339996, 0.16333317756652832, 0.08396898955106735, -0.2258443534374237, -0.28061625361442566, 0.07999658584594727, 0.0500953383743763, 0.10744686424732208, 0.1527133285999298, 0.1523427963256836, -0.08534291386604309, 0.0698494017124176, -0.018180837854743004, 0.3027918338775635, 0.17889131605625153, 0.20201325416564941, -0.23856976628303528, -0.23859132826328278, -0.09789760410785675, -0.0966721773147583, -0.21609637141227722, -0.34657421708106995, 0.48196956515312195, -0.24431084096431732, 0.32318079471588135, 0.012395936995744705, 0.0847049430012703, 0.14766491949558258, 0.2906337380409241, 0.3246777653694153, 0.0026642391458153725, -0.3329249322414398, 0.1036299616098404, -0.43882331252098083, 0.13640016317367554, -0.33357661962509155, 0.004996664822101593, 0.18725888431072235, 0.24207386374473572, 0.07708404213190079, -0.1252610981464386, 0.09895539283752441, 0.038350075483322144, -0.11781831085681915, 0.4823516309261322, -0.09766297787427902, -0.2804936468601227, -0.12634603679180145, -0.049829088151454926, 0.03644523024559021, -0.47979289293289185, 0.12275025993585587, 0.06383199989795685, 0.16820240020751953, -0.06094773858785629, -0.005656421184539795, 0.025599271059036255, -0.18348726630210876, 0.24833442270755768, 0.17448751628398895, 0.29592788219451904, -0.1202162355184555, -0.2224520444869995, -0.2851911783218384, -0.3099729120731354, -0.2603844702243805, 0.18987739086151123, -0.06458305567502975, 0.3302714228630066, -0.3455328345298767, 0.3046518564224243, -0.11808350682258606, -0.2871019244194031, 0.18697485327720642, 0.2234266698360443, -0.37496262788772583, 0.45886293053627014, -0.6828261017799377, 0.2715597152709961, -0.013537220656871796, 0.19759584963321686, 0.0575597807765007, 0.28697603940963745, -0.23323839902877808, -0.48941195011138916, 0.511699914932251, -0.46994897723197937, -0.32210829854011536, 0.019145265221595764, -0.1411757469177246, -0.4306701719760895, -0.0983462855219841, -0.48194175958633423, -0.368624210357666, 0.19970965385437012, -0.0676918625831604, -0.17573580145835876, -0.144771546125412, 0.0006744787096977234, 0.0587681382894516, -0.20465554296970367, 0.2614613473415375, 0.04153263568878174, -0.29364851117134094, 0.17603687942028046, -0.30459490418434143 ]
https://github.com/huggingface/datasets/issues/5965
Hi @mariosasko thanks for the context, this is helpful to know. Would it be worth having some logic to generate this explicit feature specification automatically if a type annotation for a .map returns a dataclass that can be inferred? Feels like something that would be easy to implement and could save memory / deal with this case in a standardized way.
"Couldn't cast array of type" in complex datasets
### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux
61
"Couldn't cast array of type" in complex datasets ### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux Hi @mariosasko thanks for the context, this is helpful to know. Would it be worth having some logic to generate this explicit feature specification automatically if a type annotation for a .map returns a dataclass that can be inferred? Feels like something that would be easy to implement and could save memory / deal with this case in a standardized way.
[ -0.3982987403869629, -0.056902915239334106, -0.04033725708723068, 0.17765331268310547, 0.4318235218524933, 0.226649209856987, 0.33259859681129456, 0.3314976692199707, 0.3767266571521759, -0.019378453493118286, 0.023040346801280975, 0.3431892991065979, -0.15088258683681488, 0.02486550062894821, 0.030931346118450165, -0.08824338763952255, 0.1402876079082489, 0.19609206914901733, -0.21512819826602936, -0.0379830002784729, -0.22037731111049652, -0.06677928566932678, -0.3868851959705353, -0.019873347133398056, 0.08640722930431366, -0.3364105522632599, -0.14185653626918793, -0.12421470880508423, -0.109559066593647, -0.3847695291042328, 0.3289003074169159, -0.3240495026111603, 0.15686433017253876, 0.2976699471473694, -0.00011155125685036182, 0.15764425694942474, 0.3483608365058899, 0.03217849135398865, -0.18421384692192078, -0.12119806557893753, -0.3748065233230591, -0.2226884663105011, -0.15669165551662445, -0.30277490615844727, 0.08711588382720947, -0.07472194731235504, -0.0405162051320076, -0.36844900250434875, -0.16893471777439117, 0.1778658628463745, 0.18865826725959778, 0.4982253611087799, 0.001331821084022522, -0.18427890539169312, 0.15275107324123383, 0.06477850675582886, -0.19486723840236664, -0.12267559766769409, 0.3001418113708496, 0.15865236520767212, 0.049949489533901215, -0.0008362457156181335, -0.4528648853302002, -0.21816276013851166, 0.13382597267627716, -0.04392268881201744, 0.2762894332408905, -0.2904151678085327, -0.16900116205215454, 0.12227438390254974, 0.3683268427848816, -0.2635713219642639, -0.27735140919685364, -0.2502695918083191, -0.17474466562271118, 0.09625483304262161, -0.0472911037504673, 0.04677427560091019, 0.02491239458322525, 0.1941068172454834, -0.35565072298049927, 0.3164064586162567, 0.10977998375892639, 0.22104117274284363, -0.0005164816975593567, 0.015657790005207062, 0.09858265519142151, 0.17983630299568176, -0.09532910585403442, -0.22516269981861115, 0.16425921022891998, -0.512212336063385, -0.09868593513965607, 0.2980858087539673, -0.08567561209201813, -0.11584607511758804, 0.22477544844150543, 0.008556710556149483, 0.23935183882713318, -0.17544062435626984, 0.0351397879421711, 0.004304293543100357, 0.07433326542377472, 0.1809624284505844, 0.5464469194412231, 0.1034679114818573, 0.038617536425590515, 0.013715539127588272, 0.022139765322208405, -0.1252303123474121, -0.018902823328971863, 0.027756474912166595, 0.042470552027225494, -0.025236496701836586, 0.1958099603652954, 0.12534478306770325, 0.2855916917324066, -0.017526082694530487, -0.21408125758171082, 0.14586272835731506, -0.4794706702232361, 0.19877389073371887, 0.21111521124839783, 0.2570607364177704, 0.04072047397494316, 0.39586660265922546, 0.041635364294052124, 0.1814596951007843, -0.050427619367837906, -0.23049655556678772, -0.2001199722290039, -0.18854689598083496, -0.3150932192802429, -0.327295184135437, 0.04260431230068207, 0.14476490020751953, 0.06247798353433609, 0.14164116978645325, -0.2240636944770813, 0.08633221685886383, -0.10320782661437988, -0.16692803800106049, 0.2768693268299103, 0.3331468999385834, 0.22188574075698853, 0.2902708649635315, 0.2477274090051651, -0.060666218400001526, -0.1569904237985611, 0.36035099625587463, -0.18982625007629395, -0.19694110751152039, -0.04336240887641907, 0.18081527948379517, -0.2734302282333374, 0.07437343895435333, -0.7257806062698364, 0.03204706311225891, 0.4068147838115692, -0.2675914168357849, 0.03590206429362297, -0.3142436742782593, 0.18733753263950348, -0.36399343609809875, -0.043999023735523224, 0.18830570578575134, -0.2290777713060379, 0.1614474058151245, -0.2298705279827118, -0.11316490173339844, 0.08068488538265228, 0.4565396308898926, -0.15648867189884186, 0.4134402871131897, -0.36763638257980347, 0.4682583808898926, 0.20694765448570251, 0.057995155453681946, -0.2253406047821045, 0.21765737235546112, 0.27750369906425476, 0.17585860192775726, -0.19049933552742004, 0.20880012214183807, 0.30955207347869873, -0.34630921483039856, -0.1501530259847641, 0.3266209065914154, -0.34921586513519287, 0.2300003618001938, -0.3290557265281677, -0.07702210545539856, 0.27066493034362793, -0.05439186468720436, 0.19699309766292572, 0.3359839916229248, 0.056673794984817505, 0.021988246589899063, 0.22061967849731445, -0.28354477882385254, 0.2941349446773529, 0.05711391568183899, 0.3532875180244446, 0.053560566157102585, 0.0018459223210811615, -0.35053277015686035, -0.5408236384391785, 0.19890838861465454, -0.06351905316114426, 0.09549213200807571, -0.07192058861255646, -0.16940352320671082, -0.0684572160243988, 0.14434939622879028, -0.0926864743232727, 0.3304100036621094, 0.12883150577545166, -0.06020374223589897, -0.025532152503728867, -0.12558820843696594, -0.036221615970134735, -0.17406877875328064, -0.1351386308670044, -0.1767245978116989, -0.2640955448150635, 0.22010363638401031, -0.18869131803512573, -0.22206830978393555, -0.28137636184692383, 0.04833296686410904, 0.21039673686027527, -0.03408260643482208, 0.00847514346241951, 0.2208159863948822, -0.0831628292798996, -0.1552075892686844, -0.23698651790618896, 0.24950285255908966, -0.16290901601314545, -0.3530406355857849, -0.11512929946184158, 0.262494295835495, 0.31696614623069763, -0.16256988048553467, 0.02505609765648842, 0.3321639895439148, 0.015203826129436493, 0.21822687983512878, -0.2330925166606903, 0.20974797010421753, 0.32370901107788086, -0.04380853474140167, -0.02371900901198387, -0.16451823711395264, -0.11386561393737793, 0.0021903738379478455, 0.053669609129428864, 0.1220487430691719, -0.25387656688690186, 0.04448121786117554, 0.31824421882629395, -0.19456559419631958, 0.23211772739887238, -0.036331452429294586, -0.0012292545288801193, 0.06682445108890533, 0.10088945180177689, -0.0417683944106102, 0.2667433023452759, 0.12491428852081299, -0.09167841821908951, -0.02759157493710518, -0.0643002986907959, 0.1151653379201889, 0.3590776026248932, 0.05846445634961128, 0.34441468119621277, -0.0757916271686554, 0.10292542725801468, 0.10597537457942963, -0.06792401522397995, -0.24811935424804688, 0.20804138481616974, 0.28620025515556335, -0.4603844881057739, 0.06866594403982162, -0.2398962378501892, 0.008067376911640167, -0.04891368746757507, 0.015595827251672745, 0.07336428016424179, -0.43566733598709106, -0.22127757966518402, 0.3823997378349304, -0.386979341506958, 0.2557774782180786, -0.21470968425273895, 0.09878389537334442, 0.1520710289478302, -0.17822185158729553, -0.39671123027801514, -0.08081930875778198, -0.08192029595375061, 0.044527944177389145, 0.5053490400314331, -0.1465427279472351, 0.16515494883060455, 0.09142126142978668, -0.034938618540763855, -0.2427101731300354, -0.2758493721485138, 0.02650311030447483, -0.28776735067367554, 0.06291761249303818, 0.33538681268692017, 0.38200846314430237, -0.08209699392318726, -0.1669592261314392, 0.30184119939804077, -0.3575623631477356, -0.37481871247291565, 0.2896735668182373, -0.116573266685009, -0.38777485489845276, -0.31132858991622925, -0.12563592195510864, -0.1846807599067688, -0.3401942253112793, 0.004580322653055191, -0.3655581474304199, -0.06664726138114929, 0.2010815143585205, 0.34997111558914185, 0.008739400655031204, 0.0061373524367809296, -0.30537015199661255, -0.11062337458133698, 0.17287473380565643, 0.33982402086257935, -0.04823129251599312, -0.2551821768283844, -0.0031362920999526978, -0.23245353996753693, 0.04834708943963051, 0.19947372376918793, -0.2912505269050598, 0.3903251588344574, -0.20016242563724518, 0.3545483350753784, 0.09132079780101776, -0.05769835412502289, 0.30536070466041565, 0.22115537524223328, 0.0018109269440174103, -0.39140796661376953, -0.08785904198884964, -0.036621395498514175, 0.046249814331531525, 0.2069655954837799, 0.059425000101327896, 0.43292292952537537, 0.17165300250053406, 0.3451787829399109, 0.1391526162624359, -0.2561638355255127, 0.2966752350330353, -0.09590905159711838, 0.24117502570152283, -0.215684175491333, -0.20542483031749725, -0.04469863697886467, -0.03260383754968643, -0.28616371750831604, -0.03020920604467392, -0.33809927105903625, -0.6134926676750183, 0.24391692876815796, 0.07117816060781479, -0.2568027973175049, -0.20462888479232788, 0.3733392357826233, -0.25057148933410645, 0.1204986646771431, 0.1377401053905487, -0.06091131269931793, -0.2960360050201416, -0.07747794687747955, -0.005701005458831787, -0.13155189156532288, 0.07353672385215759, 0.036194074898958206, -0.2893303632736206, -0.20725545287132263, -0.05393987521529198, 0.27963417768478394, 0.20374621450901031, 0.38638484477996826, 0.031423419713974, -0.04342394694685936, -0.11047393083572388, 0.08160261064767838, 0.7921385169029236, -0.39298442006111145, 0.14109638333320618, 0.2259669303894043, 0.32780784368515015, -0.36489158868789673, -0.03387800604104996, -0.16061124205589294, 0.373187780380249, 0.26526394486427307, 0.14528335630893707, -0.34966379404067993, 0.14138448238372803, -0.043402962386608124, 0.16774150729179382, -0.020194165408611298, 0.04426625370979309, -0.04156561568379402, -0.4001169800758362, -0.10157015919685364, 0.05187298730015755, 0.5569097995758057, 0.22003579139709473, -0.021162262186408043, -0.04793953523039818, -0.4475386142730713, 0.23431043326854706, 0.03368663042783737, 0.06676948815584183, 0.4606055021286011, -0.07812359929084778, 0.33061492443084717, -0.43427830934524536, -0.005042671225965023, 0.4487893581390381, 0.5028223395347595, 0.0015918053686618805, -0.09510795772075653, 0.21875329315662384, 0.013008277863264084, 0.3109695017337799, 0.05222172290086746, -0.036374546587467194, -0.06927533447742462, 0.2546387016773224, 0.16816608607769012, -0.07594215124845505, -0.15308497846126556, 0.2868950664997101, 0.05230031535029411, -0.5290563106536865, -0.4393804669380188, 0.263996958732605, 0.0988554060459137, -0.038070909678936005, 0.1012265682220459, 0.020654678344726562, -0.3764946758747101, 0.6231356859207153, 0.2331874817609787, 0.8570387959480286, -0.13991576433181763, 0.11338158696889877, 0.434704452753067, 0.20373527705669403, 0.18643468618392944, 0.29275277256965637, 0.08603661507368088, -0.4036332368850708, 0.1858527511358261, -0.009298939257860184, -0.07320259511470795, 0.15319788455963135, 0.3547826111316681, -0.3052141070365906, -0.0429764948785305, -0.03547216206789017, 0.49276962876319885, 0.09732798486948013, -0.11662915349006653, -0.06578738987445831, -0.21919840574264526, -0.4653312861919403, 0.18437457084655762, 0.10790395736694336, -0.15328861773014069, -0.024001087993383408, -0.29261499643325806, -0.1892489194869995, -0.12670695781707764, -0.2633209824562073, 0.12289249897003174, -0.13717103004455566, 0.2635822892189026, 0.19767826795578003, -0.04010068625211716, 0.18671123683452606, 0.28177592158317566, -0.011911556124687195, 0.05887261778116226, -0.06841938197612762, 0.04976760223507881, 0.2763684391975403, 0.1378067582845688, 0.17823560535907745, -0.1554277539253235, 0.3335948884487152, 0.10343031585216522, -0.11654114723205566, -0.042432062327861786, -0.2606746554374695, -0.16936302185058594, -0.05391262471675873, 0.19822333753108978, -0.03360472992062569, -0.5134413242340088, -0.43101298809051514, -0.05766822770237923, 0.10860860347747803, -0.024187736213207245, 0.10693781077861786, 0.07315242290496826, -0.06758035719394684, 0.5152415037155151, -0.2272104173898697, -0.057447969913482666, 0.11995400488376617, 0.2368398904800415, 0.13043418526649475, 0.11298222839832306, 0.2691706418991089, 0.0787447839975357, -0.14622467756271362, -0.18547675013542175, 0.22807544469833374, 0.17025698721408844, -0.6268270611763, 0.28532421588897705, -0.22607216238975525, -0.281514972448349, 0.12994402647018433, 0.5647776126861572, -0.038800887763500214, 0.14722010493278503, -0.28669461607933044, -0.2581219971179962, -0.14387044310569763, 0.32035890221595764, 0.14955121278762817, 0.31182053685188293, 0.1740947812795639, 0.3910980522632599, -0.084974005818367, -0.3364950120449066, -0.3306780457496643, -0.08370102941989899, -0.3653358221054077, 0.3747389614582062, -0.3797122836112976, 0.08809370547533035, 0.13554474711418152, -0.2086508572101593, 0.1021478995680809, 0.09957754611968994, -0.11996546387672424, -0.18154248595237732, -0.061579033732414246, 0.10408526659011841, 0.19200952351093292, 0.02446673810482025, 0.12907612323760986, -0.2266404628753662, -0.17619848251342773, -0.27655157446861267, -0.01240679994225502, 0.34281283617019653, -0.08613291382789612, -0.051978424191474915, 0.2773022949695587, 0.014348537661135197, -0.20551608502864838, 0.19514861702919006, -0.17365820705890656, -0.1987898200750351, -0.08971795439720154, 0.2787747383117676, -0.004116430878639221, 0.04851283133029938, 0.18986621499061584, 0.1933051347732544, 0.13979603350162506, 0.16200311481952667, 0.6201661825180054, -0.2460731863975525, 0.006964176893234253, 0.4891505539417267, 0.32078486680984497, -0.10628718882799149, -0.2443944811820984, -0.09618747234344482, 0.06621943414211273, 0.220779150724411, -0.26681041717529297, 0.07451401650905609, 0.2116241455078125, 0.0633547306060791, 0.11466547846794128, 0.3049684762954712, 0.03134237974882126, -0.22549253702163696, 0.11020886898040771, -0.03560440242290497, 0.804750919342041, -0.1278124451637268, 0.1441962718963623, 0.3858983516693115, -0.039545319974422455, 0.1377418041229248, 0.09140068292617798, -0.0014338335022330284, 0.2678656578063965, 0.5077898502349854, 0.04669533669948578, 0.1312389224767685, 0.14515820145606995, 0.021943744271993637, 0.05296783149242401, -0.3793625235557556, 0.18708719313144684, 0.15021756291389465, 0.0376092791557312, 0.26007694005966187, 0.06966671347618103, 0.11003565788269043, -0.26797619462013245, -0.3534982204437256, -0.033430516719818115, 0.13536830246448517, -0.4147183299064636, 0.12655109167099, -0.4492883086204529, -0.07004908472299576, 0.17844420671463013, -0.34349989891052246, -0.06520458310842514, -0.17704057693481445, 0.423014372587204, 0.0519959032535553, 0.03814677894115448, -0.14747826755046844, -0.18330168724060059, 0.19445130228996277, 0.19034765660762787, -0.19141356647014618, 0.24775591492652893, 0.03816705942153931, -0.2569960653781891, 0.0538765974342823, 0.5058435797691345, 0.6003215909004211, 0.46662938594818115, 0.14306940138339996, 0.16333317756652832, 0.08396898955106735, -0.2258443534374237, -0.28061625361442566, 0.07999658584594727, 0.0500953383743763, 0.10744686424732208, 0.1527133285999298, 0.1523427963256836, -0.08534291386604309, 0.0698494017124176, -0.018180837854743004, 0.3027918338775635, 0.17889131605625153, 0.20201325416564941, -0.23856976628303528, -0.23859132826328278, -0.09789760410785675, -0.0966721773147583, -0.21609637141227722, -0.34657421708106995, 0.48196956515312195, -0.24431084096431732, 0.32318079471588135, 0.012395936995744705, 0.0847049430012703, 0.14766491949558258, 0.2906337380409241, 0.3246777653694153, 0.0026642391458153725, -0.3329249322414398, 0.1036299616098404, -0.43882331252098083, 0.13640016317367554, -0.33357661962509155, 0.004996664822101593, 0.18725888431072235, 0.24207386374473572, 0.07708404213190079, -0.1252610981464386, 0.09895539283752441, 0.038350075483322144, -0.11781831085681915, 0.4823516309261322, -0.09766297787427902, -0.2804936468601227, -0.12634603679180145, -0.049829088151454926, 0.03644523024559021, -0.47979289293289185, 0.12275025993585587, 0.06383199989795685, 0.16820240020751953, -0.06094773858785629, -0.005656421184539795, 0.025599271059036255, -0.18348726630210876, 0.24833442270755768, 0.17448751628398895, 0.29592788219451904, -0.1202162355184555, -0.2224520444869995, -0.2851911783218384, -0.3099729120731354, -0.2603844702243805, 0.18987739086151123, -0.06458305567502975, 0.3302714228630066, -0.3455328345298767, 0.3046518564224243, -0.11808350682258606, -0.2871019244194031, 0.18697485327720642, 0.2234266698360443, -0.37496262788772583, 0.45886293053627014, -0.6828261017799377, 0.2715597152709961, -0.013537220656871796, 0.19759584963321686, 0.0575597807765007, 0.28697603940963745, -0.23323839902877808, -0.48941195011138916, 0.511699914932251, -0.46994897723197937, -0.32210829854011536, 0.019145265221595764, -0.1411757469177246, -0.4306701719760895, -0.0983462855219841, -0.48194175958633423, -0.368624210357666, 0.19970965385437012, -0.0676918625831604, -0.17573580145835876, -0.144771546125412, 0.0006744787096977234, 0.0587681382894516, -0.20465554296970367, 0.2614613473415375, 0.04153263568878174, -0.29364851117134094, 0.17603687942028046, -0.30459490418434143 ]
https://github.com/huggingface/datasets/issues/5965
> . Would it be worth having some logic to generate this explicit feature specification automatically if a type annotation for a .map returns a dataclass that can be inferred? Interesting proposal! Yes, we could consider doing this if the (return) type hint is `TypedDict`, and raise an error that type hints are incorrect if the cast using the inferred types fails.
"Couldn't cast array of type" in complex datasets
### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux
62
"Couldn't cast array of type" in complex datasets ### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux > . Would it be worth having some logic to generate this explicit feature specification automatically if a type annotation for a .map returns a dataclass that can be inferred? Interesting proposal! Yes, we could consider doing this if the (return) type hint is `TypedDict`, and raise an error that type hints are incorrect if the cast using the inferred types fails.
[ -0.3982987403869629, -0.056902915239334106, -0.04033725708723068, 0.17765331268310547, 0.4318235218524933, 0.226649209856987, 0.33259859681129456, 0.3314976692199707, 0.3767266571521759, -0.019378453493118286, 0.023040346801280975, 0.3431892991065979, -0.15088258683681488, 0.02486550062894821, 0.030931346118450165, -0.08824338763952255, 0.1402876079082489, 0.19609206914901733, -0.21512819826602936, -0.0379830002784729, -0.22037731111049652, -0.06677928566932678, -0.3868851959705353, -0.019873347133398056, 0.08640722930431366, -0.3364105522632599, -0.14185653626918793, -0.12421470880508423, -0.109559066593647, -0.3847695291042328, 0.3289003074169159, -0.3240495026111603, 0.15686433017253876, 0.2976699471473694, -0.00011155125685036182, 0.15764425694942474, 0.3483608365058899, 0.03217849135398865, -0.18421384692192078, -0.12119806557893753, -0.3748065233230591, -0.2226884663105011, -0.15669165551662445, -0.30277490615844727, 0.08711588382720947, -0.07472194731235504, -0.0405162051320076, -0.36844900250434875, -0.16893471777439117, 0.1778658628463745, 0.18865826725959778, 0.4982253611087799, 0.001331821084022522, -0.18427890539169312, 0.15275107324123383, 0.06477850675582886, -0.19486723840236664, -0.12267559766769409, 0.3001418113708496, 0.15865236520767212, 0.049949489533901215, -0.0008362457156181335, -0.4528648853302002, -0.21816276013851166, 0.13382597267627716, -0.04392268881201744, 0.2762894332408905, -0.2904151678085327, -0.16900116205215454, 0.12227438390254974, 0.3683268427848816, -0.2635713219642639, -0.27735140919685364, -0.2502695918083191, -0.17474466562271118, 0.09625483304262161, -0.0472911037504673, 0.04677427560091019, 0.02491239458322525, 0.1941068172454834, -0.35565072298049927, 0.3164064586162567, 0.10977998375892639, 0.22104117274284363, -0.0005164816975593567, 0.015657790005207062, 0.09858265519142151, 0.17983630299568176, -0.09532910585403442, -0.22516269981861115, 0.16425921022891998, -0.512212336063385, -0.09868593513965607, 0.2980858087539673, -0.08567561209201813, -0.11584607511758804, 0.22477544844150543, 0.008556710556149483, 0.23935183882713318, -0.17544062435626984, 0.0351397879421711, 0.004304293543100357, 0.07433326542377472, 0.1809624284505844, 0.5464469194412231, 0.1034679114818573, 0.038617536425590515, 0.013715539127588272, 0.022139765322208405, -0.1252303123474121, -0.018902823328971863, 0.027756474912166595, 0.042470552027225494, -0.025236496701836586, 0.1958099603652954, 0.12534478306770325, 0.2855916917324066, -0.017526082694530487, -0.21408125758171082, 0.14586272835731506, -0.4794706702232361, 0.19877389073371887, 0.21111521124839783, 0.2570607364177704, 0.04072047397494316, 0.39586660265922546, 0.041635364294052124, 0.1814596951007843, -0.050427619367837906, -0.23049655556678772, -0.2001199722290039, -0.18854689598083496, -0.3150932192802429, -0.327295184135437, 0.04260431230068207, 0.14476490020751953, 0.06247798353433609, 0.14164116978645325, -0.2240636944770813, 0.08633221685886383, -0.10320782661437988, -0.16692803800106049, 0.2768693268299103, 0.3331468999385834, 0.22188574075698853, 0.2902708649635315, 0.2477274090051651, -0.060666218400001526, -0.1569904237985611, 0.36035099625587463, -0.18982625007629395, -0.19694110751152039, -0.04336240887641907, 0.18081527948379517, -0.2734302282333374, 0.07437343895435333, -0.7257806062698364, 0.03204706311225891, 0.4068147838115692, -0.2675914168357849, 0.03590206429362297, -0.3142436742782593, 0.18733753263950348, -0.36399343609809875, -0.043999023735523224, 0.18830570578575134, -0.2290777713060379, 0.1614474058151245, -0.2298705279827118, -0.11316490173339844, 0.08068488538265228, 0.4565396308898926, -0.15648867189884186, 0.4134402871131897, -0.36763638257980347, 0.4682583808898926, 0.20694765448570251, 0.057995155453681946, -0.2253406047821045, 0.21765737235546112, 0.27750369906425476, 0.17585860192775726, -0.19049933552742004, 0.20880012214183807, 0.30955207347869873, -0.34630921483039856, -0.1501530259847641, 0.3266209065914154, -0.34921586513519287, 0.2300003618001938, -0.3290557265281677, -0.07702210545539856, 0.27066493034362793, -0.05439186468720436, 0.19699309766292572, 0.3359839916229248, 0.056673794984817505, 0.021988246589899063, 0.22061967849731445, -0.28354477882385254, 0.2941349446773529, 0.05711391568183899, 0.3532875180244446, 0.053560566157102585, 0.0018459223210811615, -0.35053277015686035, -0.5408236384391785, 0.19890838861465454, -0.06351905316114426, 0.09549213200807571, -0.07192058861255646, -0.16940352320671082, -0.0684572160243988, 0.14434939622879028, -0.0926864743232727, 0.3304100036621094, 0.12883150577545166, -0.06020374223589897, -0.025532152503728867, -0.12558820843696594, -0.036221615970134735, -0.17406877875328064, -0.1351386308670044, -0.1767245978116989, -0.2640955448150635, 0.22010363638401031, -0.18869131803512573, -0.22206830978393555, -0.28137636184692383, 0.04833296686410904, 0.21039673686027527, -0.03408260643482208, 0.00847514346241951, 0.2208159863948822, -0.0831628292798996, -0.1552075892686844, -0.23698651790618896, 0.24950285255908966, -0.16290901601314545, -0.3530406355857849, -0.11512929946184158, 0.262494295835495, 0.31696614623069763, -0.16256988048553467, 0.02505609765648842, 0.3321639895439148, 0.015203826129436493, 0.21822687983512878, -0.2330925166606903, 0.20974797010421753, 0.32370901107788086, -0.04380853474140167, -0.02371900901198387, -0.16451823711395264, -0.11386561393737793, 0.0021903738379478455, 0.053669609129428864, 0.1220487430691719, -0.25387656688690186, 0.04448121786117554, 0.31824421882629395, -0.19456559419631958, 0.23211772739887238, -0.036331452429294586, -0.0012292545288801193, 0.06682445108890533, 0.10088945180177689, -0.0417683944106102, 0.2667433023452759, 0.12491428852081299, -0.09167841821908951, -0.02759157493710518, -0.0643002986907959, 0.1151653379201889, 0.3590776026248932, 0.05846445634961128, 0.34441468119621277, -0.0757916271686554, 0.10292542725801468, 0.10597537457942963, -0.06792401522397995, -0.24811935424804688, 0.20804138481616974, 0.28620025515556335, -0.4603844881057739, 0.06866594403982162, -0.2398962378501892, 0.008067376911640167, -0.04891368746757507, 0.015595827251672745, 0.07336428016424179, -0.43566733598709106, -0.22127757966518402, 0.3823997378349304, -0.386979341506958, 0.2557774782180786, -0.21470968425273895, 0.09878389537334442, 0.1520710289478302, -0.17822185158729553, -0.39671123027801514, -0.08081930875778198, -0.08192029595375061, 0.044527944177389145, 0.5053490400314331, -0.1465427279472351, 0.16515494883060455, 0.09142126142978668, -0.034938618540763855, -0.2427101731300354, -0.2758493721485138, 0.02650311030447483, -0.28776735067367554, 0.06291761249303818, 0.33538681268692017, 0.38200846314430237, -0.08209699392318726, -0.1669592261314392, 0.30184119939804077, -0.3575623631477356, -0.37481871247291565, 0.2896735668182373, -0.116573266685009, -0.38777485489845276, -0.31132858991622925, -0.12563592195510864, -0.1846807599067688, -0.3401942253112793, 0.004580322653055191, -0.3655581474304199, -0.06664726138114929, 0.2010815143585205, 0.34997111558914185, 0.008739400655031204, 0.0061373524367809296, -0.30537015199661255, -0.11062337458133698, 0.17287473380565643, 0.33982402086257935, -0.04823129251599312, -0.2551821768283844, -0.0031362920999526978, -0.23245353996753693, 0.04834708943963051, 0.19947372376918793, -0.2912505269050598, 0.3903251588344574, -0.20016242563724518, 0.3545483350753784, 0.09132079780101776, -0.05769835412502289, 0.30536070466041565, 0.22115537524223328, 0.0018109269440174103, -0.39140796661376953, -0.08785904198884964, -0.036621395498514175, 0.046249814331531525, 0.2069655954837799, 0.059425000101327896, 0.43292292952537537, 0.17165300250053406, 0.3451787829399109, 0.1391526162624359, -0.2561638355255127, 0.2966752350330353, -0.09590905159711838, 0.24117502570152283, -0.215684175491333, -0.20542483031749725, -0.04469863697886467, -0.03260383754968643, -0.28616371750831604, -0.03020920604467392, -0.33809927105903625, -0.6134926676750183, 0.24391692876815796, 0.07117816060781479, -0.2568027973175049, -0.20462888479232788, 0.3733392357826233, -0.25057148933410645, 0.1204986646771431, 0.1377401053905487, -0.06091131269931793, -0.2960360050201416, -0.07747794687747955, -0.005701005458831787, -0.13155189156532288, 0.07353672385215759, 0.036194074898958206, -0.2893303632736206, -0.20725545287132263, -0.05393987521529198, 0.27963417768478394, 0.20374621450901031, 0.38638484477996826, 0.031423419713974, -0.04342394694685936, -0.11047393083572388, 0.08160261064767838, 0.7921385169029236, -0.39298442006111145, 0.14109638333320618, 0.2259669303894043, 0.32780784368515015, -0.36489158868789673, -0.03387800604104996, -0.16061124205589294, 0.373187780380249, 0.26526394486427307, 0.14528335630893707, -0.34966379404067993, 0.14138448238372803, -0.043402962386608124, 0.16774150729179382, -0.020194165408611298, 0.04426625370979309, -0.04156561568379402, -0.4001169800758362, -0.10157015919685364, 0.05187298730015755, 0.5569097995758057, 0.22003579139709473, -0.021162262186408043, -0.04793953523039818, -0.4475386142730713, 0.23431043326854706, 0.03368663042783737, 0.06676948815584183, 0.4606055021286011, -0.07812359929084778, 0.33061492443084717, -0.43427830934524536, -0.005042671225965023, 0.4487893581390381, 0.5028223395347595, 0.0015918053686618805, -0.09510795772075653, 0.21875329315662384, 0.013008277863264084, 0.3109695017337799, 0.05222172290086746, -0.036374546587467194, -0.06927533447742462, 0.2546387016773224, 0.16816608607769012, -0.07594215124845505, -0.15308497846126556, 0.2868950664997101, 0.05230031535029411, -0.5290563106536865, -0.4393804669380188, 0.263996958732605, 0.0988554060459137, -0.038070909678936005, 0.1012265682220459, 0.020654678344726562, -0.3764946758747101, 0.6231356859207153, 0.2331874817609787, 0.8570387959480286, -0.13991576433181763, 0.11338158696889877, 0.434704452753067, 0.20373527705669403, 0.18643468618392944, 0.29275277256965637, 0.08603661507368088, -0.4036332368850708, 0.1858527511358261, -0.009298939257860184, -0.07320259511470795, 0.15319788455963135, 0.3547826111316681, -0.3052141070365906, -0.0429764948785305, -0.03547216206789017, 0.49276962876319885, 0.09732798486948013, -0.11662915349006653, -0.06578738987445831, -0.21919840574264526, -0.4653312861919403, 0.18437457084655762, 0.10790395736694336, -0.15328861773014069, -0.024001087993383408, -0.29261499643325806, -0.1892489194869995, -0.12670695781707764, -0.2633209824562073, 0.12289249897003174, -0.13717103004455566, 0.2635822892189026, 0.19767826795578003, -0.04010068625211716, 0.18671123683452606, 0.28177592158317566, -0.011911556124687195, 0.05887261778116226, -0.06841938197612762, 0.04976760223507881, 0.2763684391975403, 0.1378067582845688, 0.17823560535907745, -0.1554277539253235, 0.3335948884487152, 0.10343031585216522, -0.11654114723205566, -0.042432062327861786, -0.2606746554374695, -0.16936302185058594, -0.05391262471675873, 0.19822333753108978, -0.03360472992062569, -0.5134413242340088, -0.43101298809051514, -0.05766822770237923, 0.10860860347747803, -0.024187736213207245, 0.10693781077861786, 0.07315242290496826, -0.06758035719394684, 0.5152415037155151, -0.2272104173898697, -0.057447969913482666, 0.11995400488376617, 0.2368398904800415, 0.13043418526649475, 0.11298222839832306, 0.2691706418991089, 0.0787447839975357, -0.14622467756271362, -0.18547675013542175, 0.22807544469833374, 0.17025698721408844, -0.6268270611763, 0.28532421588897705, -0.22607216238975525, -0.281514972448349, 0.12994402647018433, 0.5647776126861572, -0.038800887763500214, 0.14722010493278503, -0.28669461607933044, -0.2581219971179962, -0.14387044310569763, 0.32035890221595764, 0.14955121278762817, 0.31182053685188293, 0.1740947812795639, 0.3910980522632599, -0.084974005818367, -0.3364950120449066, -0.3306780457496643, -0.08370102941989899, -0.3653358221054077, 0.3747389614582062, -0.3797122836112976, 0.08809370547533035, 0.13554474711418152, -0.2086508572101593, 0.1021478995680809, 0.09957754611968994, -0.11996546387672424, -0.18154248595237732, -0.061579033732414246, 0.10408526659011841, 0.19200952351093292, 0.02446673810482025, 0.12907612323760986, -0.2266404628753662, -0.17619848251342773, -0.27655157446861267, -0.01240679994225502, 0.34281283617019653, -0.08613291382789612, -0.051978424191474915, 0.2773022949695587, 0.014348537661135197, -0.20551608502864838, 0.19514861702919006, -0.17365820705890656, -0.1987898200750351, -0.08971795439720154, 0.2787747383117676, -0.004116430878639221, 0.04851283133029938, 0.18986621499061584, 0.1933051347732544, 0.13979603350162506, 0.16200311481952667, 0.6201661825180054, -0.2460731863975525, 0.006964176893234253, 0.4891505539417267, 0.32078486680984497, -0.10628718882799149, -0.2443944811820984, -0.09618747234344482, 0.06621943414211273, 0.220779150724411, -0.26681041717529297, 0.07451401650905609, 0.2116241455078125, 0.0633547306060791, 0.11466547846794128, 0.3049684762954712, 0.03134237974882126, -0.22549253702163696, 0.11020886898040771, -0.03560440242290497, 0.804750919342041, -0.1278124451637268, 0.1441962718963623, 0.3858983516693115, -0.039545319974422455, 0.1377418041229248, 0.09140068292617798, -0.0014338335022330284, 0.2678656578063965, 0.5077898502349854, 0.04669533669948578, 0.1312389224767685, 0.14515820145606995, 0.021943744271993637, 0.05296783149242401, -0.3793625235557556, 0.18708719313144684, 0.15021756291389465, 0.0376092791557312, 0.26007694005966187, 0.06966671347618103, 0.11003565788269043, -0.26797619462013245, -0.3534982204437256, -0.033430516719818115, 0.13536830246448517, -0.4147183299064636, 0.12655109167099, -0.4492883086204529, -0.07004908472299576, 0.17844420671463013, -0.34349989891052246, -0.06520458310842514, -0.17704057693481445, 0.423014372587204, 0.0519959032535553, 0.03814677894115448, -0.14747826755046844, -0.18330168724060059, 0.19445130228996277, 0.19034765660762787, -0.19141356647014618, 0.24775591492652893, 0.03816705942153931, -0.2569960653781891, 0.0538765974342823, 0.5058435797691345, 0.6003215909004211, 0.46662938594818115, 0.14306940138339996, 0.16333317756652832, 0.08396898955106735, -0.2258443534374237, -0.28061625361442566, 0.07999658584594727, 0.0500953383743763, 0.10744686424732208, 0.1527133285999298, 0.1523427963256836, -0.08534291386604309, 0.0698494017124176, -0.018180837854743004, 0.3027918338775635, 0.17889131605625153, 0.20201325416564941, -0.23856976628303528, -0.23859132826328278, -0.09789760410785675, -0.0966721773147583, -0.21609637141227722, -0.34657421708106995, 0.48196956515312195, -0.24431084096431732, 0.32318079471588135, 0.012395936995744705, 0.0847049430012703, 0.14766491949558258, 0.2906337380409241, 0.3246777653694153, 0.0026642391458153725, -0.3329249322414398, 0.1036299616098404, -0.43882331252098083, 0.13640016317367554, -0.33357661962509155, 0.004996664822101593, 0.18725888431072235, 0.24207386374473572, 0.07708404213190079, -0.1252610981464386, 0.09895539283752441, 0.038350075483322144, -0.11781831085681915, 0.4823516309261322, -0.09766297787427902, -0.2804936468601227, -0.12634603679180145, -0.049829088151454926, 0.03644523024559021, -0.47979289293289185, 0.12275025993585587, 0.06383199989795685, 0.16820240020751953, -0.06094773858785629, -0.005656421184539795, 0.025599271059036255, -0.18348726630210876, 0.24833442270755768, 0.17448751628398895, 0.29592788219451904, -0.1202162355184555, -0.2224520444869995, -0.2851911783218384, -0.3099729120731354, -0.2603844702243805, 0.18987739086151123, -0.06458305567502975, 0.3302714228630066, -0.3455328345298767, 0.3046518564224243, -0.11808350682258606, -0.2871019244194031, 0.18697485327720642, 0.2234266698360443, -0.37496262788772583, 0.45886293053627014, -0.6828261017799377, 0.2715597152709961, -0.013537220656871796, 0.19759584963321686, 0.0575597807765007, 0.28697603940963745, -0.23323839902877808, -0.48941195011138916, 0.511699914932251, -0.46994897723197937, -0.32210829854011536, 0.019145265221595764, -0.1411757469177246, -0.4306701719760895, -0.0983462855219841, -0.48194175958633423, -0.368624210357666, 0.19970965385437012, -0.0676918625831604, -0.17573580145835876, -0.144771546125412, 0.0006744787096977234, 0.0587681382894516, -0.20465554296970367, 0.2614613473415375, 0.04153263568878174, -0.29364851117134094, 0.17603687942028046, -0.30459490418434143 ]
https://github.com/huggingface/datasets/issues/5965
@mariosasko Put up an initial PR to implement this proposal. Let me know your thoughts on direction and what else should be in-scope here.
"Couldn't cast array of type" in complex datasets
### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux
24
"Couldn't cast array of type" in complex datasets ### Describe the bug When doing a map of a dataset with complex types, sometimes `datasets` is unable to interpret the valid schema of a returned datasets.map() function. This often comes from conflicting types, like when both empty lists and filled lists are competing for the same field value. This is prone to happen in batch mapping, when the mapper returns a sequence of null/empty values and other batches are non-null. A workaround is to manually cast the new batch to a pyarrow table (like implemented in this [workaround](https://github.com/piercefreeman/lassen/pull/3)) but it feels like this ideally should be solved at the core library level. Note that the reproduction case only throws this error if the first datapoint has the empty list. If it is processed later, datasets already detects its representation as list-type and therefore allows the empty list to be provided. ### Steps to reproduce the bug A trivial reproduction case: ```python from typing import Iterator, Any import pandas as pd from datasets import Dataset def batch_to_examples(batch: dict[str, list[Any]]) -> Iterator[dict[str, Any]]: for i in range(next(iter(lengths))): yield {feature: values[i] for feature, values in batch.items()} def examples_to_batch(examples) -> dict[str, list[Any]]: batch = {} for example in examples: for feature, value in example.items(): if feature not in batch: batch[feature] = [] batch[feature].append(value) return batch def batch_process(examples, explicit_schema: bool): new_examples = [] for example in batch_to_examples(examples): new_examples.append(dict(texts=example["raw_text"].split())) return examples_to_batch(new_examples) df = pd.DataFrame( [ {"raw_text": ""}, {"raw_text": "This is a test"}, {"raw_text": "This is another test"}, ] ) dataset = Dataset.from_pandas(df) # datasets won't be able to typehint a dataset that starts with an empty example. with pytest.raises(TypeError, match="Couldn't cast array of type"): dataset = dataset.map( batch_process, batched=True, batch_size=1, num_proc=1, remove_columns=dataset.column_names, ) ``` This results in crashes like: ```bash File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 2109, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1819, in wrapper return func(array, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/piercefreeman/Library/Caches/pypoetry/virtualenvs/example-9kBqeSPy-py3.11/lib/python3.11/site-packages/datasets/table.py", line 1998, in array_cast raise TypeError(f"Couldn't cast array of type {array.type} to {pa_type}") TypeError: Couldn't cast array of type string to null ``` ### Expected behavior The code should successfully map and create a new dataset without error. ### Environment info Mac OSX, Linux @mariosasko Put up an initial PR to implement this proposal. Let me know your thoughts on direction and what else should be in-scope here.
[ -0.3982987403869629, -0.056902915239334106, -0.04033725708723068, 0.17765331268310547, 0.4318235218524933, 0.226649209856987, 0.33259859681129456, 0.3314976692199707, 0.3767266571521759, -0.019378453493118286, 0.023040346801280975, 0.3431892991065979, -0.15088258683681488, 0.02486550062894821, 0.030931346118450165, -0.08824338763952255, 0.1402876079082489, 0.19609206914901733, -0.21512819826602936, -0.0379830002784729, -0.22037731111049652, -0.06677928566932678, -0.3868851959705353, -0.019873347133398056, 0.08640722930431366, -0.3364105522632599, -0.14185653626918793, -0.12421470880508423, -0.109559066593647, -0.3847695291042328, 0.3289003074169159, -0.3240495026111603, 0.15686433017253876, 0.2976699471473694, -0.00011155125685036182, 0.15764425694942474, 0.3483608365058899, 0.03217849135398865, -0.18421384692192078, -0.12119806557893753, -0.3748065233230591, -0.2226884663105011, -0.15669165551662445, -0.30277490615844727, 0.08711588382720947, -0.07472194731235504, -0.0405162051320076, -0.36844900250434875, -0.16893471777439117, 0.1778658628463745, 0.18865826725959778, 0.4982253611087799, 0.001331821084022522, -0.18427890539169312, 0.15275107324123383, 0.06477850675582886, -0.19486723840236664, -0.12267559766769409, 0.3001418113708496, 0.15865236520767212, 0.049949489533901215, -0.0008362457156181335, -0.4528648853302002, -0.21816276013851166, 0.13382597267627716, -0.04392268881201744, 0.2762894332408905, -0.2904151678085327, -0.16900116205215454, 0.12227438390254974, 0.3683268427848816, -0.2635713219642639, -0.27735140919685364, -0.2502695918083191, -0.17474466562271118, 0.09625483304262161, -0.0472911037504673, 0.04677427560091019, 0.02491239458322525, 0.1941068172454834, -0.35565072298049927, 0.3164064586162567, 0.10977998375892639, 0.22104117274284363, -0.0005164816975593567, 0.015657790005207062, 0.09858265519142151, 0.17983630299568176, -0.09532910585403442, -0.22516269981861115, 0.16425921022891998, -0.512212336063385, -0.09868593513965607, 0.2980858087539673, -0.08567561209201813, -0.11584607511758804, 0.22477544844150543, 0.008556710556149483, 0.23935183882713318, -0.17544062435626984, 0.0351397879421711, 0.004304293543100357, 0.07433326542377472, 0.1809624284505844, 0.5464469194412231, 0.1034679114818573, 0.038617536425590515, 0.013715539127588272, 0.022139765322208405, -0.1252303123474121, -0.018902823328971863, 0.027756474912166595, 0.042470552027225494, -0.025236496701836586, 0.1958099603652954, 0.12534478306770325, 0.2855916917324066, -0.017526082694530487, -0.21408125758171082, 0.14586272835731506, -0.4794706702232361, 0.19877389073371887, 0.21111521124839783, 0.2570607364177704, 0.04072047397494316, 0.39586660265922546, 0.041635364294052124, 0.1814596951007843, -0.050427619367837906, -0.23049655556678772, -0.2001199722290039, -0.18854689598083496, -0.3150932192802429, -0.327295184135437, 0.04260431230068207, 0.14476490020751953, 0.06247798353433609, 0.14164116978645325, -0.2240636944770813, 0.08633221685886383, -0.10320782661437988, -0.16692803800106049, 0.2768693268299103, 0.3331468999385834, 0.22188574075698853, 0.2902708649635315, 0.2477274090051651, -0.060666218400001526, -0.1569904237985611, 0.36035099625587463, -0.18982625007629395, -0.19694110751152039, -0.04336240887641907, 0.18081527948379517, -0.2734302282333374, 0.07437343895435333, -0.7257806062698364, 0.03204706311225891, 0.4068147838115692, -0.2675914168357849, 0.03590206429362297, -0.3142436742782593, 0.18733753263950348, -0.36399343609809875, -0.043999023735523224, 0.18830570578575134, -0.2290777713060379, 0.1614474058151245, -0.2298705279827118, -0.11316490173339844, 0.08068488538265228, 0.4565396308898926, -0.15648867189884186, 0.4134402871131897, -0.36763638257980347, 0.4682583808898926, 0.20694765448570251, 0.057995155453681946, -0.2253406047821045, 0.21765737235546112, 0.27750369906425476, 0.17585860192775726, -0.19049933552742004, 0.20880012214183807, 0.30955207347869873, -0.34630921483039856, -0.1501530259847641, 0.3266209065914154, -0.34921586513519287, 0.2300003618001938, -0.3290557265281677, -0.07702210545539856, 0.27066493034362793, -0.05439186468720436, 0.19699309766292572, 0.3359839916229248, 0.056673794984817505, 0.021988246589899063, 0.22061967849731445, -0.28354477882385254, 0.2941349446773529, 0.05711391568183899, 0.3532875180244446, 0.053560566157102585, 0.0018459223210811615, -0.35053277015686035, -0.5408236384391785, 0.19890838861465454, -0.06351905316114426, 0.09549213200807571, -0.07192058861255646, -0.16940352320671082, -0.0684572160243988, 0.14434939622879028, -0.0926864743232727, 0.3304100036621094, 0.12883150577545166, -0.06020374223589897, -0.025532152503728867, -0.12558820843696594, -0.036221615970134735, -0.17406877875328064, -0.1351386308670044, -0.1767245978116989, -0.2640955448150635, 0.22010363638401031, -0.18869131803512573, -0.22206830978393555, -0.28137636184692383, 0.04833296686410904, 0.21039673686027527, -0.03408260643482208, 0.00847514346241951, 0.2208159863948822, -0.0831628292798996, -0.1552075892686844, -0.23698651790618896, 0.24950285255908966, -0.16290901601314545, -0.3530406355857849, -0.11512929946184158, 0.262494295835495, 0.31696614623069763, -0.16256988048553467, 0.02505609765648842, 0.3321639895439148, 0.015203826129436493, 0.21822687983512878, -0.2330925166606903, 0.20974797010421753, 0.32370901107788086, -0.04380853474140167, -0.02371900901198387, -0.16451823711395264, -0.11386561393737793, 0.0021903738379478455, 0.053669609129428864, 0.1220487430691719, -0.25387656688690186, 0.04448121786117554, 0.31824421882629395, -0.19456559419631958, 0.23211772739887238, -0.036331452429294586, -0.0012292545288801193, 0.06682445108890533, 0.10088945180177689, -0.0417683944106102, 0.2667433023452759, 0.12491428852081299, -0.09167841821908951, -0.02759157493710518, -0.0643002986907959, 0.1151653379201889, 0.3590776026248932, 0.05846445634961128, 0.34441468119621277, -0.0757916271686554, 0.10292542725801468, 0.10597537457942963, -0.06792401522397995, -0.24811935424804688, 0.20804138481616974, 0.28620025515556335, -0.4603844881057739, 0.06866594403982162, -0.2398962378501892, 0.008067376911640167, -0.04891368746757507, 0.015595827251672745, 0.07336428016424179, -0.43566733598709106, -0.22127757966518402, 0.3823997378349304, -0.386979341506958, 0.2557774782180786, -0.21470968425273895, 0.09878389537334442, 0.1520710289478302, -0.17822185158729553, -0.39671123027801514, -0.08081930875778198, -0.08192029595375061, 0.044527944177389145, 0.5053490400314331, -0.1465427279472351, 0.16515494883060455, 0.09142126142978668, -0.034938618540763855, -0.2427101731300354, -0.2758493721485138, 0.02650311030447483, -0.28776735067367554, 0.06291761249303818, 0.33538681268692017, 0.38200846314430237, -0.08209699392318726, -0.1669592261314392, 0.30184119939804077, -0.3575623631477356, -0.37481871247291565, 0.2896735668182373, -0.116573266685009, -0.38777485489845276, -0.31132858991622925, -0.12563592195510864, -0.1846807599067688, -0.3401942253112793, 0.004580322653055191, -0.3655581474304199, -0.06664726138114929, 0.2010815143585205, 0.34997111558914185, 0.008739400655031204, 0.0061373524367809296, -0.30537015199661255, -0.11062337458133698, 0.17287473380565643, 0.33982402086257935, -0.04823129251599312, -0.2551821768283844, -0.0031362920999526978, -0.23245353996753693, 0.04834708943963051, 0.19947372376918793, -0.2912505269050598, 0.3903251588344574, -0.20016242563724518, 0.3545483350753784, 0.09132079780101776, -0.05769835412502289, 0.30536070466041565, 0.22115537524223328, 0.0018109269440174103, -0.39140796661376953, -0.08785904198884964, -0.036621395498514175, 0.046249814331531525, 0.2069655954837799, 0.059425000101327896, 0.43292292952537537, 0.17165300250053406, 0.3451787829399109, 0.1391526162624359, -0.2561638355255127, 0.2966752350330353, -0.09590905159711838, 0.24117502570152283, -0.215684175491333, -0.20542483031749725, -0.04469863697886467, -0.03260383754968643, -0.28616371750831604, -0.03020920604467392, -0.33809927105903625, -0.6134926676750183, 0.24391692876815796, 0.07117816060781479, -0.2568027973175049, -0.20462888479232788, 0.3733392357826233, -0.25057148933410645, 0.1204986646771431, 0.1377401053905487, -0.06091131269931793, -0.2960360050201416, -0.07747794687747955, -0.005701005458831787, -0.13155189156532288, 0.07353672385215759, 0.036194074898958206, -0.2893303632736206, -0.20725545287132263, -0.05393987521529198, 0.27963417768478394, 0.20374621450901031, 0.38638484477996826, 0.031423419713974, -0.04342394694685936, -0.11047393083572388, 0.08160261064767838, 0.7921385169029236, -0.39298442006111145, 0.14109638333320618, 0.2259669303894043, 0.32780784368515015, -0.36489158868789673, -0.03387800604104996, -0.16061124205589294, 0.373187780380249, 0.26526394486427307, 0.14528335630893707, -0.34966379404067993, 0.14138448238372803, -0.043402962386608124, 0.16774150729179382, -0.020194165408611298, 0.04426625370979309, -0.04156561568379402, -0.4001169800758362, -0.10157015919685364, 0.05187298730015755, 0.5569097995758057, 0.22003579139709473, -0.021162262186408043, -0.04793953523039818, -0.4475386142730713, 0.23431043326854706, 0.03368663042783737, 0.06676948815584183, 0.4606055021286011, -0.07812359929084778, 0.33061492443084717, -0.43427830934524536, -0.005042671225965023, 0.4487893581390381, 0.5028223395347595, 0.0015918053686618805, -0.09510795772075653, 0.21875329315662384, 0.013008277863264084, 0.3109695017337799, 0.05222172290086746, -0.036374546587467194, -0.06927533447742462, 0.2546387016773224, 0.16816608607769012, -0.07594215124845505, -0.15308497846126556, 0.2868950664997101, 0.05230031535029411, -0.5290563106536865, -0.4393804669380188, 0.263996958732605, 0.0988554060459137, -0.038070909678936005, 0.1012265682220459, 0.020654678344726562, -0.3764946758747101, 0.6231356859207153, 0.2331874817609787, 0.8570387959480286, -0.13991576433181763, 0.11338158696889877, 0.434704452753067, 0.20373527705669403, 0.18643468618392944, 0.29275277256965637, 0.08603661507368088, -0.4036332368850708, 0.1858527511358261, -0.009298939257860184, -0.07320259511470795, 0.15319788455963135, 0.3547826111316681, -0.3052141070365906, -0.0429764948785305, -0.03547216206789017, 0.49276962876319885, 0.09732798486948013, -0.11662915349006653, -0.06578738987445831, -0.21919840574264526, -0.4653312861919403, 0.18437457084655762, 0.10790395736694336, -0.15328861773014069, -0.024001087993383408, -0.29261499643325806, -0.1892489194869995, -0.12670695781707764, -0.2633209824562073, 0.12289249897003174, -0.13717103004455566, 0.2635822892189026, 0.19767826795578003, -0.04010068625211716, 0.18671123683452606, 0.28177592158317566, -0.011911556124687195, 0.05887261778116226, -0.06841938197612762, 0.04976760223507881, 0.2763684391975403, 0.1378067582845688, 0.17823560535907745, -0.1554277539253235, 0.3335948884487152, 0.10343031585216522, -0.11654114723205566, -0.042432062327861786, -0.2606746554374695, -0.16936302185058594, -0.05391262471675873, 0.19822333753108978, -0.03360472992062569, -0.5134413242340088, -0.43101298809051514, -0.05766822770237923, 0.10860860347747803, -0.024187736213207245, 0.10693781077861786, 0.07315242290496826, -0.06758035719394684, 0.5152415037155151, -0.2272104173898697, -0.057447969913482666, 0.11995400488376617, 0.2368398904800415, 0.13043418526649475, 0.11298222839832306, 0.2691706418991089, 0.0787447839975357, -0.14622467756271362, -0.18547675013542175, 0.22807544469833374, 0.17025698721408844, -0.6268270611763, 0.28532421588897705, -0.22607216238975525, -0.281514972448349, 0.12994402647018433, 0.5647776126861572, -0.038800887763500214, 0.14722010493278503, -0.28669461607933044, -0.2581219971179962, -0.14387044310569763, 0.32035890221595764, 0.14955121278762817, 0.31182053685188293, 0.1740947812795639, 0.3910980522632599, -0.084974005818367, -0.3364950120449066, -0.3306780457496643, -0.08370102941989899, -0.3653358221054077, 0.3747389614582062, -0.3797122836112976, 0.08809370547533035, 0.13554474711418152, -0.2086508572101593, 0.1021478995680809, 0.09957754611968994, -0.11996546387672424, -0.18154248595237732, -0.061579033732414246, 0.10408526659011841, 0.19200952351093292, 0.02446673810482025, 0.12907612323760986, -0.2266404628753662, -0.17619848251342773, -0.27655157446861267, -0.01240679994225502, 0.34281283617019653, -0.08613291382789612, -0.051978424191474915, 0.2773022949695587, 0.014348537661135197, -0.20551608502864838, 0.19514861702919006, -0.17365820705890656, -0.1987898200750351, -0.08971795439720154, 0.2787747383117676, -0.004116430878639221, 0.04851283133029938, 0.18986621499061584, 0.1933051347732544, 0.13979603350162506, 0.16200311481952667, 0.6201661825180054, -0.2460731863975525, 0.006964176893234253, 0.4891505539417267, 0.32078486680984497, -0.10628718882799149, -0.2443944811820984, -0.09618747234344482, 0.06621943414211273, 0.220779150724411, -0.26681041717529297, 0.07451401650905609, 0.2116241455078125, 0.0633547306060791, 0.11466547846794128, 0.3049684762954712, 0.03134237974882126, -0.22549253702163696, 0.11020886898040771, -0.03560440242290497, 0.804750919342041, -0.1278124451637268, 0.1441962718963623, 0.3858983516693115, -0.039545319974422455, 0.1377418041229248, 0.09140068292617798, -0.0014338335022330284, 0.2678656578063965, 0.5077898502349854, 0.04669533669948578, 0.1312389224767685, 0.14515820145606995, 0.021943744271993637, 0.05296783149242401, -0.3793625235557556, 0.18708719313144684, 0.15021756291389465, 0.0376092791557312, 0.26007694005966187, 0.06966671347618103, 0.11003565788269043, -0.26797619462013245, -0.3534982204437256, -0.033430516719818115, 0.13536830246448517, -0.4147183299064636, 0.12655109167099, -0.4492883086204529, -0.07004908472299576, 0.17844420671463013, -0.34349989891052246, -0.06520458310842514, -0.17704057693481445, 0.423014372587204, 0.0519959032535553, 0.03814677894115448, -0.14747826755046844, -0.18330168724060059, 0.19445130228996277, 0.19034765660762787, -0.19141356647014618, 0.24775591492652893, 0.03816705942153931, -0.2569960653781891, 0.0538765974342823, 0.5058435797691345, 0.6003215909004211, 0.46662938594818115, 0.14306940138339996, 0.16333317756652832, 0.08396898955106735, -0.2258443534374237, -0.28061625361442566, 0.07999658584594727, 0.0500953383743763, 0.10744686424732208, 0.1527133285999298, 0.1523427963256836, -0.08534291386604309, 0.0698494017124176, -0.018180837854743004, 0.3027918338775635, 0.17889131605625153, 0.20201325416564941, -0.23856976628303528, -0.23859132826328278, -0.09789760410785675, -0.0966721773147583, -0.21609637141227722, -0.34657421708106995, 0.48196956515312195, -0.24431084096431732, 0.32318079471588135, 0.012395936995744705, 0.0847049430012703, 0.14766491949558258, 0.2906337380409241, 0.3246777653694153, 0.0026642391458153725, -0.3329249322414398, 0.1036299616098404, -0.43882331252098083, 0.13640016317367554, -0.33357661962509155, 0.004996664822101593, 0.18725888431072235, 0.24207386374473572, 0.07708404213190079, -0.1252610981464386, 0.09895539283752441, 0.038350075483322144, -0.11781831085681915, 0.4823516309261322, -0.09766297787427902, -0.2804936468601227, -0.12634603679180145, -0.049829088151454926, 0.03644523024559021, -0.47979289293289185, 0.12275025993585587, 0.06383199989795685, 0.16820240020751953, -0.06094773858785629, -0.005656421184539795, 0.025599271059036255, -0.18348726630210876, 0.24833442270755768, 0.17448751628398895, 0.29592788219451904, -0.1202162355184555, -0.2224520444869995, -0.2851911783218384, -0.3099729120731354, -0.2603844702243805, 0.18987739086151123, -0.06458305567502975, 0.3302714228630066, -0.3455328345298767, 0.3046518564224243, -0.11808350682258606, -0.2871019244194031, 0.18697485327720642, 0.2234266698360443, -0.37496262788772583, 0.45886293053627014, -0.6828261017799377, 0.2715597152709961, -0.013537220656871796, 0.19759584963321686, 0.0575597807765007, 0.28697603940963745, -0.23323839902877808, -0.48941195011138916, 0.511699914932251, -0.46994897723197937, -0.32210829854011536, 0.019145265221595764, -0.1411757469177246, -0.4306701719760895, -0.0983462855219841, -0.48194175958633423, -0.368624210357666, 0.19970965385437012, -0.0676918625831604, -0.17573580145835876, -0.144771546125412, 0.0006744787096977234, 0.0587681382894516, -0.20465554296970367, 0.2614613473415375, 0.04153263568878174, -0.29364851117134094, 0.17603687942028046, -0.30459490418434143 ]
https://github.com/huggingface/datasets/issues/5963
i got error using method from_spark when using multi-node Spark cluster. seems could only use "from_spark" in local?
Got an error _pickle.PicklingError use Dataset.from_spark.
python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
18
Got an error _pickle.PicklingError use Dataset.from_spark. python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) i got error using method from_spark when using multi-node Spark cluster. seems could only use "from_spark" in local?
[ -0.48843914270401, -0.16567064821720123, 0.023851711302995682, 0.342393159866333, 0.29546353220939636, -0.0016700103878974915, 0.5267864465713501, 0.13773950934410095, 0.08715443313121796, 0.09700290113687515, 0.08231262862682343, 0.6951181888580322, -0.18221795558929443, 0.534705400466919, -0.23124101758003235, -0.06934304535388947, -0.04704969376325607, 0.039264824241399765, -0.10985326766967773, 0.12908247113227844, -0.14200012385845184, 0.16121813654899597, -0.01808219403028488, 0.21399259567260742, -0.4843328297138214, -0.231309175491333, 0.006972402334213257, 0.03154195845127106, 0.018942726776003838, -0.3429158627986908, 0.313438355922699, -0.2454288750886917, 0.2013145089149475, 0.4949146807193756, -0.00010675490193534642, 0.01567273586988449, 0.2840091586112976, 0.028392769396305084, -0.314598023891449, -0.30959469079971313, 0.13471263647079468, -0.19778898358345032, 0.29643747210502625, -0.43910902738571167, -0.08369485288858414, 0.43250513076782227, -0.08017265796661377, -0.13864339888095856, 0.5478284358978271, 0.24734270572662354, 0.27015239000320435, 0.4517420530319214, 0.1991659253835678, -0.040031660348176956, -0.1439032405614853, -0.017339251935482025, -0.15435540676116943, 0.32084476947784424, -0.019979581236839294, 0.15240848064422607, -0.04422430694103241, 0.07639868557453156, -0.19006851315498352, 0.0340421162545681, 0.2666608691215515, -0.029710572212934494, -0.29397904872894287, -0.3867027461528778, 0.26570549607276917, 0.08816342055797577, 0.7293922305107117, -0.3622656464576721, -0.17206242680549622, -0.15281938016414642, 0.04290788248181343, -0.19324371218681335, 0.3022192716598511, -0.05532742291688919, -0.10377654433250427, -0.00031681422842666507, -0.04705841839313507, -0.3268241584300995, -0.05620424821972847, -0.09130388498306274, -0.07042399793863297, 0.3694106340408325, -0.17559310793876648, 0.3669031858444214, 0.1439843773841858, -0.08147236704826355, 0.163551926612854, -0.1445881426334381, 0.2454797476530075, -0.11824564635753632, -0.16765622794628143, -0.07646176218986511, -0.05704488232731819, -0.37988364696502686, -0.1658407747745514, -0.009235458448529243, 0.05166662484407425, 0.10566215217113495, -0.0690285861492157, 0.14064621925354004, 0.39171695709228516, 0.09503094106912613, 0.25943511724472046, 0.3108334243297577, 0.16589297354221344, -0.14966623485088348, -0.03248227760195732, -0.048194076865911484, -0.11935416609048843, -0.10702995955944061, 0.053755536675453186, 0.15937170386314392, 0.21017953753471375, -0.06752143800258636, -0.2595706582069397, -0.05292907729744911, -0.10199006646871567, 0.024705614894628525, -0.11639519035816193, 0.16270029544830322, 0.028387755155563354, -0.040097109973430634, -0.032443445175886154, 0.10582709312438965, -0.017818205058574677, 0.015077043324708939, -0.23119217157363892, 0.1312452256679535, 0.014009326696395874, 0.01036861352622509, -0.04755803197622299, -0.5940120220184326, 0.40823978185653687, -0.02465178444981575, -0.31399816274642944, 0.08029543608427048, 0.15338575839996338, -0.2402248978614807, -0.3045228123664856, 0.12046806514263153, 0.1318781077861786, 0.36227214336395264, 0.3059762418270111, -0.3050527572631836, -0.11159853637218475, 0.05256544053554535, -0.2397823929786682, -0.1837444305419922, -0.4008563756942749, 0.15959343314170837, -0.04063710570335388, -0.18304124474525452, -0.5282720923423767, 0.0256996788084507, 0.22662124037742615, -0.19141940772533417, 0.00035498663783073425, -0.2466350495815277, -0.19719694554805756, -0.35548579692840576, 0.19525721669197083, 0.3952091336250305, -0.66365647315979, 0.021359562873840332, -0.09458775073289871, 0.036708708852529526, 0.31282174587249756, 0.08252416551113129, -0.21855221688747406, 0.2673502266407013, -0.23426973819732666, 0.47513547539711, -0.008300349116325378, -0.3230435848236084, -0.22636836767196655, 0.18730619549751282, -0.376230925321579, -0.012330524623394012, -0.10326776653528214, -0.03133902698755264, 0.22806121408939362, 0.03385819494724274, 0.14381778240203857, 0.102020263671875, 0.149306982755661, -0.03029513731598854, -0.1594909131526947, -0.27316123247146606, 0.1727900207042694, -0.12851151823997498, 0.16508357226848602, -0.19789204001426697, 0.12478742003440857, -0.008597645908594131, 0.12712770700454712, 0.0008042911067605019, 0.12674564123153687, 0.2316221296787262, 0.11026732623577118, 0.11881549656391144, -0.31191056966781616, 0.035000838339328766, -0.38043904304504395, 0.305532842874527, 0.36301547288894653, 0.07688874006271362, -0.11076830327510834, -0.2604900002479553, -0.20685067772865295, 0.061022594571113586, -0.21462634205818176, -0.12947270274162292, 0.19948023557662964, 0.0919211357831955, -0.09647390246391296, 0.0780244916677475, 0.06162522733211517, -0.022377025336027145, -0.07934519648551941, -0.03879750147461891, -0.1355755478143692, 0.39753100275993347, -0.3191072344779968, -0.2832922637462616, 0.032953403890132904, -0.07399891316890717, 0.17085754871368408, -0.010677820071578026, -0.1919638067483902, 0.35257628560066223, -0.062212321907281876, 0.1573559194803238, -0.03844183683395386, 0.01917029172182083, 0.15165022015571594, -0.028478339314460754, 0.129091277718544, 0.17126181721687317, 0.1252603828907013, -0.020883917808532715, -0.10580065101385117, 0.2479889988899231, 0.04871516302227974, -0.09727433323860168, -0.1972358226776123, 0.19235312938690186, 0.11158694326877594, 0.10080721974372864, 0.09383755922317505, -0.0493408627808094, -0.17186951637268066, -0.14005564153194427, 0.19607359170913696, 0.03694674372673035, -0.478084921836853, 0.1873379498720169, 0.40580058097839355, 0.23102131485939026, 0.3625015318393707, 0.0966106429696083, -0.3328748941421509, -0.1452840268611908, 0.42571914196014404, 0.17398016154766083, 0.30080822110176086, 0.08521902561187744, -0.03693167865276337, -0.1324012130498886, 0.10147888958454132, -0.05890171602368355, 0.20092035830020905, 0.08080720901489258, 0.37636664509773254, 0.25234827399253845, -0.012854043394327164, 0.09227663278579712, -0.22084611654281616, -0.08420360088348389, 0.09818841516971588, 0.2058887630701065, -0.27317360043525696, 0.09283456206321716, -0.27633556723594666, 0.04196059703826904, 0.07038228213787079, 0.17701390385627747, -0.08736677467823029, -0.20921236276626587, -0.17466270923614502, 0.5300981998443604, 0.1016426831483841, 0.12700295448303223, 0.04360904544591904, 0.015958935022354126, 0.2952112555503845, 0.10761521011590958, -0.2677100896835327, -0.29048648476600647, -0.2997124195098877, 0.10567128658294678, 0.1844245344400406, 0.043637849390506744, 0.1334964632987976, 0.27973097562789917, 0.09160035103559494, -0.5572537183761597, -0.07447202503681183, -0.008994640782475471, -0.355011522769928, 0.3088333010673523, 0.12117034196853638, 0.31236767768859863, -0.44169485569000244, -0.4222879409790039, 0.1773485243320465, -0.035133104771375656, -0.06181469187140465, 0.1698971837759018, 0.05092884600162506, -0.014580484479665756, 0.03782149404287338, -0.28063705563545227, -0.45962944626808167, -0.4042505919933319, 0.18550515174865723, 0.07152268290519714, -0.015743736177682877, 0.2632715702056885, 0.2631888687610626, 0.3224998116493225, 0.20266015827655792, -0.2776329517364502, -0.16388365626335144, -0.037463150918483734, 0.24195733666419983, -0.11848675459623337, -0.3290320634841919, 0.07159610092639923, 0.07021559774875641, 0.2398906946182251, -0.28412580490112305, -0.3833746910095215, -0.12762027978897095, 0.07998005300760269, 0.3615613877773285, -0.04471065476536751, -0.046909525990486145, 0.410428524017334, 0.2838413417339325, -0.09939128160476685, 0.03338033705949783, -0.0491744726896286, 0.050908926874399185, 0.22924315929412842, 0.0991777777671814, 0.0500485822558403, 0.41635391116142273, 0.04946410655975342, 0.6712242364883423, 0.015484854578971863, -0.3020526170730591, 0.4118693172931671, -0.20362669229507446, 0.12222006171941757, -0.21766780316829681, -0.3891103267669678, -0.009674079716205597, -0.37556636333465576, -0.06564228981733322, 0.08992023766040802, -0.3052992820739746, -0.0026901811361312866, -0.09685567021369934, -0.20383283495903015, -0.21202322840690613, -0.16117751598358154, -0.006439735181629658, -0.17209050059318542, 0.052725449204444885, -0.09541252255439758, 0.2716253697872162, -0.2242451310157776, -0.08387221395969391, 0.0059499070048332214, -0.2375609278678894, 0.1667604148387909, -0.078311488032341, -0.3555421829223633, -0.11552833020687103, -0.5387831926345825, 0.35099148750305176, -0.09951408207416534, 0.0833778828382492, -0.17881101369857788, 0.04309592396020889, 0.18945249915122986, -0.04780808463692665, 0.6059219837188721, -0.2965508699417114, 0.038359444588422775, 0.22590956091880798, -0.10697874426841736, -0.4911774694919586, -0.10355659574270248, -0.17874403297901154, 0.39056259393692017, 0.006684901192784309, 0.5836238861083984, -0.25484171509742737, -0.03250691294670105, -0.09976659715175629, -0.07121459394693375, -0.1348162293434143, 0.1880333125591278, -0.1508118212223053, -0.316060334444046, -0.4655391275882721, 0.11179642379283905, 0.007667064666748047, 0.2107909619808197, -0.1736886352300644, -0.002082154154777527, -0.02065054140985012, 0.005370758473873138, -0.20017372071743011, 0.026250317692756653, 0.25873106718063354, 0.15110787749290466, 0.11040134727954865, 0.22226187586784363, 0.06015610322356224, 0.1162220686674118, 0.29806986451148987, 0.11423296481370926, -0.06367703527212143, 0.06881802529096603, -0.03858669102191925, 0.19462771713733673, 0.11947748064994812, -0.0870044082403183, 0.11818252503871918, -0.033058878034353256, 0.13299775123596191, -0.10821769386529922, 0.20755425095558167, 0.21414685249328613, 0.0803304985165596, -0.05652308464050293, -0.34565138816833496, 0.3998227119445801, 0.07285282760858536, -0.004899829626083374, 0.38124316930770874, -0.03727409616112709, -0.23094281554222107, 0.477049320936203, 0.19104626774787903, 0.70973140001297, -0.05838438868522644, 0.1273350715637207, 0.3959960341453552, 0.18931107223033905, 0.5711786150932312, 0.0364600270986557, 0.11875776946544647, -0.4633328914642334, -0.07829537987709045, -0.03873124718666077, 0.02379631996154785, 0.09060066938400269, 0.02056727185845375, -0.4864681363105774, 0.13530293107032776, -0.24195563793182373, 0.018353503197431564, -0.28499966859817505, 0.3904263973236084, -0.220066100358963, -0.12183146178722382, 0.18300694227218628, 0.22899559140205383, -0.2597479820251465, 0.3744601011276245, -0.03798801824450493, -0.10575685650110245, -0.04059022292494774, -0.3184075355529785, -0.387999564409256, 0.18348349630832672, -0.2437230497598648, 0.666570246219635, -0.16427351534366608, -0.323749840259552, 0.03729648143053055, 0.3030259907245636, 0.06916087120771408, 0.0648137554526329, -0.141044482588768, 0.051495861262083054, -0.04300461336970329, -0.17604322731494904, 0.07645390927791595, -0.03144152835011482, 0.3427593410015106, -0.08143070340156555, -0.2253265380859375, 0.2992083728313446, 0.053492091596126556, -0.1764785200357437, 0.17312079668045044, -0.09363438934087753, -0.027008336037397385, -0.5017267465591431, -0.25443363189697266, -0.08874090760946274, -0.31999123096466064, -0.3003639280796051, 0.11588796228170395, -0.1051839143037796, 0.10083472728729248, 0.14408977329730988, 0.0020701694302260876, 0.030001506209373474, 0.09683623909950256, 0.5596949458122253, -0.02987762540578842, 0.2831663489341736, 0.5352457761764526, 0.3073679804801941, -0.18730932474136353, -0.22526878118515015, 0.05681702494621277, -0.022312548011541367, -0.13041538000106812, 0.13161881268024445, 0.04791836440563202, 0.03231041133403778, -0.06732922047376633, 0.607498824596405, 0.21248272061347961, 0.018627941608428955, -0.24046126008033752, -0.12279835343360901, -0.3787522614002228, 0.25533726811408997, -0.013729291968047619, 0.26868048310279846, 0.14105460047721863, -0.05577203631401062, 0.10077281296253204, 0.004142783582210541, -0.3299327790737152, 0.023612983524799347, -0.48920994997024536, -0.03248216584324837, 0.5329434871673584, -0.28666603565216064, 0.04373297095298767, -0.1450985223054886, 0.16419833898544312, 0.16878700256347656, -0.05920936539769173, -0.25963348150253296, 0.11275520920753479, 0.024379685521125793, 0.1439802646636963, -0.15420261025428772, -0.24141135811805725, -0.29860806465148926, -0.18404936790466309, -0.15526822209358215, 0.05834595113992691, 0.23942306637763977, -0.08322818577289581, 0.009024471044540405, 0.045243486762046814, 0.16640394926071167, -0.1741066575050354, -0.026176463812589645, 0.01728915050625801, 0.020542878657579422, -0.1106104701757431, 0.19504471123218536, 0.28023990988731384, -0.05793619900941849, -0.3176884651184082, 0.10625895857810974, 0.09238244593143463, 0.22029197216033936, 0.3055327534675598, -0.3075252175331116, -0.1283978372812271, 0.08001372218132019, 0.25877270102500916, 0.11910627782344818, -0.16067856550216675, -0.09613349288702011, 0.24923892319202423, 0.23783595860004425, -0.2879294157028198, -0.16794389486312866, 0.20640870928764343, -0.18060290813446045, 0.03164795786142349, -0.16450373828411102, 0.18262635171413422, 0.08559362590312958, -0.5627004504203796, 0.27786436676979065, 0.6208098530769348, -0.2715016305446625, 0.10375426709651947, 0.3306465744972229, -0.14162233471870422, -0.08550207316875458, 0.3744335472583771, 0.24710659682750702, 0.1989920288324356, 0.3710246980190277, 0.10279673337936401, 0.31956353783607483, 0.11608099937438965, 0.07658189535140991, 0.15229645371437073, -0.5786861777305603, 0.1353222280740738, -0.21423108875751495, -0.31858697533607483, -0.0367383174598217, -0.06891679763793945, 0.1564408540725708, -0.46050724387168884, -0.2527894079685211, -0.24773789942264557, 0.3982545733451843, -0.44157037138938904, 0.10705192387104034, -0.26521921157836914, -0.04137203097343445, 0.2149837762117386, 0.1461452841758728, -0.10677282512187958, -0.08289177715778351, 0.39346247911453247, -0.034442514181137085, -0.21685726940631866, 0.14638756215572357, -0.044224999845027924, 0.053625572472810745, 0.19686439633369446, -0.2352333664894104, 0.08461973816156387, 0.08095423877239227, 0.057794757187366486, -0.5923621654510498, 0.29745960235595703, 0.5952128767967224, 0.04066655784845352, -0.214002326130867, 0.22929747402668, 0.12134827673435211, -0.050843290984630585, 0.1087491363286972, -0.08641481399536133, 0.032994866371154785, 0.2000422179698944, 0.320449560880661, 0.24780762195587158, -0.17222373187541962, 0.06748436391353607, 0.17034578323364258, 0.36929330229759216, -0.00627652183175087, -0.1072768121957779, 0.08039309084415436, -0.37079712748527527, -0.009130310267210007, 0.020115260034799576, -0.3438471555709839, 0.09652717411518097, 0.6157697439193726, 0.16977474093437195, 0.19134601950645447, -0.18068304657936096, 0.12864726781845093, -0.01275720726698637, 0.27692711353302, 0.2139473706483841, -0.0006613591685891151, -0.3684423863887787, 0.22497887909412384, -0.4956745505332947, 0.13733288645744324, 0.08699913322925568, -0.21549087762832642, -0.009299764409661293, -0.0005268491804599762, 0.2668376564979553, -0.01315687783062458, -0.13069674372673035, 0.13080768287181854, 0.05205923318862915, 0.08468524366617203, -0.22190821170806885, -0.009729031473398209, -0.03260798379778862, -0.02727421745657921, 0.08261395990848541, -0.33501967787742615, 0.3439114987850189, -0.04685257375240326, 0.1371639221906662, -0.1382519155740738, -0.25011759996414185, 0.2505011558532715, -0.2741953730583191, 0.554974377155304, -0.24414564669132233, 0.561347246170044, -0.16591957211494446, 0.0708976686000824, 0.06837760657072067, -0.1940852254629135, -0.1503438651561737, -0.010258737951517105, 0.0018270546570420265, 0.42671138048171997, -0.16388067603111267, 0.3537277579307556, -0.3989887237548828, -0.0048049986362457275, -0.12990932166576385, 0.20126008987426758, -0.17572160065174103, -0.03960051387548447, -0.202871173620224, -0.1260392963886261, 0.186513289809227, 0.23655205965042114, -0.011244051158428192, 0.15950262546539307, -0.3451300263404846, -0.4063379168510437, 0.6743062138557434, -0.23133307695388794, -0.22282293438911438, -0.21850106120109558, -0.04572112113237381, 0.22127407789230347, 0.1505010575056076, -0.19260716438293457, -0.008943259716033936, 0.3270154297351837, -0.020650235936045647, -0.24006937444210052, -0.039585649967193604, -0.02763344720005989, 0.0022824332118034363, -0.03804818168282509, 0.28808772563934326, -0.23654130101203918, -0.1487940549850464, -0.028872400522232056, -0.14390547573566437 ]
https://github.com/huggingface/datasets/issues/5963
cc @maddiedawson it looks like there an issue with `_validate_cache_dir` ? It looks like the function passed to mapPartitions has a reference to the Spark dataset builder, and therefore contains the SparkContext itself. I think it can be fixed by defining `create_cache_and_write_probe` outside the Spark dataset builder, and pass a `partial(create_cache_and_write_probe, cache_dir=self._cache_dir)` to `mapPartitions`
Got an error _pickle.PicklingError use Dataset.from_spark.
python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
54
Got an error _pickle.PicklingError use Dataset.from_spark. python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) cc @maddiedawson it looks like there an issue with `_validate_cache_dir` ? It looks like the function passed to mapPartitions has a reference to the Spark dataset builder, and therefore contains the SparkContext itself. I think it can be fixed by defining `create_cache_and_write_probe` outside the Spark dataset builder, and pass a `partial(create_cache_and_write_probe, cache_dir=self._cache_dir)` to `mapPartitions`
[ -0.48843914270401, -0.16567064821720123, 0.023851711302995682, 0.342393159866333, 0.29546353220939636, -0.0016700103878974915, 0.5267864465713501, 0.13773950934410095, 0.08715443313121796, 0.09700290113687515, 0.08231262862682343, 0.6951181888580322, -0.18221795558929443, 0.534705400466919, -0.23124101758003235, -0.06934304535388947, -0.04704969376325607, 0.039264824241399765, -0.10985326766967773, 0.12908247113227844, -0.14200012385845184, 0.16121813654899597, -0.01808219403028488, 0.21399259567260742, -0.4843328297138214, -0.231309175491333, 0.006972402334213257, 0.03154195845127106, 0.018942726776003838, -0.3429158627986908, 0.313438355922699, -0.2454288750886917, 0.2013145089149475, 0.4949146807193756, -0.00010675490193534642, 0.01567273586988449, 0.2840091586112976, 0.028392769396305084, -0.314598023891449, -0.30959469079971313, 0.13471263647079468, -0.19778898358345032, 0.29643747210502625, -0.43910902738571167, -0.08369485288858414, 0.43250513076782227, -0.08017265796661377, -0.13864339888095856, 0.5478284358978271, 0.24734270572662354, 0.27015239000320435, 0.4517420530319214, 0.1991659253835678, -0.040031660348176956, -0.1439032405614853, -0.017339251935482025, -0.15435540676116943, 0.32084476947784424, -0.019979581236839294, 0.15240848064422607, -0.04422430694103241, 0.07639868557453156, -0.19006851315498352, 0.0340421162545681, 0.2666608691215515, -0.029710572212934494, -0.29397904872894287, -0.3867027461528778, 0.26570549607276917, 0.08816342055797577, 0.7293922305107117, -0.3622656464576721, -0.17206242680549622, -0.15281938016414642, 0.04290788248181343, -0.19324371218681335, 0.3022192716598511, -0.05532742291688919, -0.10377654433250427, -0.00031681422842666507, -0.04705841839313507, -0.3268241584300995, -0.05620424821972847, -0.09130388498306274, -0.07042399793863297, 0.3694106340408325, -0.17559310793876648, 0.3669031858444214, 0.1439843773841858, -0.08147236704826355, 0.163551926612854, -0.1445881426334381, 0.2454797476530075, -0.11824564635753632, -0.16765622794628143, -0.07646176218986511, -0.05704488232731819, -0.37988364696502686, -0.1658407747745514, -0.009235458448529243, 0.05166662484407425, 0.10566215217113495, -0.0690285861492157, 0.14064621925354004, 0.39171695709228516, 0.09503094106912613, 0.25943511724472046, 0.3108334243297577, 0.16589297354221344, -0.14966623485088348, -0.03248227760195732, -0.048194076865911484, -0.11935416609048843, -0.10702995955944061, 0.053755536675453186, 0.15937170386314392, 0.21017953753471375, -0.06752143800258636, -0.2595706582069397, -0.05292907729744911, -0.10199006646871567, 0.024705614894628525, -0.11639519035816193, 0.16270029544830322, 0.028387755155563354, -0.040097109973430634, -0.032443445175886154, 0.10582709312438965, -0.017818205058574677, 0.015077043324708939, -0.23119217157363892, 0.1312452256679535, 0.014009326696395874, 0.01036861352622509, -0.04755803197622299, -0.5940120220184326, 0.40823978185653687, -0.02465178444981575, -0.31399816274642944, 0.08029543608427048, 0.15338575839996338, -0.2402248978614807, -0.3045228123664856, 0.12046806514263153, 0.1318781077861786, 0.36227214336395264, 0.3059762418270111, -0.3050527572631836, -0.11159853637218475, 0.05256544053554535, -0.2397823929786682, -0.1837444305419922, -0.4008563756942749, 0.15959343314170837, -0.04063710570335388, -0.18304124474525452, -0.5282720923423767, 0.0256996788084507, 0.22662124037742615, -0.19141940772533417, 0.00035498663783073425, -0.2466350495815277, -0.19719694554805756, -0.35548579692840576, 0.19525721669197083, 0.3952091336250305, -0.66365647315979, 0.021359562873840332, -0.09458775073289871, 0.036708708852529526, 0.31282174587249756, 0.08252416551113129, -0.21855221688747406, 0.2673502266407013, -0.23426973819732666, 0.47513547539711, -0.008300349116325378, -0.3230435848236084, -0.22636836767196655, 0.18730619549751282, -0.376230925321579, -0.012330524623394012, -0.10326776653528214, -0.03133902698755264, 0.22806121408939362, 0.03385819494724274, 0.14381778240203857, 0.102020263671875, 0.149306982755661, -0.03029513731598854, -0.1594909131526947, -0.27316123247146606, 0.1727900207042694, -0.12851151823997498, 0.16508357226848602, -0.19789204001426697, 0.12478742003440857, -0.008597645908594131, 0.12712770700454712, 0.0008042911067605019, 0.12674564123153687, 0.2316221296787262, 0.11026732623577118, 0.11881549656391144, -0.31191056966781616, 0.035000838339328766, -0.38043904304504395, 0.305532842874527, 0.36301547288894653, 0.07688874006271362, -0.11076830327510834, -0.2604900002479553, -0.20685067772865295, 0.061022594571113586, -0.21462634205818176, -0.12947270274162292, 0.19948023557662964, 0.0919211357831955, -0.09647390246391296, 0.0780244916677475, 0.06162522733211517, -0.022377025336027145, -0.07934519648551941, -0.03879750147461891, -0.1355755478143692, 0.39753100275993347, -0.3191072344779968, -0.2832922637462616, 0.032953403890132904, -0.07399891316890717, 0.17085754871368408, -0.010677820071578026, -0.1919638067483902, 0.35257628560066223, -0.062212321907281876, 0.1573559194803238, -0.03844183683395386, 0.01917029172182083, 0.15165022015571594, -0.028478339314460754, 0.129091277718544, 0.17126181721687317, 0.1252603828907013, -0.020883917808532715, -0.10580065101385117, 0.2479889988899231, 0.04871516302227974, -0.09727433323860168, -0.1972358226776123, 0.19235312938690186, 0.11158694326877594, 0.10080721974372864, 0.09383755922317505, -0.0493408627808094, -0.17186951637268066, -0.14005564153194427, 0.19607359170913696, 0.03694674372673035, -0.478084921836853, 0.1873379498720169, 0.40580058097839355, 0.23102131485939026, 0.3625015318393707, 0.0966106429696083, -0.3328748941421509, -0.1452840268611908, 0.42571914196014404, 0.17398016154766083, 0.30080822110176086, 0.08521902561187744, -0.03693167865276337, -0.1324012130498886, 0.10147888958454132, -0.05890171602368355, 0.20092035830020905, 0.08080720901489258, 0.37636664509773254, 0.25234827399253845, -0.012854043394327164, 0.09227663278579712, -0.22084611654281616, -0.08420360088348389, 0.09818841516971588, 0.2058887630701065, -0.27317360043525696, 0.09283456206321716, -0.27633556723594666, 0.04196059703826904, 0.07038228213787079, 0.17701390385627747, -0.08736677467823029, -0.20921236276626587, -0.17466270923614502, 0.5300981998443604, 0.1016426831483841, 0.12700295448303223, 0.04360904544591904, 0.015958935022354126, 0.2952112555503845, 0.10761521011590958, -0.2677100896835327, -0.29048648476600647, -0.2997124195098877, 0.10567128658294678, 0.1844245344400406, 0.043637849390506744, 0.1334964632987976, 0.27973097562789917, 0.09160035103559494, -0.5572537183761597, -0.07447202503681183, -0.008994640782475471, -0.355011522769928, 0.3088333010673523, 0.12117034196853638, 0.31236767768859863, -0.44169485569000244, -0.4222879409790039, 0.1773485243320465, -0.035133104771375656, -0.06181469187140465, 0.1698971837759018, 0.05092884600162506, -0.014580484479665756, 0.03782149404287338, -0.28063705563545227, -0.45962944626808167, -0.4042505919933319, 0.18550515174865723, 0.07152268290519714, -0.015743736177682877, 0.2632715702056885, 0.2631888687610626, 0.3224998116493225, 0.20266015827655792, -0.2776329517364502, -0.16388365626335144, -0.037463150918483734, 0.24195733666419983, -0.11848675459623337, -0.3290320634841919, 0.07159610092639923, 0.07021559774875641, 0.2398906946182251, -0.28412580490112305, -0.3833746910095215, -0.12762027978897095, 0.07998005300760269, 0.3615613877773285, -0.04471065476536751, -0.046909525990486145, 0.410428524017334, 0.2838413417339325, -0.09939128160476685, 0.03338033705949783, -0.0491744726896286, 0.050908926874399185, 0.22924315929412842, 0.0991777777671814, 0.0500485822558403, 0.41635391116142273, 0.04946410655975342, 0.6712242364883423, 0.015484854578971863, -0.3020526170730591, 0.4118693172931671, -0.20362669229507446, 0.12222006171941757, -0.21766780316829681, -0.3891103267669678, -0.009674079716205597, -0.37556636333465576, -0.06564228981733322, 0.08992023766040802, -0.3052992820739746, -0.0026901811361312866, -0.09685567021369934, -0.20383283495903015, -0.21202322840690613, -0.16117751598358154, -0.006439735181629658, -0.17209050059318542, 0.052725449204444885, -0.09541252255439758, 0.2716253697872162, -0.2242451310157776, -0.08387221395969391, 0.0059499070048332214, -0.2375609278678894, 0.1667604148387909, -0.078311488032341, -0.3555421829223633, -0.11552833020687103, -0.5387831926345825, 0.35099148750305176, -0.09951408207416534, 0.0833778828382492, -0.17881101369857788, 0.04309592396020889, 0.18945249915122986, -0.04780808463692665, 0.6059219837188721, -0.2965508699417114, 0.038359444588422775, 0.22590956091880798, -0.10697874426841736, -0.4911774694919586, -0.10355659574270248, -0.17874403297901154, 0.39056259393692017, 0.006684901192784309, 0.5836238861083984, -0.25484171509742737, -0.03250691294670105, -0.09976659715175629, -0.07121459394693375, -0.1348162293434143, 0.1880333125591278, -0.1508118212223053, -0.316060334444046, -0.4655391275882721, 0.11179642379283905, 0.007667064666748047, 0.2107909619808197, -0.1736886352300644, -0.002082154154777527, -0.02065054140985012, 0.005370758473873138, -0.20017372071743011, 0.026250317692756653, 0.25873106718063354, 0.15110787749290466, 0.11040134727954865, 0.22226187586784363, 0.06015610322356224, 0.1162220686674118, 0.29806986451148987, 0.11423296481370926, -0.06367703527212143, 0.06881802529096603, -0.03858669102191925, 0.19462771713733673, 0.11947748064994812, -0.0870044082403183, 0.11818252503871918, -0.033058878034353256, 0.13299775123596191, -0.10821769386529922, 0.20755425095558167, 0.21414685249328613, 0.0803304985165596, -0.05652308464050293, -0.34565138816833496, 0.3998227119445801, 0.07285282760858536, -0.004899829626083374, 0.38124316930770874, -0.03727409616112709, -0.23094281554222107, 0.477049320936203, 0.19104626774787903, 0.70973140001297, -0.05838438868522644, 0.1273350715637207, 0.3959960341453552, 0.18931107223033905, 0.5711786150932312, 0.0364600270986557, 0.11875776946544647, -0.4633328914642334, -0.07829537987709045, -0.03873124718666077, 0.02379631996154785, 0.09060066938400269, 0.02056727185845375, -0.4864681363105774, 0.13530293107032776, -0.24195563793182373, 0.018353503197431564, -0.28499966859817505, 0.3904263973236084, -0.220066100358963, -0.12183146178722382, 0.18300694227218628, 0.22899559140205383, -0.2597479820251465, 0.3744601011276245, -0.03798801824450493, -0.10575685650110245, -0.04059022292494774, -0.3184075355529785, -0.387999564409256, 0.18348349630832672, -0.2437230497598648, 0.666570246219635, -0.16427351534366608, -0.323749840259552, 0.03729648143053055, 0.3030259907245636, 0.06916087120771408, 0.0648137554526329, -0.141044482588768, 0.051495861262083054, -0.04300461336970329, -0.17604322731494904, 0.07645390927791595, -0.03144152835011482, 0.3427593410015106, -0.08143070340156555, -0.2253265380859375, 0.2992083728313446, 0.053492091596126556, -0.1764785200357437, 0.17312079668045044, -0.09363438934087753, -0.027008336037397385, -0.5017267465591431, -0.25443363189697266, -0.08874090760946274, -0.31999123096466064, -0.3003639280796051, 0.11588796228170395, -0.1051839143037796, 0.10083472728729248, 0.14408977329730988, 0.0020701694302260876, 0.030001506209373474, 0.09683623909950256, 0.5596949458122253, -0.02987762540578842, 0.2831663489341736, 0.5352457761764526, 0.3073679804801941, -0.18730932474136353, -0.22526878118515015, 0.05681702494621277, -0.022312548011541367, -0.13041538000106812, 0.13161881268024445, 0.04791836440563202, 0.03231041133403778, -0.06732922047376633, 0.607498824596405, 0.21248272061347961, 0.018627941608428955, -0.24046126008033752, -0.12279835343360901, -0.3787522614002228, 0.25533726811408997, -0.013729291968047619, 0.26868048310279846, 0.14105460047721863, -0.05577203631401062, 0.10077281296253204, 0.004142783582210541, -0.3299327790737152, 0.023612983524799347, -0.48920994997024536, -0.03248216584324837, 0.5329434871673584, -0.28666603565216064, 0.04373297095298767, -0.1450985223054886, 0.16419833898544312, 0.16878700256347656, -0.05920936539769173, -0.25963348150253296, 0.11275520920753479, 0.024379685521125793, 0.1439802646636963, -0.15420261025428772, -0.24141135811805725, -0.29860806465148926, -0.18404936790466309, -0.15526822209358215, 0.05834595113992691, 0.23942306637763977, -0.08322818577289581, 0.009024471044540405, 0.045243486762046814, 0.16640394926071167, -0.1741066575050354, -0.026176463812589645, 0.01728915050625801, 0.020542878657579422, -0.1106104701757431, 0.19504471123218536, 0.28023990988731384, -0.05793619900941849, -0.3176884651184082, 0.10625895857810974, 0.09238244593143463, 0.22029197216033936, 0.3055327534675598, -0.3075252175331116, -0.1283978372812271, 0.08001372218132019, 0.25877270102500916, 0.11910627782344818, -0.16067856550216675, -0.09613349288702011, 0.24923892319202423, 0.23783595860004425, -0.2879294157028198, -0.16794389486312866, 0.20640870928764343, -0.18060290813446045, 0.03164795786142349, -0.16450373828411102, 0.18262635171413422, 0.08559362590312958, -0.5627004504203796, 0.27786436676979065, 0.6208098530769348, -0.2715016305446625, 0.10375426709651947, 0.3306465744972229, -0.14162233471870422, -0.08550207316875458, 0.3744335472583771, 0.24710659682750702, 0.1989920288324356, 0.3710246980190277, 0.10279673337936401, 0.31956353783607483, 0.11608099937438965, 0.07658189535140991, 0.15229645371437073, -0.5786861777305603, 0.1353222280740738, -0.21423108875751495, -0.31858697533607483, -0.0367383174598217, -0.06891679763793945, 0.1564408540725708, -0.46050724387168884, -0.2527894079685211, -0.24773789942264557, 0.3982545733451843, -0.44157037138938904, 0.10705192387104034, -0.26521921157836914, -0.04137203097343445, 0.2149837762117386, 0.1461452841758728, -0.10677282512187958, -0.08289177715778351, 0.39346247911453247, -0.034442514181137085, -0.21685726940631866, 0.14638756215572357, -0.044224999845027924, 0.053625572472810745, 0.19686439633369446, -0.2352333664894104, 0.08461973816156387, 0.08095423877239227, 0.057794757187366486, -0.5923621654510498, 0.29745960235595703, 0.5952128767967224, 0.04066655784845352, -0.214002326130867, 0.22929747402668, 0.12134827673435211, -0.050843290984630585, 0.1087491363286972, -0.08641481399536133, 0.032994866371154785, 0.2000422179698944, 0.320449560880661, 0.24780762195587158, -0.17222373187541962, 0.06748436391353607, 0.17034578323364258, 0.36929330229759216, -0.00627652183175087, -0.1072768121957779, 0.08039309084415436, -0.37079712748527527, -0.009130310267210007, 0.020115260034799576, -0.3438471555709839, 0.09652717411518097, 0.6157697439193726, 0.16977474093437195, 0.19134601950645447, -0.18068304657936096, 0.12864726781845093, -0.01275720726698637, 0.27692711353302, 0.2139473706483841, -0.0006613591685891151, -0.3684423863887787, 0.22497887909412384, -0.4956745505332947, 0.13733288645744324, 0.08699913322925568, -0.21549087762832642, -0.009299764409661293, -0.0005268491804599762, 0.2668376564979553, -0.01315687783062458, -0.13069674372673035, 0.13080768287181854, 0.05205923318862915, 0.08468524366617203, -0.22190821170806885, -0.009729031473398209, -0.03260798379778862, -0.02727421745657921, 0.08261395990848541, -0.33501967787742615, 0.3439114987850189, -0.04685257375240326, 0.1371639221906662, -0.1382519155740738, -0.25011759996414185, 0.2505011558532715, -0.2741953730583191, 0.554974377155304, -0.24414564669132233, 0.561347246170044, -0.16591957211494446, 0.0708976686000824, 0.06837760657072067, -0.1940852254629135, -0.1503438651561737, -0.010258737951517105, 0.0018270546570420265, 0.42671138048171997, -0.16388067603111267, 0.3537277579307556, -0.3989887237548828, -0.0048049986362457275, -0.12990932166576385, 0.20126008987426758, -0.17572160065174103, -0.03960051387548447, -0.202871173620224, -0.1260392963886261, 0.186513289809227, 0.23655205965042114, -0.011244051158428192, 0.15950262546539307, -0.3451300263404846, -0.4063379168510437, 0.6743062138557434, -0.23133307695388794, -0.22282293438911438, -0.21850106120109558, -0.04572112113237381, 0.22127407789230347, 0.1505010575056076, -0.19260716438293457, -0.008943259716033936, 0.3270154297351837, -0.020650235936045647, -0.24006937444210052, -0.039585649967193604, -0.02763344720005989, 0.0022824332118034363, -0.03804818168282509, 0.28808772563934326, -0.23654130101203918, -0.1487940549850464, -0.028872400522232056, -0.14390547573566437 ]
https://github.com/huggingface/datasets/issues/5963
Just saw this; thanks for flagging! Your proposed solution sounds good. I can prepare a PR
Got an error _pickle.PicklingError use Dataset.from_spark.
python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
16
Got an error _pickle.PicklingError use Dataset.from_spark. python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) Just saw this; thanks for flagging! Your proposed solution sounds good. I can prepare a PR
[ -0.48843914270401, -0.16567064821720123, 0.023851711302995682, 0.342393159866333, 0.29546353220939636, -0.0016700103878974915, 0.5267864465713501, 0.13773950934410095, 0.08715443313121796, 0.09700290113687515, 0.08231262862682343, 0.6951181888580322, -0.18221795558929443, 0.534705400466919, -0.23124101758003235, -0.06934304535388947, -0.04704969376325607, 0.039264824241399765, -0.10985326766967773, 0.12908247113227844, -0.14200012385845184, 0.16121813654899597, -0.01808219403028488, 0.21399259567260742, -0.4843328297138214, -0.231309175491333, 0.006972402334213257, 0.03154195845127106, 0.018942726776003838, -0.3429158627986908, 0.313438355922699, -0.2454288750886917, 0.2013145089149475, 0.4949146807193756, -0.00010675490193534642, 0.01567273586988449, 0.2840091586112976, 0.028392769396305084, -0.314598023891449, -0.30959469079971313, 0.13471263647079468, -0.19778898358345032, 0.29643747210502625, -0.43910902738571167, -0.08369485288858414, 0.43250513076782227, -0.08017265796661377, -0.13864339888095856, 0.5478284358978271, 0.24734270572662354, 0.27015239000320435, 0.4517420530319214, 0.1991659253835678, -0.040031660348176956, -0.1439032405614853, -0.017339251935482025, -0.15435540676116943, 0.32084476947784424, -0.019979581236839294, 0.15240848064422607, -0.04422430694103241, 0.07639868557453156, -0.19006851315498352, 0.0340421162545681, 0.2666608691215515, -0.029710572212934494, -0.29397904872894287, -0.3867027461528778, 0.26570549607276917, 0.08816342055797577, 0.7293922305107117, -0.3622656464576721, -0.17206242680549622, -0.15281938016414642, 0.04290788248181343, -0.19324371218681335, 0.3022192716598511, -0.05532742291688919, -0.10377654433250427, -0.00031681422842666507, -0.04705841839313507, -0.3268241584300995, -0.05620424821972847, -0.09130388498306274, -0.07042399793863297, 0.3694106340408325, -0.17559310793876648, 0.3669031858444214, 0.1439843773841858, -0.08147236704826355, 0.163551926612854, -0.1445881426334381, 0.2454797476530075, -0.11824564635753632, -0.16765622794628143, -0.07646176218986511, -0.05704488232731819, -0.37988364696502686, -0.1658407747745514, -0.009235458448529243, 0.05166662484407425, 0.10566215217113495, -0.0690285861492157, 0.14064621925354004, 0.39171695709228516, 0.09503094106912613, 0.25943511724472046, 0.3108334243297577, 0.16589297354221344, -0.14966623485088348, -0.03248227760195732, -0.048194076865911484, -0.11935416609048843, -0.10702995955944061, 0.053755536675453186, 0.15937170386314392, 0.21017953753471375, -0.06752143800258636, -0.2595706582069397, -0.05292907729744911, -0.10199006646871567, 0.024705614894628525, -0.11639519035816193, 0.16270029544830322, 0.028387755155563354, -0.040097109973430634, -0.032443445175886154, 0.10582709312438965, -0.017818205058574677, 0.015077043324708939, -0.23119217157363892, 0.1312452256679535, 0.014009326696395874, 0.01036861352622509, -0.04755803197622299, -0.5940120220184326, 0.40823978185653687, -0.02465178444981575, -0.31399816274642944, 0.08029543608427048, 0.15338575839996338, -0.2402248978614807, -0.3045228123664856, 0.12046806514263153, 0.1318781077861786, 0.36227214336395264, 0.3059762418270111, -0.3050527572631836, -0.11159853637218475, 0.05256544053554535, -0.2397823929786682, -0.1837444305419922, -0.4008563756942749, 0.15959343314170837, -0.04063710570335388, -0.18304124474525452, -0.5282720923423767, 0.0256996788084507, 0.22662124037742615, -0.19141940772533417, 0.00035498663783073425, -0.2466350495815277, -0.19719694554805756, -0.35548579692840576, 0.19525721669197083, 0.3952091336250305, -0.66365647315979, 0.021359562873840332, -0.09458775073289871, 0.036708708852529526, 0.31282174587249756, 0.08252416551113129, -0.21855221688747406, 0.2673502266407013, -0.23426973819732666, 0.47513547539711, -0.008300349116325378, -0.3230435848236084, -0.22636836767196655, 0.18730619549751282, -0.376230925321579, -0.012330524623394012, -0.10326776653528214, -0.03133902698755264, 0.22806121408939362, 0.03385819494724274, 0.14381778240203857, 0.102020263671875, 0.149306982755661, -0.03029513731598854, -0.1594909131526947, -0.27316123247146606, 0.1727900207042694, -0.12851151823997498, 0.16508357226848602, -0.19789204001426697, 0.12478742003440857, -0.008597645908594131, 0.12712770700454712, 0.0008042911067605019, 0.12674564123153687, 0.2316221296787262, 0.11026732623577118, 0.11881549656391144, -0.31191056966781616, 0.035000838339328766, -0.38043904304504395, 0.305532842874527, 0.36301547288894653, 0.07688874006271362, -0.11076830327510834, -0.2604900002479553, -0.20685067772865295, 0.061022594571113586, -0.21462634205818176, -0.12947270274162292, 0.19948023557662964, 0.0919211357831955, -0.09647390246391296, 0.0780244916677475, 0.06162522733211517, -0.022377025336027145, -0.07934519648551941, -0.03879750147461891, -0.1355755478143692, 0.39753100275993347, -0.3191072344779968, -0.2832922637462616, 0.032953403890132904, -0.07399891316890717, 0.17085754871368408, -0.010677820071578026, -0.1919638067483902, 0.35257628560066223, -0.062212321907281876, 0.1573559194803238, -0.03844183683395386, 0.01917029172182083, 0.15165022015571594, -0.028478339314460754, 0.129091277718544, 0.17126181721687317, 0.1252603828907013, -0.020883917808532715, -0.10580065101385117, 0.2479889988899231, 0.04871516302227974, -0.09727433323860168, -0.1972358226776123, 0.19235312938690186, 0.11158694326877594, 0.10080721974372864, 0.09383755922317505, -0.0493408627808094, -0.17186951637268066, -0.14005564153194427, 0.19607359170913696, 0.03694674372673035, -0.478084921836853, 0.1873379498720169, 0.40580058097839355, 0.23102131485939026, 0.3625015318393707, 0.0966106429696083, -0.3328748941421509, -0.1452840268611908, 0.42571914196014404, 0.17398016154766083, 0.30080822110176086, 0.08521902561187744, -0.03693167865276337, -0.1324012130498886, 0.10147888958454132, -0.05890171602368355, 0.20092035830020905, 0.08080720901489258, 0.37636664509773254, 0.25234827399253845, -0.012854043394327164, 0.09227663278579712, -0.22084611654281616, -0.08420360088348389, 0.09818841516971588, 0.2058887630701065, -0.27317360043525696, 0.09283456206321716, -0.27633556723594666, 0.04196059703826904, 0.07038228213787079, 0.17701390385627747, -0.08736677467823029, -0.20921236276626587, -0.17466270923614502, 0.5300981998443604, 0.1016426831483841, 0.12700295448303223, 0.04360904544591904, 0.015958935022354126, 0.2952112555503845, 0.10761521011590958, -0.2677100896835327, -0.29048648476600647, -0.2997124195098877, 0.10567128658294678, 0.1844245344400406, 0.043637849390506744, 0.1334964632987976, 0.27973097562789917, 0.09160035103559494, -0.5572537183761597, -0.07447202503681183, -0.008994640782475471, -0.355011522769928, 0.3088333010673523, 0.12117034196853638, 0.31236767768859863, -0.44169485569000244, -0.4222879409790039, 0.1773485243320465, -0.035133104771375656, -0.06181469187140465, 0.1698971837759018, 0.05092884600162506, -0.014580484479665756, 0.03782149404287338, -0.28063705563545227, -0.45962944626808167, -0.4042505919933319, 0.18550515174865723, 0.07152268290519714, -0.015743736177682877, 0.2632715702056885, 0.2631888687610626, 0.3224998116493225, 0.20266015827655792, -0.2776329517364502, -0.16388365626335144, -0.037463150918483734, 0.24195733666419983, -0.11848675459623337, -0.3290320634841919, 0.07159610092639923, 0.07021559774875641, 0.2398906946182251, -0.28412580490112305, -0.3833746910095215, -0.12762027978897095, 0.07998005300760269, 0.3615613877773285, -0.04471065476536751, -0.046909525990486145, 0.410428524017334, 0.2838413417339325, -0.09939128160476685, 0.03338033705949783, -0.0491744726896286, 0.050908926874399185, 0.22924315929412842, 0.0991777777671814, 0.0500485822558403, 0.41635391116142273, 0.04946410655975342, 0.6712242364883423, 0.015484854578971863, -0.3020526170730591, 0.4118693172931671, -0.20362669229507446, 0.12222006171941757, -0.21766780316829681, -0.3891103267669678, -0.009674079716205597, -0.37556636333465576, -0.06564228981733322, 0.08992023766040802, -0.3052992820739746, -0.0026901811361312866, -0.09685567021369934, -0.20383283495903015, -0.21202322840690613, -0.16117751598358154, -0.006439735181629658, -0.17209050059318542, 0.052725449204444885, -0.09541252255439758, 0.2716253697872162, -0.2242451310157776, -0.08387221395969391, 0.0059499070048332214, -0.2375609278678894, 0.1667604148387909, -0.078311488032341, -0.3555421829223633, -0.11552833020687103, -0.5387831926345825, 0.35099148750305176, -0.09951408207416534, 0.0833778828382492, -0.17881101369857788, 0.04309592396020889, 0.18945249915122986, -0.04780808463692665, 0.6059219837188721, -0.2965508699417114, 0.038359444588422775, 0.22590956091880798, -0.10697874426841736, -0.4911774694919586, -0.10355659574270248, -0.17874403297901154, 0.39056259393692017, 0.006684901192784309, 0.5836238861083984, -0.25484171509742737, -0.03250691294670105, -0.09976659715175629, -0.07121459394693375, -0.1348162293434143, 0.1880333125591278, -0.1508118212223053, -0.316060334444046, -0.4655391275882721, 0.11179642379283905, 0.007667064666748047, 0.2107909619808197, -0.1736886352300644, -0.002082154154777527, -0.02065054140985012, 0.005370758473873138, -0.20017372071743011, 0.026250317692756653, 0.25873106718063354, 0.15110787749290466, 0.11040134727954865, 0.22226187586784363, 0.06015610322356224, 0.1162220686674118, 0.29806986451148987, 0.11423296481370926, -0.06367703527212143, 0.06881802529096603, -0.03858669102191925, 0.19462771713733673, 0.11947748064994812, -0.0870044082403183, 0.11818252503871918, -0.033058878034353256, 0.13299775123596191, -0.10821769386529922, 0.20755425095558167, 0.21414685249328613, 0.0803304985165596, -0.05652308464050293, -0.34565138816833496, 0.3998227119445801, 0.07285282760858536, -0.004899829626083374, 0.38124316930770874, -0.03727409616112709, -0.23094281554222107, 0.477049320936203, 0.19104626774787903, 0.70973140001297, -0.05838438868522644, 0.1273350715637207, 0.3959960341453552, 0.18931107223033905, 0.5711786150932312, 0.0364600270986557, 0.11875776946544647, -0.4633328914642334, -0.07829537987709045, -0.03873124718666077, 0.02379631996154785, 0.09060066938400269, 0.02056727185845375, -0.4864681363105774, 0.13530293107032776, -0.24195563793182373, 0.018353503197431564, -0.28499966859817505, 0.3904263973236084, -0.220066100358963, -0.12183146178722382, 0.18300694227218628, 0.22899559140205383, -0.2597479820251465, 0.3744601011276245, -0.03798801824450493, -0.10575685650110245, -0.04059022292494774, -0.3184075355529785, -0.387999564409256, 0.18348349630832672, -0.2437230497598648, 0.666570246219635, -0.16427351534366608, -0.323749840259552, 0.03729648143053055, 0.3030259907245636, 0.06916087120771408, 0.0648137554526329, -0.141044482588768, 0.051495861262083054, -0.04300461336970329, -0.17604322731494904, 0.07645390927791595, -0.03144152835011482, 0.3427593410015106, -0.08143070340156555, -0.2253265380859375, 0.2992083728313446, 0.053492091596126556, -0.1764785200357437, 0.17312079668045044, -0.09363438934087753, -0.027008336037397385, -0.5017267465591431, -0.25443363189697266, -0.08874090760946274, -0.31999123096466064, -0.3003639280796051, 0.11588796228170395, -0.1051839143037796, 0.10083472728729248, 0.14408977329730988, 0.0020701694302260876, 0.030001506209373474, 0.09683623909950256, 0.5596949458122253, -0.02987762540578842, 0.2831663489341736, 0.5352457761764526, 0.3073679804801941, -0.18730932474136353, -0.22526878118515015, 0.05681702494621277, -0.022312548011541367, -0.13041538000106812, 0.13161881268024445, 0.04791836440563202, 0.03231041133403778, -0.06732922047376633, 0.607498824596405, 0.21248272061347961, 0.018627941608428955, -0.24046126008033752, -0.12279835343360901, -0.3787522614002228, 0.25533726811408997, -0.013729291968047619, 0.26868048310279846, 0.14105460047721863, -0.05577203631401062, 0.10077281296253204, 0.004142783582210541, -0.3299327790737152, 0.023612983524799347, -0.48920994997024536, -0.03248216584324837, 0.5329434871673584, -0.28666603565216064, 0.04373297095298767, -0.1450985223054886, 0.16419833898544312, 0.16878700256347656, -0.05920936539769173, -0.25963348150253296, 0.11275520920753479, 0.024379685521125793, 0.1439802646636963, -0.15420261025428772, -0.24141135811805725, -0.29860806465148926, -0.18404936790466309, -0.15526822209358215, 0.05834595113992691, 0.23942306637763977, -0.08322818577289581, 0.009024471044540405, 0.045243486762046814, 0.16640394926071167, -0.1741066575050354, -0.026176463812589645, 0.01728915050625801, 0.020542878657579422, -0.1106104701757431, 0.19504471123218536, 0.28023990988731384, -0.05793619900941849, -0.3176884651184082, 0.10625895857810974, 0.09238244593143463, 0.22029197216033936, 0.3055327534675598, -0.3075252175331116, -0.1283978372812271, 0.08001372218132019, 0.25877270102500916, 0.11910627782344818, -0.16067856550216675, -0.09613349288702011, 0.24923892319202423, 0.23783595860004425, -0.2879294157028198, -0.16794389486312866, 0.20640870928764343, -0.18060290813446045, 0.03164795786142349, -0.16450373828411102, 0.18262635171413422, 0.08559362590312958, -0.5627004504203796, 0.27786436676979065, 0.6208098530769348, -0.2715016305446625, 0.10375426709651947, 0.3306465744972229, -0.14162233471870422, -0.08550207316875458, 0.3744335472583771, 0.24710659682750702, 0.1989920288324356, 0.3710246980190277, 0.10279673337936401, 0.31956353783607483, 0.11608099937438965, 0.07658189535140991, 0.15229645371437073, -0.5786861777305603, 0.1353222280740738, -0.21423108875751495, -0.31858697533607483, -0.0367383174598217, -0.06891679763793945, 0.1564408540725708, -0.46050724387168884, -0.2527894079685211, -0.24773789942264557, 0.3982545733451843, -0.44157037138938904, 0.10705192387104034, -0.26521921157836914, -0.04137203097343445, 0.2149837762117386, 0.1461452841758728, -0.10677282512187958, -0.08289177715778351, 0.39346247911453247, -0.034442514181137085, -0.21685726940631866, 0.14638756215572357, -0.044224999845027924, 0.053625572472810745, 0.19686439633369446, -0.2352333664894104, 0.08461973816156387, 0.08095423877239227, 0.057794757187366486, -0.5923621654510498, 0.29745960235595703, 0.5952128767967224, 0.04066655784845352, -0.214002326130867, 0.22929747402668, 0.12134827673435211, -0.050843290984630585, 0.1087491363286972, -0.08641481399536133, 0.032994866371154785, 0.2000422179698944, 0.320449560880661, 0.24780762195587158, -0.17222373187541962, 0.06748436391353607, 0.17034578323364258, 0.36929330229759216, -0.00627652183175087, -0.1072768121957779, 0.08039309084415436, -0.37079712748527527, -0.009130310267210007, 0.020115260034799576, -0.3438471555709839, 0.09652717411518097, 0.6157697439193726, 0.16977474093437195, 0.19134601950645447, -0.18068304657936096, 0.12864726781845093, -0.01275720726698637, 0.27692711353302, 0.2139473706483841, -0.0006613591685891151, -0.3684423863887787, 0.22497887909412384, -0.4956745505332947, 0.13733288645744324, 0.08699913322925568, -0.21549087762832642, -0.009299764409661293, -0.0005268491804599762, 0.2668376564979553, -0.01315687783062458, -0.13069674372673035, 0.13080768287181854, 0.05205923318862915, 0.08468524366617203, -0.22190821170806885, -0.009729031473398209, -0.03260798379778862, -0.02727421745657921, 0.08261395990848541, -0.33501967787742615, 0.3439114987850189, -0.04685257375240326, 0.1371639221906662, -0.1382519155740738, -0.25011759996414185, 0.2505011558532715, -0.2741953730583191, 0.554974377155304, -0.24414564669132233, 0.561347246170044, -0.16591957211494446, 0.0708976686000824, 0.06837760657072067, -0.1940852254629135, -0.1503438651561737, -0.010258737951517105, 0.0018270546570420265, 0.42671138048171997, -0.16388067603111267, 0.3537277579307556, -0.3989887237548828, -0.0048049986362457275, -0.12990932166576385, 0.20126008987426758, -0.17572160065174103, -0.03960051387548447, -0.202871173620224, -0.1260392963886261, 0.186513289809227, 0.23655205965042114, -0.011244051158428192, 0.15950262546539307, -0.3451300263404846, -0.4063379168510437, 0.6743062138557434, -0.23133307695388794, -0.22282293438911438, -0.21850106120109558, -0.04572112113237381, 0.22127407789230347, 0.1505010575056076, -0.19260716438293457, -0.008943259716033936, 0.3270154297351837, -0.020650235936045647, -0.24006937444210052, -0.039585649967193604, -0.02763344720005989, 0.0022824332118034363, -0.03804818168282509, 0.28808772563934326, -0.23654130101203918, -0.1487940549850464, -0.028872400522232056, -0.14390547573566437 ]
https://github.com/huggingface/datasets/issues/5963
@maddiedawson can you show me the demo ,so i can test in local .before your PR
Got an error _pickle.PicklingError use Dataset.from_spark.
python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
16
Got an error _pickle.PicklingError use Dataset.from_spark. python 3.9.2 Got an error _pickle.PicklingError use Dataset.from_spark. Did the dataset import load data from spark dataframe using multi-node Spark cluster df = spark.read.parquet(args.input_data).repartition(50) ds = Dataset.from_spark(df, keep_in_memory=True, cache_dir="/pnc-data/data/nuplan/t5_spark/cache_data") ds.save_to_disk(args.output_data) Error : _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) _Originally posted by @yanzia12138 in https://github.com/huggingface/datasets/issues/5701#issuecomment-1594674306_ W Traceback (most recent call last): File "/home/work/main.py", line 100, in <module> run(args) File "/home/work/main.py", line 80, in run ds = Dataset.from_spark(df1, keep_in_memory=True, File "/home/work/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 1281, in from_spark return SparkDatasetReader( File "/home/work/.local/lib/python3.9/site-packages/datasets/io/spark.py", line 53, in read self.builder.download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/work/.local/lib/python3.9/site-packages/datasets/builder.py", line 1004, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 254, in _prepare_split self._validate_cache_dir() File "/home/work/.local/lib/python3.9/site-packages/datasets/packaged_modules/spark/spark.py", line 122, in _validate_cache_dir self._spark.sparkContext.parallelize(range(1), 1).mapPartitions(create_cache_and_write_probe).collect() File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 950, in collect sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd()) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2951, in _jrdd wrapped_func = _wrap_function(self.ctx, self.func, self._prev_jrdd_deserializer, File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2830, in _wrap_function pickled_command, broadcast_vars, env, includes = _prepare_for_python_RDD(sc, command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/rdd.py", line 2816, in _prepare_for_python_RDD pickled_command = ser.dumps(command) File "/home/work/.local/lib/python3.9/site-packages/pyspark/serializers.py", line 447, in dumps raise pickle.PicklingError(msg) _pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. S parkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063. 23/06/19 13:51:21 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.) @maddiedawson can you show me the demo ,so i can test in local .before your PR
[ -0.48843914270401, -0.16567064821720123, 0.023851711302995682, 0.342393159866333, 0.29546353220939636, -0.0016700103878974915, 0.5267864465713501, 0.13773950934410095, 0.08715443313121796, 0.09700290113687515, 0.08231262862682343, 0.6951181888580322, -0.18221795558929443, 0.534705400466919, -0.23124101758003235, -0.06934304535388947, -0.04704969376325607, 0.039264824241399765, -0.10985326766967773, 0.12908247113227844, -0.14200012385845184, 0.16121813654899597, -0.01808219403028488, 0.21399259567260742, -0.4843328297138214, -0.231309175491333, 0.006972402334213257, 0.03154195845127106, 0.018942726776003838, -0.3429158627986908, 0.313438355922699, -0.2454288750886917, 0.2013145089149475, 0.4949146807193756, -0.00010675490193534642, 0.01567273586988449, 0.2840091586112976, 0.028392769396305084, -0.314598023891449, -0.30959469079971313, 0.13471263647079468, -0.19778898358345032, 0.29643747210502625, -0.43910902738571167, -0.08369485288858414, 0.43250513076782227, -0.08017265796661377, -0.13864339888095856, 0.5478284358978271, 0.24734270572662354, 0.27015239000320435, 0.4517420530319214, 0.1991659253835678, -0.040031660348176956, -0.1439032405614853, -0.017339251935482025, -0.15435540676116943, 0.32084476947784424, -0.019979581236839294, 0.15240848064422607, -0.04422430694103241, 0.07639868557453156, -0.19006851315498352, 0.0340421162545681, 0.2666608691215515, -0.029710572212934494, -0.29397904872894287, -0.3867027461528778, 0.26570549607276917, 0.08816342055797577, 0.7293922305107117, -0.3622656464576721, -0.17206242680549622, -0.15281938016414642, 0.04290788248181343, -0.19324371218681335, 0.3022192716598511, -0.05532742291688919, -0.10377654433250427, -0.00031681422842666507, -0.04705841839313507, -0.3268241584300995, -0.05620424821972847, -0.09130388498306274, -0.07042399793863297, 0.3694106340408325, -0.17559310793876648, 0.3669031858444214, 0.1439843773841858, -0.08147236704826355, 0.163551926612854, -0.1445881426334381, 0.2454797476530075, -0.11824564635753632, -0.16765622794628143, -0.07646176218986511, -0.05704488232731819, -0.37988364696502686, -0.1658407747745514, -0.009235458448529243, 0.05166662484407425, 0.10566215217113495, -0.0690285861492157, 0.14064621925354004, 0.39171695709228516, 0.09503094106912613, 0.25943511724472046, 0.3108334243297577, 0.16589297354221344, -0.14966623485088348, -0.03248227760195732, -0.048194076865911484, -0.11935416609048843, -0.10702995955944061, 0.053755536675453186, 0.15937170386314392, 0.21017953753471375, -0.06752143800258636, -0.2595706582069397, -0.05292907729744911, -0.10199006646871567, 0.024705614894628525, -0.11639519035816193, 0.16270029544830322, 0.028387755155563354, -0.040097109973430634, -0.032443445175886154, 0.10582709312438965, -0.017818205058574677, 0.015077043324708939, -0.23119217157363892, 0.1312452256679535, 0.014009326696395874, 0.01036861352622509, -0.04755803197622299, -0.5940120220184326, 0.40823978185653687, -0.02465178444981575, -0.31399816274642944, 0.08029543608427048, 0.15338575839996338, -0.2402248978614807, -0.3045228123664856, 0.12046806514263153, 0.1318781077861786, 0.36227214336395264, 0.3059762418270111, -0.3050527572631836, -0.11159853637218475, 0.05256544053554535, -0.2397823929786682, -0.1837444305419922, -0.4008563756942749, 0.15959343314170837, -0.04063710570335388, -0.18304124474525452, -0.5282720923423767, 0.0256996788084507, 0.22662124037742615, -0.19141940772533417, 0.00035498663783073425, -0.2466350495815277, -0.19719694554805756, -0.35548579692840576, 0.19525721669197083, 0.3952091336250305, -0.66365647315979, 0.021359562873840332, -0.09458775073289871, 0.036708708852529526, 0.31282174587249756, 0.08252416551113129, -0.21855221688747406, 0.2673502266407013, -0.23426973819732666, 0.47513547539711, -0.008300349116325378, -0.3230435848236084, -0.22636836767196655, 0.18730619549751282, -0.376230925321579, -0.012330524623394012, -0.10326776653528214, -0.03133902698755264, 0.22806121408939362, 0.03385819494724274, 0.14381778240203857, 0.102020263671875, 0.149306982755661, -0.03029513731598854, -0.1594909131526947, -0.27316123247146606, 0.1727900207042694, -0.12851151823997498, 0.16508357226848602, -0.19789204001426697, 0.12478742003440857, -0.008597645908594131, 0.12712770700454712, 0.0008042911067605019, 0.12674564123153687, 0.2316221296787262, 0.11026732623577118, 0.11881549656391144, -0.31191056966781616, 0.035000838339328766, -0.38043904304504395, 0.305532842874527, 0.36301547288894653, 0.07688874006271362, -0.11076830327510834, -0.2604900002479553, -0.20685067772865295, 0.061022594571113586, -0.21462634205818176, -0.12947270274162292, 0.19948023557662964, 0.0919211357831955, -0.09647390246391296, 0.0780244916677475, 0.06162522733211517, -0.022377025336027145, -0.07934519648551941, -0.03879750147461891, -0.1355755478143692, 0.39753100275993347, -0.3191072344779968, -0.2832922637462616, 0.032953403890132904, -0.07399891316890717, 0.17085754871368408, -0.010677820071578026, -0.1919638067483902, 0.35257628560066223, -0.062212321907281876, 0.1573559194803238, -0.03844183683395386, 0.01917029172182083, 0.15165022015571594, -0.028478339314460754, 0.129091277718544, 0.17126181721687317, 0.1252603828907013, -0.020883917808532715, -0.10580065101385117, 0.2479889988899231, 0.04871516302227974, -0.09727433323860168, -0.1972358226776123, 0.19235312938690186, 0.11158694326877594, 0.10080721974372864, 0.09383755922317505, -0.0493408627808094, -0.17186951637268066, -0.14005564153194427, 0.19607359170913696, 0.03694674372673035, -0.478084921836853, 0.1873379498720169, 0.40580058097839355, 0.23102131485939026, 0.3625015318393707, 0.0966106429696083, -0.3328748941421509, -0.1452840268611908, 0.42571914196014404, 0.17398016154766083, 0.30080822110176086, 0.08521902561187744, -0.03693167865276337, -0.1324012130498886, 0.10147888958454132, -0.05890171602368355, 0.20092035830020905, 0.08080720901489258, 0.37636664509773254, 0.25234827399253845, -0.012854043394327164, 0.09227663278579712, -0.22084611654281616, -0.08420360088348389, 0.09818841516971588, 0.2058887630701065, -0.27317360043525696, 0.09283456206321716, -0.27633556723594666, 0.04196059703826904, 0.07038228213787079, 0.17701390385627747, -0.08736677467823029, -0.20921236276626587, -0.17466270923614502, 0.5300981998443604, 0.1016426831483841, 0.12700295448303223, 0.04360904544591904, 0.015958935022354126, 0.2952112555503845, 0.10761521011590958, -0.2677100896835327, -0.29048648476600647, -0.2997124195098877, 0.10567128658294678, 0.1844245344400406, 0.043637849390506744, 0.1334964632987976, 0.27973097562789917, 0.09160035103559494, -0.5572537183761597, -0.07447202503681183, -0.008994640782475471, -0.355011522769928, 0.3088333010673523, 0.12117034196853638, 0.31236767768859863, -0.44169485569000244, -0.4222879409790039, 0.1773485243320465, -0.035133104771375656, -0.06181469187140465, 0.1698971837759018, 0.05092884600162506, -0.014580484479665756, 0.03782149404287338, -0.28063705563545227, -0.45962944626808167, -0.4042505919933319, 0.18550515174865723, 0.07152268290519714, -0.015743736177682877, 0.2632715702056885, 0.2631888687610626, 0.3224998116493225, 0.20266015827655792, -0.2776329517364502, -0.16388365626335144, -0.037463150918483734, 0.24195733666419983, -0.11848675459623337, -0.3290320634841919, 0.07159610092639923, 0.07021559774875641, 0.2398906946182251, -0.28412580490112305, -0.3833746910095215, -0.12762027978897095, 0.07998005300760269, 0.3615613877773285, -0.04471065476536751, -0.046909525990486145, 0.410428524017334, 0.2838413417339325, -0.09939128160476685, 0.03338033705949783, -0.0491744726896286, 0.050908926874399185, 0.22924315929412842, 0.0991777777671814, 0.0500485822558403, 0.41635391116142273, 0.04946410655975342, 0.6712242364883423, 0.015484854578971863, -0.3020526170730591, 0.4118693172931671, -0.20362669229507446, 0.12222006171941757, -0.21766780316829681, -0.3891103267669678, -0.009674079716205597, -0.37556636333465576, -0.06564228981733322, 0.08992023766040802, -0.3052992820739746, -0.0026901811361312866, -0.09685567021369934, -0.20383283495903015, -0.21202322840690613, -0.16117751598358154, -0.006439735181629658, -0.17209050059318542, 0.052725449204444885, -0.09541252255439758, 0.2716253697872162, -0.2242451310157776, -0.08387221395969391, 0.0059499070048332214, -0.2375609278678894, 0.1667604148387909, -0.078311488032341, -0.3555421829223633, -0.11552833020687103, -0.5387831926345825, 0.35099148750305176, -0.09951408207416534, 0.0833778828382492, -0.17881101369857788, 0.04309592396020889, 0.18945249915122986, -0.04780808463692665, 0.6059219837188721, -0.2965508699417114, 0.038359444588422775, 0.22590956091880798, -0.10697874426841736, -0.4911774694919586, -0.10355659574270248, -0.17874403297901154, 0.39056259393692017, 0.006684901192784309, 0.5836238861083984, -0.25484171509742737, -0.03250691294670105, -0.09976659715175629, -0.07121459394693375, -0.1348162293434143, 0.1880333125591278, -0.1508118212223053, -0.316060334444046, -0.4655391275882721, 0.11179642379283905, 0.007667064666748047, 0.2107909619808197, -0.1736886352300644, -0.002082154154777527, -0.02065054140985012, 0.005370758473873138, -0.20017372071743011, 0.026250317692756653, 0.25873106718063354, 0.15110787749290466, 0.11040134727954865, 0.22226187586784363, 0.06015610322356224, 0.1162220686674118, 0.29806986451148987, 0.11423296481370926, -0.06367703527212143, 0.06881802529096603, -0.03858669102191925, 0.19462771713733673, 0.11947748064994812, -0.0870044082403183, 0.11818252503871918, -0.033058878034353256, 0.13299775123596191, -0.10821769386529922, 0.20755425095558167, 0.21414685249328613, 0.0803304985165596, -0.05652308464050293, -0.34565138816833496, 0.3998227119445801, 0.07285282760858536, -0.004899829626083374, 0.38124316930770874, -0.03727409616112709, -0.23094281554222107, 0.477049320936203, 0.19104626774787903, 0.70973140001297, -0.05838438868522644, 0.1273350715637207, 0.3959960341453552, 0.18931107223033905, 0.5711786150932312, 0.0364600270986557, 0.11875776946544647, -0.4633328914642334, -0.07829537987709045, -0.03873124718666077, 0.02379631996154785, 0.09060066938400269, 0.02056727185845375, -0.4864681363105774, 0.13530293107032776, -0.24195563793182373, 0.018353503197431564, -0.28499966859817505, 0.3904263973236084, -0.220066100358963, -0.12183146178722382, 0.18300694227218628, 0.22899559140205383, -0.2597479820251465, 0.3744601011276245, -0.03798801824450493, -0.10575685650110245, -0.04059022292494774, -0.3184075355529785, -0.387999564409256, 0.18348349630832672, -0.2437230497598648, 0.666570246219635, -0.16427351534366608, -0.323749840259552, 0.03729648143053055, 0.3030259907245636, 0.06916087120771408, 0.0648137554526329, -0.141044482588768, 0.051495861262083054, -0.04300461336970329, -0.17604322731494904, 0.07645390927791595, -0.03144152835011482, 0.3427593410015106, -0.08143070340156555, -0.2253265380859375, 0.2992083728313446, 0.053492091596126556, -0.1764785200357437, 0.17312079668045044, -0.09363438934087753, -0.027008336037397385, -0.5017267465591431, -0.25443363189697266, -0.08874090760946274, -0.31999123096466064, -0.3003639280796051, 0.11588796228170395, -0.1051839143037796, 0.10083472728729248, 0.14408977329730988, 0.0020701694302260876, 0.030001506209373474, 0.09683623909950256, 0.5596949458122253, -0.02987762540578842, 0.2831663489341736, 0.5352457761764526, 0.3073679804801941, -0.18730932474136353, -0.22526878118515015, 0.05681702494621277, -0.022312548011541367, -0.13041538000106812, 0.13161881268024445, 0.04791836440563202, 0.03231041133403778, -0.06732922047376633, 0.607498824596405, 0.21248272061347961, 0.018627941608428955, -0.24046126008033752, -0.12279835343360901, -0.3787522614002228, 0.25533726811408997, -0.013729291968047619, 0.26868048310279846, 0.14105460047721863, -0.05577203631401062, 0.10077281296253204, 0.004142783582210541, -0.3299327790737152, 0.023612983524799347, -0.48920994997024536, -0.03248216584324837, 0.5329434871673584, -0.28666603565216064, 0.04373297095298767, -0.1450985223054886, 0.16419833898544312, 0.16878700256347656, -0.05920936539769173, -0.25963348150253296, 0.11275520920753479, 0.024379685521125793, 0.1439802646636963, -0.15420261025428772, -0.24141135811805725, -0.29860806465148926, -0.18404936790466309, -0.15526822209358215, 0.05834595113992691, 0.23942306637763977, -0.08322818577289581, 0.009024471044540405, 0.045243486762046814, 0.16640394926071167, -0.1741066575050354, -0.026176463812589645, 0.01728915050625801, 0.020542878657579422, -0.1106104701757431, 0.19504471123218536, 0.28023990988731384, -0.05793619900941849, -0.3176884651184082, 0.10625895857810974, 0.09238244593143463, 0.22029197216033936, 0.3055327534675598, -0.3075252175331116, -0.1283978372812271, 0.08001372218132019, 0.25877270102500916, 0.11910627782344818, -0.16067856550216675, -0.09613349288702011, 0.24923892319202423, 0.23783595860004425, -0.2879294157028198, -0.16794389486312866, 0.20640870928764343, -0.18060290813446045, 0.03164795786142349, -0.16450373828411102, 0.18262635171413422, 0.08559362590312958, -0.5627004504203796, 0.27786436676979065, 0.6208098530769348, -0.2715016305446625, 0.10375426709651947, 0.3306465744972229, -0.14162233471870422, -0.08550207316875458, 0.3744335472583771, 0.24710659682750702, 0.1989920288324356, 0.3710246980190277, 0.10279673337936401, 0.31956353783607483, 0.11608099937438965, 0.07658189535140991, 0.15229645371437073, -0.5786861777305603, 0.1353222280740738, -0.21423108875751495, -0.31858697533607483, -0.0367383174598217, -0.06891679763793945, 0.1564408540725708, -0.46050724387168884, -0.2527894079685211, -0.24773789942264557, 0.3982545733451843, -0.44157037138938904, 0.10705192387104034, -0.26521921157836914, -0.04137203097343445, 0.2149837762117386, 0.1461452841758728, -0.10677282512187958, -0.08289177715778351, 0.39346247911453247, -0.034442514181137085, -0.21685726940631866, 0.14638756215572357, -0.044224999845027924, 0.053625572472810745, 0.19686439633369446, -0.2352333664894104, 0.08461973816156387, 0.08095423877239227, 0.057794757187366486, -0.5923621654510498, 0.29745960235595703, 0.5952128767967224, 0.04066655784845352, -0.214002326130867, 0.22929747402668, 0.12134827673435211, -0.050843290984630585, 0.1087491363286972, -0.08641481399536133, 0.032994866371154785, 0.2000422179698944, 0.320449560880661, 0.24780762195587158, -0.17222373187541962, 0.06748436391353607, 0.17034578323364258, 0.36929330229759216, -0.00627652183175087, -0.1072768121957779, 0.08039309084415436, -0.37079712748527527, -0.009130310267210007, 0.020115260034799576, -0.3438471555709839, 0.09652717411518097, 0.6157697439193726, 0.16977474093437195, 0.19134601950645447, -0.18068304657936096, 0.12864726781845093, -0.01275720726698637, 0.27692711353302, 0.2139473706483841, -0.0006613591685891151, -0.3684423863887787, 0.22497887909412384, -0.4956745505332947, 0.13733288645744324, 0.08699913322925568, -0.21549087762832642, -0.009299764409661293, -0.0005268491804599762, 0.2668376564979553, -0.01315687783062458, -0.13069674372673035, 0.13080768287181854, 0.05205923318862915, 0.08468524366617203, -0.22190821170806885, -0.009729031473398209, -0.03260798379778862, -0.02727421745657921, 0.08261395990848541, -0.33501967787742615, 0.3439114987850189, -0.04685257375240326, 0.1371639221906662, -0.1382519155740738, -0.25011759996414185, 0.2505011558532715, -0.2741953730583191, 0.554974377155304, -0.24414564669132233, 0.561347246170044, -0.16591957211494446, 0.0708976686000824, 0.06837760657072067, -0.1940852254629135, -0.1503438651561737, -0.010258737951517105, 0.0018270546570420265, 0.42671138048171997, -0.16388067603111267, 0.3537277579307556, -0.3989887237548828, -0.0048049986362457275, -0.12990932166576385, 0.20126008987426758, -0.17572160065174103, -0.03960051387548447, -0.202871173620224, -0.1260392963886261, 0.186513289809227, 0.23655205965042114, -0.011244051158428192, 0.15950262546539307, -0.3451300263404846, -0.4063379168510437, 0.6743062138557434, -0.23133307695388794, -0.22282293438911438, -0.21850106120109558, -0.04572112113237381, 0.22127407789230347, 0.1505010575056076, -0.19260716438293457, -0.008943259716033936, 0.3270154297351837, -0.020650235936045647, -0.24006937444210052, -0.039585649967193604, -0.02763344720005989, 0.0022824332118034363, -0.03804818168282509, 0.28808772563934326, -0.23654130101203918, -0.1487940549850464, -0.028872400522232056, -0.14390547573566437 ]
https://github.com/huggingface/datasets/issues/5961
Does "number of shards" refer to the total number of data? my config: nproc_per_node=2 ds=ds['train'] = load_dataset(streaming=True).take(50000) I'm test again: in prepare_data(), data have the same for each GPU
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
29
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ Does "number of shards" refer to the total number of data? my config: nproc_per_node=2 ds=ds['train'] = load_dataset(streaming=True).take(50000) I'm test again: in prepare_data(), data have the same for each GPU
[ -0.44223552942276, -0.3692326247692108, -0.06835275143384933, 0.2758820652961731, 0.11674202233552933, -0.10412335395812988, 0.35168322920799255, 0.17539653182029724, -0.2317139059305191, 0.17232121527194977, 0.05940701812505722, 0.4387744963169098, 0.06595718860626221, 0.37266895174980164, 0.09004733711481094, -0.18046367168426514, 0.10294713824987411, 0.12207771837711334, -0.08886122703552246, -0.022770963609218597, -0.13724172115325928, 0.2876606285572052, -0.24560639262199402, -0.2282087355852127, -0.3583349287509918, -0.055680468678474426, -0.07193005830049515, -0.03311947360634804, 0.06676035374403, -0.350736141204834, 0.17200398445129395, 0.3941185474395752, 0.047018617391586304, 0.23696228861808777, -0.00011776633618865162, 0.23223631083965302, 0.004199885297566652, -0.27599209547042847, -0.2046823501586914, -0.07264979928731918, -0.00653441995382309, 0.006195619702339172, -0.3860487937927246, -0.22474408149719238, -0.3884158134460449, -0.2107211947441101, 0.021154189482331276, -0.265275239944458, 0.17888498306274414, 0.01209237053990364, 0.11169220507144928, 0.23431961238384247, -0.16449755430221558, -0.027444446459412575, 0.12664246559143066, 0.37166333198547363, -0.18766704201698303, -0.05426725000143051, -0.13525596261024475, 0.1756734699010849, 0.005329988896846771, 0.40083080530166626, 0.07414154708385468, 0.31814369559288025, 0.001099398359656334, 0.11506389081478119, -0.27635127305984497, -0.22283664345741272, -0.15641841292381287, 0.33649957180023193, 0.1303500235080719, -0.10671959817409515, -0.3038325905799866, -0.483644962310791, -0.18154966831207275, -0.517070472240448, -0.026827439665794373, 0.1691206395626068, -0.1780073195695877, -0.016392908990383148, -0.5005020499229431, 0.21140924096107483, -0.08643292635679245, -0.016137849539518356, 0.29864662885665894, 0.22806712985038757, -0.17961344122886658, 0.3696743845939636, 0.2649461328983307, 0.27532434463500977, -0.05386435240507126, 0.09909658879041672, -0.15958282351493835, -0.09595678746700287, -0.5672712326049805, -0.1297166347503662, 0.07915423065423965, -0.08302155882120132, 0.4482038617134094, 0.4612792432308197, 0.17653235793113708, 0.07133401930332184, 0.3346728980541229, -0.06588733196258545, 0.2958533465862274, -0.38876858353614807, 0.25620484352111816, 0.06847713142633438, -0.021750841289758682, 0.06712131202220917, -0.036643367260694504, -0.19051045179367065, 0.21511612832546234, -0.28573155403137207, -0.3061676323413849, -0.06582561135292053, 0.46427565813064575, -0.05457748845219612, -0.22804349660873413, -0.33110398054122925, -0.27615633606910706, -0.0694182813167572, -0.06950816512107849, 0.3572182357311249, 0.2581268548965454, -0.13638928532600403, -0.4222589135169983, 0.18289756774902344, -0.28040629625320435, -0.3634781241416931, -0.20485790073871613, -0.2440544217824936, -0.08737152069807053, 0.5787206888198853, 0.09329051524400711, -0.24507205188274384, 0.4868798553943634, 0.109975665807724, 0.06967365741729736, -0.2997470796108246, 0.29617494344711304, -0.23060756921768188, 0.18690729141235352, 0.3413867652416229, 0.1593165397644043, 0.18744203448295593, -0.027624251320958138, 0.2082878053188324, -0.27874594926834106, 0.21199552714824677, -0.13609479367733002, -0.5111358165740967, 0.5502059459686279, 0.052485059946775436, 0.021309085190296173, 0.06358581781387329, -0.32619115710258484, 0.33579882979393005, 0.3378985524177551, -0.1538413017988205, 0.11772532016038895, 0.032459139823913574, -0.6220272183418274, -0.2785225212574005, 0.3383324444293976, 0.42832326889038086, 0.07394374907016754, -0.26163506507873535, 0.1938549280166626, -0.1535298377275467, 0.3335307836532593, 0.48970067501068115, -0.1652306616306305, 0.13086888194084167, -0.3518871068954468, 0.41674500703811646, 0.11718255281448364, -0.04943094402551651, -0.29620006680488586, 0.34034639596939087, -0.017063245177268982, 0.1453774869441986, 0.11695349216461182, 0.046099528670310974, 0.33529162406921387, 0.035069577395915985, -0.030400265008211136, 0.18218404054641724, -0.31604427099227905, -0.02624092623591423, -0.14892864227294922, -0.05132187157869339, 0.09699708223342896, 0.04564138501882553, -0.13462790846824646, 0.0820639431476593, -0.154802605509758, -0.01584867760539055, 0.5204545855522156, -0.12792830169200897, 0.15412670373916626, 0.0822068601846695, 0.40392443537712097, -0.211708202958107, 0.06767839193344116, -0.004657946527004242, -0.20439761877059937, 0.2447035014629364, 0.025715939700603485, -0.006001866422593594, 0.2504892647266388, -0.5058943033218384, -0.1259564310312271, -0.10816583037376404, -0.10537447035312653, -0.3420407772064209, 0.021357931196689606, 0.04712935537099838, 0.26606321334838867, -0.35695329308509827, -0.24171698093414307, 0.14232507348060608, -0.6382004022598267, -0.034422967582941055, -0.2798900604248047, 0.2091723531484604, 0.2259439378976822, -0.13431498408317566, -0.07827289402484894, -0.030998505651950836, 0.07217861711978912, -0.41911566257476807, 0.10215018689632416, 0.38013970851898193, 0.3366480767726898, 0.015105437487363815, -0.14744234085083008, 0.19309358298778534, 0.2735203206539154, -0.0993819460272789, -0.23746930062770844, -0.04058176279067993, -0.19596178829669952, -0.18837514519691467, -0.16556893289089203, 0.5435449481010437, -0.10570646822452545, 0.45122525095939636, -0.026455514132976532, -0.02192007005214691, 0.20530696213245392, 0.18244196474552155, -0.23373430967330933, -0.1743120402097702, -0.030712563544511795, -0.1626928150653839, 0.1555832177400589, 0.1025993824005127, -0.3883255422115326, 0.15574312210083008, 0.35282960534095764, 0.15804430842399597, -0.22062060236930847, -0.07582949101924896, 0.07339711487293243, -0.10941924154758453, 0.16182076930999756, 0.12053180485963821, 0.5004635453224182, 0.12458040565252304, 0.2052551656961441, 0.05178332328796387, 0.09902817010879517, -0.18456940352916718, 0.15825848281383514, 0.09538857638835907, 0.3733130395412445, 0.21779075264930725, -0.24234092235565186, -0.29158443212509155, -0.4150693416595459, -0.08306354284286499, 0.34137800335884094, 0.06655856221914291, -0.23598378896713257, 0.182237446308136, -0.13122433423995972, -0.04913945496082306, -0.16920693218708038, 0.07072949409484863, -0.05113857239484787, 0.021833069622516632, -0.050682902336120605, 0.44546401500701904, -0.11722862720489502, 0.2518315017223358, 0.21154969930648804, 0.3412335216999054, -0.0657568871974945, -0.03757810965180397, -0.10126098990440369, -0.026569083333015442, -0.030822085216641426, 0.023594170808792114, 0.07229100912809372, 0.0247424878180027, 0.314365029335022, -0.22754546999931335, -0.33949998021125793, -0.35301846265792847, -0.093626968562603, 0.23682619631290436, -0.14560529589653015, 0.15683697164058685, 0.010181814432144165, 0.00953221321105957, -0.049547672271728516, 0.08388292789459229, 0.1984843760728836, -0.19291795790195465, -0.13422566652297974, -0.1172579675912857, -0.12055304646492004, 0.030061066150665283, 0.0024441182613372803, -0.4630265235900879, -0.03452596068382263, -0.35512229800224304, 0.4455466568470001, 0.03103538602590561, 0.3581932485103607, 0.16147713363170624, 0.1475592404603958, -0.21035662293434143, 0.04328439012169838, -0.13760453462600708, -0.24990421533584595, -0.3256075084209442, 0.08184421807527542, -0.44889169931411743, -0.31063327193260193, -0.11330289393663406, 0.10484655201435089, 0.36071962118148804, 0.6155506372451782, -0.2417513132095337, -0.04745647311210632, 0.09093103557825089, -0.11048281192779541, 0.10428571701049805, -0.18672940135002136, 0.3270857334136963, -0.3180542588233948, 0.08405144512653351, -0.0773596242070198, -0.051224928349256516, 0.4131350517272949, -0.0037670284509658813, 0.022389620542526245, 0.30707481503486633, 0.531555712223053, 0.2010897845029831, 1.0232973098754883, 0.7715409994125366, 0.050332535058259964, 0.3454320430755615, -0.23700137436389923, 0.0966014564037323, -0.23962345719337463, 0.20970892906188965, 0.10969898104667664, -0.056602418422698975, -0.21338176727294922, 0.25841736793518066, -0.03671038895845413, -0.2072022706270218, 0.1015331894159317, 0.0828203558921814, -0.007813327014446259, -0.3687342703342438, 0.35143929719924927, 0.12109421193599701, 0.3918187618255615, 0.07170971482992172, 0.26648399233818054, 0.14432312548160553, 0.03484854847192764, -0.07009463012218475, -0.04092182591557503, 0.5384760499000549, -0.04276964068412781, -0.6319911479949951, 0.08126464486122131, -0.4245584309101105, 0.17537842690944672, 0.005312114953994751, 0.3822912275791168, -0.15566705167293549, -0.13704551756381989, 0.2856028378009796, 0.01503632590174675, 0.7181417942047119, -0.16237974166870117, -0.34194403886795044, 0.10748489201068878, -0.30270853638648987, -0.07277423143386841, -0.1031094491481781, -0.10001762956380844, 0.5055641531944275, 0.27269110083580017, 0.2697342038154602, -0.25579309463500977, -0.37824663519859314, 0.3346899449825287, 0.031009498983621597, -0.17015521228313446, -0.0985126793384552, -0.18166828155517578, -0.2896547317504883, -0.3260233998298645, 0.21453329920768738, 0.3158845007419586, 0.21721100807189941, -0.2849425971508026, -0.3054422438144684, -0.37040308117866516, 0.048227615654468536, 0.04480718821287155, 0.14505165815353394, 0.43948841094970703, 0.02733665704727173, 0.3734411597251892, 0.33573830127716064, -0.08906851708889008, 0.28153491020202637, 0.49540483951568604, 0.10724131017923355, -0.08612285554409027, 0.332874059677124, -0.13774995505809784, 0.23216943442821503, 0.5054702162742615, -0.07923384010791779, 0.03695462644100189, -0.09155410528182983, 0.15208742022514343, -0.43458011746406555, 0.04604494944214821, 0.11983691155910492, 0.019950389862060547, -0.3809783458709717, -0.47245845198631287, 0.43769463896751404, 0.1965385228395462, -0.1107727661728859, 0.5127056837081909, 0.31986165046691895, -0.2074917107820511, 0.4906848669052124, 0.16288718581199646, 0.8457424640655518, 0.0024758027866482735, -0.00395328551530838, 0.13266068696975708, 0.26626887917518616, 0.2551923096179962, -0.5023442506790161, 0.4261328876018524, -0.2987672984600067, -0.42488181591033936, -0.007817480713129044, -0.17260302603244781, 0.1345653384923935, 0.6022440195083618, 0.11824478209018707, 0.28180497884750366, 0.0888354480266571, -0.0024923374876379967, -0.30059757828712463, 0.10690705478191376, 0.04595532268285751, -0.3072718679904938, 0.03854215890169144, 0.029825426638126373, 0.01659160479903221, 0.45167040824890137, -0.10400130599737167, -0.04944419488310814, 0.11309292912483215, -0.06730738282203674, -0.1524113416671753, -0.23709437251091003, -0.10613751411437988, 0.10878674685955048, 0.06441783905029297, -0.31133848428726196, -0.002467125654220581, 0.27537932991981506, 0.21979078650474548, -0.3023039996623993, -0.05924347788095474, 0.08449532091617584, 0.02182953432202339, -0.19809678196907043, -0.11018545925617218, -0.15026721358299255, 0.12790517508983612, -0.08145584911108017, -0.08764133602380753, -0.15047979354858398, 0.006274677813053131, -0.4071882963180542, -0.08813855051994324, -0.03906842693686485, -0.12871374189853668, -0.25640177726745605, 0.057409051805734634, 0.16413867473602295, -0.11528488248586655, -0.1469607949256897, 0.028219401836395264, -0.02961239218711853, -0.23218616843223572, 0.29438289999961853, 0.048345036804676056, -0.27938902378082275, -0.019219018518924713, 0.06804782152175903, 0.14172819256782532, -0.07670395076274872, 0.16006559133529663, -0.1508616805076599, -0.010641947388648987, -0.1294407993555069, -0.06570832431316376, 0.11811698973178864, -0.37688660621643066, 0.1946205198764801, -0.32944729924201965, 0.3242029547691345, -0.06629703938961029, 0.16384387016296387, 0.0647689551115036, 0.28532174229621887, -0.1329731047153473, -0.2182905375957489, -0.20435121655464172, 0.09803038835525513, 0.048892077058553696, 0.3772488832473755, 0.11848302185535431, -0.10523796081542969, 0.012194238603115082, 0.3995267450809479, -0.20733782649040222, -0.22079706192016602, -0.08377835899591446, 0.27177971601486206, 0.2040051817893982, 0.09780219197273254, 0.09882138669490814, 0.008994519710540771, -0.07498219609260559, 0.2738276720046997, -0.24700209498405457, -0.1189790666103363, -0.09125331789255142, 0.17325469851493835, 0.1442720592021942, 0.01615535095334053, -0.003965876996517181, 0.04524587094783783, -0.3235678970813751, -0.41623571515083313, 0.36462804675102234, -0.05278319865465164, 0.08065436780452728, -0.19137334823608398, 0.4098002314567566, 0.15140113234519958, -0.37969905138015747, 0.1925329566001892, 0.18942083418369293, -0.09206235408782959, 0.05494007468223572, 0.16353201866149902, -0.013526517897844315, -0.10495903342962265, 0.04160482436418533, -0.008701678365468979, 0.44409534335136414, -0.18444731831550598, -0.08027417212724686, -0.08265417814254761, 0.07826302200555801, 0.015452861785888672, 0.37769657373428345, 0.3500039577484131, -0.10264164954423904, 0.05635293573141098, 0.03162567690014839, 0.18279045820236206, -0.08678650110960007, -0.04423051327466965, 0.12391959130764008, 0.18022626638412476, 0.1809515357017517, 0.5018653273582458, 0.5636618137359619, 0.20543798804283142, -0.024383559823036194, 0.06456556171178818, 0.03590582683682442, -0.4222748577594757, 0.2672763764858246, -0.07861930131912231, -0.08279083669185638, 0.2352435290813446, 0.2321321964263916, -0.025865260511636734, 0.2937040328979492, 0.44576478004455566, -0.31931164860725403, 0.7247845530509949, 0.16392487287521362, 0.02847166731953621, 0.05584309995174408, -0.36564958095550537, -0.13749080896377563, 0.1764284372329712, -0.1310621201992035, 0.1145024299621582, 0.0017800144851207733, 0.22360298037528992, -0.07102517783641815, -0.3982766270637512, -0.23704861104488373, 0.11715785413980484, -0.22742147743701935, -0.3367941677570343, -0.4157963991165161, -0.05003514885902405, -0.3367689847946167, 0.02687208354473114, -0.042794905602931976, -0.292166531085968, 0.4270317852497101, 0.0358252227306366, -0.020529162138700485, -0.24443724751472473, 0.05513676255941391, 0.040745556354522705, 0.30493658781051636, -0.3672952353954315, 0.15766094624996185, -0.10301455855369568, -0.1695321500301361, 0.08146502077579498, 0.030741499736905098, 0.2768319249153137, -0.020022213459014893, 0.10342948138713837, 0.3074078857898712, 0.11042598634958267, 0.12436310201883316, -0.0988440215587616, 0.08628696203231812, 0.01930396817624569, 0.014830091968178749, 0.17837324738502502, 0.021213222295045853, -0.03388368710875511, -0.2487046867609024, 0.25690945982933044, 0.18323417007923126, -0.4249972999095917, 0.2944164574146271, -0.2976020276546478, -0.06550972163677216, 0.05901913717389107, 0.04616734758019447, -0.07722771167755127, -0.020517604425549507, 0.36428162455558777, -0.2876623272895813, 0.19123220443725586, 0.1411384493112564, 0.04011781886219978, -0.20043472945690155, 0.25309908390045166, -0.5131340026855469, 0.08708121627569199, -0.4031845033168793, -0.2936517298221588, -0.39672496914863586, -0.06510840356349945, -0.20189356803894043, 0.15381714701652527, 0.13349655270576477, 0.5310594439506531, 0.0925503745675087, 0.23369590938091278, -0.16263431310653687, -0.26820772886276245, 0.10290318727493286, 0.5963817834854126, -0.20136618614196777, -0.012728303670883179, -0.7214050889015198, 0.11711518466472626, 0.18906134366989136, -0.3442801237106323, 0.15692238509655, 0.003583114594221115, -0.210394024848938, -0.07044662535190582, 0.18779513239860535, 0.38399940729141235, -0.14041566848754883, 0.08976078033447266, 0.06843236088752747, 0.2956365644931793, 0.04713963717222214, 0.11335066705942154, -0.390714168548584, -0.17416046559810638, -0.41746410727500916, 0.2827196419239044, 0.018619922921061516, 0.10580641031265259, -0.0989522933959961, -0.11661982536315918, -0.26973503828048706, 0.23630696535110474, 0.2498605102300644, -0.09355637431144714, 0.03954199701547623, 0.13762982189655304, -0.26085925102233887, 0.16342425346374512, 0.3911203145980835, 0.3917185962200165, 0.0003406340256333351, -0.18819141387939453, -0.1848372220993042, -0.43637651205062866, 0.43828627467155457, -0.4197600781917572, -0.03308756276965141, -0.19097861647605896, 0.2518097758293152, 0.4270985722541809, -0.17707444727420807, -0.5097161531448364, -0.19608673453330994, 0.36336225271224976, -0.30465376377105713, 0.16286663711071014, 0.3086262047290802, 0.1584627330303192, -0.3083481788635254, -0.13040538132190704, 0.19687122106552124, -0.03521128371357918, -0.46739470958709717, 0.04745639115571976, -0.5455811619758606 ]
https://github.com/huggingface/datasets/issues/5961
The number of shards is `ds.n_shards`. It corresponds generally to the number of files the dataset is made of, to be able to distribute to several nodes. **You don't end up with the same data per GPU**. But all the samples are going through your preprocessing function you pass to map. They are just skipped afterwards to only keep 1 sample out of n(GPUs)
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
64
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ The number of shards is `ds.n_shards`. It corresponds generally to the number of files the dataset is made of, to be able to distribute to several nodes. **You don't end up with the same data per GPU**. But all the samples are going through your preprocessing function you pass to map. They are just skipped afterwards to only keep 1 sample out of n(GPUs)
[ -0.4653586149215698, -0.46394428610801697, -0.09561261534690857, 0.24369829893112183, 0.0934542790055275, -0.053702130913734436, 0.32686930894851685, 0.2737382650375366, 0.046611398458480835, 0.1674361675977707, -0.0384560264647007, 0.46263110637664795, 0.19708502292633057, 0.2577080726623535, 0.019822604954242706, -0.17540068924427032, 0.021325524896383286, 0.15186677873134613, -0.21863988041877747, -0.04217788577079773, -0.1592138111591339, 0.32866370677948, -0.15604934096336365, -0.1438533067703247, -0.3236992061138153, -0.09931415319442749, -0.05425318703055382, 0.07741400599479675, 0.11975698918104172, -0.2915678918361664, 0.11171168833971024, 0.2112264484167099, -0.0035117901861667633, 0.3194502294063568, -0.00010293102241121233, 0.2000931203365326, 0.022431105375289917, -0.2164866030216217, -0.09068423509597778, 0.05356213077902794, -0.08826419711112976, 0.05560775101184845, -0.4567323923110962, -0.21122482419013977, -0.3950461149215698, -0.2827441096305847, -0.046923451125621796, -0.34270602464675903, 0.25960612297058105, -0.11397086083889008, 0.260090708732605, 0.22548411786556244, -0.15637974441051483, -0.13708797097206116, 0.057292044162750244, 0.3029018044471741, -0.17098203301429749, -0.15220984816551208, 0.00889272429049015, 0.18788698315620422, -0.004888951778411865, 0.435158908367157, 0.05699406564235687, 0.3055397868156433, 0.07454697042703629, 0.10428643226623535, -0.17395734786987305, -0.2924836575984955, -0.06340347975492477, 0.24504540860652924, 0.02285277284681797, -0.1276225745677948, -0.32365915179252625, -0.4769928753376007, -0.2617776691913605, -0.25456827878952026, -0.06467176973819733, 0.17094215750694275, -0.15504544973373413, -0.014903273433446884, -0.35060402750968933, 0.22924178838729858, 0.01715470850467682, -0.20421503484249115, 0.28920280933380127, 0.3327551782131195, -0.1854008585214615, 0.3717860281467438, 0.2376011610031128, 0.2908012568950653, -0.1613636314868927, -0.010962058790028095, -0.14844170212745667, -0.16568784415721893, -0.38866835832595825, -0.15571284294128418, 0.1672964245080948, 0.0411926731467247, 0.4228115677833557, 0.2771865725517273, 0.20235033333301544, 0.13125085830688477, 0.3925207853317261, -0.004893386736512184, 0.298653781414032, -0.37702929973602295, 0.23189660906791687, 0.16447217762470245, 0.03760574758052826, -0.01738051138818264, -0.05062549188733101, -0.15051698684692383, 0.4249601364135742, -0.25630122423171997, -0.32377156615257263, -0.0031576920300722122, 0.3503172993659973, -0.09432484209537506, -0.20640987157821655, -0.3917016386985779, -0.04547766223549843, 0.012042298913002014, -0.13536401093006134, 0.30906981229782104, 0.22446808218955994, -0.2135806381702423, -0.46836668252944946, 0.05374794080853462, -0.2557598650455475, -0.3140789270401001, -0.2652859091758728, -0.19239744544029236, -0.13007235527038574, 0.41093191504478455, -0.01942235231399536, -0.1981152594089508, 0.48702672123908997, 0.07542315125465393, 0.04347448796033859, -0.16877073049545288, 0.28218093514442444, -0.13650953769683838, 0.2638404667377472, 0.2818264961242676, 0.17655089497566223, 0.17442047595977783, -0.032403893768787384, 0.16319815814495087, -0.27790266275405884, 0.12790384888648987, -0.12622159719467163, -0.37734198570251465, 0.44105634093284607, 0.17441527545452118, 0.14866630733013153, 0.19869743287563324, -0.31817883253097534, 0.2460053265094757, 0.25581708550453186, -0.06374187767505646, 0.020583823323249817, -0.014845330268144608, -0.44521060585975647, -0.3490574359893799, 0.24625375866889954, 0.38534659147262573, -0.07896171510219574, -0.22825145721435547, 0.19938057661056519, -0.2224453091621399, 0.1909492313861847, 0.48796266317367554, -0.2190122902393341, 0.07983535528182983, -0.3745044469833374, 0.5880345702171326, -0.093510702252388, -0.028095733374357224, -0.2334868311882019, 0.3956090211868286, -0.08207511901855469, 0.1281045377254486, 0.05192359536886215, -0.001822974532842636, 0.32498323917388916, -0.09644747525453568, -0.147891566157341, 0.2050347775220871, -0.29681089520454407, 0.04451622813940048, -0.10958602279424667, 0.05811907351016998, 0.009243341162800789, -0.053061190992593765, -0.20607061684131622, 0.05070578306913376, -0.051465339958667755, -0.182538241147995, 0.47438597679138184, -0.25584250688552856, 0.2174782156944275, 0.12456417083740234, 0.32997140288352966, -0.11257356405258179, 0.15711043775081635, 0.011881642043590546, -0.29651957750320435, 0.29544708132743835, -0.13195765018463135, -0.10722681879997253, 0.08964787423610687, -0.5437964200973511, -0.04471435397863388, -0.05055060237646103, -0.14128726720809937, -0.34152644872665405, 0.15269124507904053, 0.07485335320234299, 0.3562934100627899, -0.4181305766105652, -0.17981579899787903, 0.056903280317783356, -0.4832565188407898, -0.008677877485752106, -0.2527688443660736, 0.10352227091789246, 0.13627418875694275, -0.14610785245895386, 0.014162801206111908, -0.021902695298194885, 0.091046541929245, -0.4463503360748291, 0.16083712875843048, 0.336715430021286, 0.3164857029914856, 0.042684875428676605, -0.05408177524805069, 0.10569202154874802, 0.2546769380569458, 0.04889388382434845, -0.10663679242134094, -0.04956018179655075, -0.1486370861530304, -0.1979004442691803, -0.049343258142471313, 0.5078648924827576, -0.05880693346261978, 0.4434458315372467, -0.02380231022834778, 0.01937662810087204, 0.23006188869476318, 0.15415453910827637, -0.11462974548339844, -0.20876966416835785, -0.15922389924526215, -0.10084708034992218, 0.20907849073410034, 0.0911044329404831, -0.32501938939094543, 0.31674718856811523, 0.4011392891407013, 0.1110488772392273, -0.12987998127937317, -0.1463981568813324, -0.03565199300646782, -0.02031870186328888, 0.22617976367473602, 0.11785444617271423, 0.4275365471839905, 0.1866735965013504, 0.1675107330083847, -0.03945266082882881, 0.07312192022800446, -0.12735626101493835, 0.04047076031565666, 0.08098472654819489, 0.2533889710903168, 0.135553777217865, -0.3431474566459656, -0.27466335892677307, -0.3293960690498352, -0.05157309025526047, 0.1977025419473648, -0.041647590696811676, -0.14275918900966644, 0.17070910334587097, -0.14025795459747314, -0.07320865988731384, -0.12037317454814911, 0.1435038447380066, -0.05406087636947632, -0.07138935476541519, 0.05483992397785187, 0.34366944432258606, -0.22985079884529114, 0.3042372465133667, 0.3351375460624695, 0.31831786036491394, -0.006990507245063782, 0.045349977910518646, -0.1623203456401825, 0.013854224234819412, -0.03106486238539219, 0.11797081679105759, 0.15030178427696228, -0.01388489082455635, 0.36129212379455566, -0.20782196521759033, -0.17052164673805237, -0.4357145428657532, -0.11379900574684143, 0.22086061537265778, -0.3814210593700409, 0.13737992942333221, 0.09436343610286713, -0.023150645196437836, 0.03883399814367294, 0.14882206916809082, 0.18777009844779968, -0.31032946705818176, -0.1825636923313141, -0.18811938166618347, -0.10505962371826172, -0.16773609817028046, -0.11065343022346497, -0.31302547454833984, 0.03866804391145706, -0.3009190857410431, 0.44175758957862854, 0.036077238619327545, 0.3016110360622406, -0.05755074322223663, 0.12555661797523499, -0.1522442102432251, -0.1308954656124115, -0.14966383576393127, -0.23794794082641602, -0.2676289975643158, 0.0871363952755928, -0.5225012302398682, -0.37034231424331665, -0.0454254075884819, 0.1811617910861969, 0.40296268463134766, 0.36870086193084717, -0.22132569551467896, -0.20925308763980865, -0.014122705906629562, -0.018137916922569275, 0.10132806748151779, -0.10095877200365067, 0.35189104080200195, -0.24171635508537292, -0.07910234481096268, -0.2135942280292511, -0.10373696684837341, 0.37064847350120544, -0.012053952552378178, -0.06372757256031036, 0.20828428864479065, 0.3549202084541321, 0.24786145985126495, 0.7858229279518127, 0.7464598417282104, 0.04269350692629814, 0.2563943564891815, -0.1212286427617073, 0.16240453720092773, -0.30965957045555115, 0.1459575742483139, 0.1091993898153305, -0.07336775213479996, -0.05677472800016403, 0.2533944249153137, -0.022996660321950912, -0.23125137388706207, 0.17205862700939178, 0.08626365661621094, 0.024522028863430023, -0.36270490288734436, 0.24650296568870544, 0.2874835431575775, 0.3407837748527527, 0.11944901943206787, 0.2525976002216339, 0.06421104073524475, 0.155751034617424, 0.11372768133878708, -0.16409234702587128, 0.5794395804405212, -0.01898818276822567, -0.5317485928535461, 0.02323174849152565, -0.3524482846260071, 0.26309439539909363, -0.01180187612771988, 0.15021966397762299, -0.13797996938228607, -0.21410824358463287, 0.17115706205368042, 0.03527085855603218, 0.6269469261169434, -0.2140779048204422, -0.24173277616500854, 0.00967404991388321, -0.41024404764175415, -0.09971701353788376, -0.004371121525764465, -0.1389344483613968, 0.6098365187644958, 0.13482072949409485, 0.32080966234207153, -0.32352983951568604, -0.369549423456192, 0.21317006647586823, 0.022514745593070984, -0.12487565726041794, -0.012478549033403397, -0.22266438603401184, -0.3018832802772522, -0.3576210141181946, 0.21796101331710815, 0.3005138039588928, 0.12108345329761505, -0.15469767153263092, -0.3248251676559448, -0.3411353528499603, -0.05276796966791153, -0.025791794061660767, 0.24554908275604248, 0.3713364601135254, -0.05700616165995598, 0.2624604105949402, 0.3761976957321167, 0.021718066185712814, 0.16099022328853607, 0.4505835175514221, 0.014228565618395805, -0.041330549865961075, 0.267143189907074, -0.22828158736228943, 0.14495053887367249, 0.4733114540576935, -0.08429212123155594, -0.008837796747684479, -0.19241102039813995, 0.2063201516866684, -0.45389819145202637, -0.1285097301006317, 0.1472839117050171, 0.0976153165102005, -0.37171193957328796, -0.37591177225112915, 0.25827816128730774, 0.13208504021167755, -0.12232071906328201, 0.48579180240631104, 0.311944842338562, -0.20856323838233948, 0.4083542823791504, 0.24067090451717377, 0.6951885223388672, -0.02036488801240921, -0.034832410514354706, 0.056327883154153824, 0.29320865869522095, 0.12140658497810364, -0.2015945017337799, 0.32315340638160706, -0.3144839406013489, -0.4228670597076416, 0.03890340030193329, -0.09595134854316711, 0.22273430228233337, 0.5179182291030884, 0.11254727095365524, 0.1902114748954773, 0.17498649656772614, 0.049435779452323914, -0.3318568766117096, 0.14327611029148102, 0.0635005533695221, -0.36733677983283997, -0.0019586440175771713, 0.1853383183479309, 0.047456689178943634, 0.32759562134742737, -0.054937560111284256, -0.10135462880134583, 0.13069306313991547, -0.02523670718073845, -0.06296102702617645, -0.2221510410308838, -0.1862151026725769, 0.16236025094985962, 0.053662147372961044, -0.275864839553833, -0.09119483828544617, 0.15940219163894653, 0.18538232147693634, -0.08120113611221313, 0.01484554074704647, 0.05349660664796829, 0.00503966398537159, -0.17058464884757996, -0.11834616959095001, -0.24523863196372986, 0.044054336845874786, -0.05394131690263748, -0.022803306579589844, -0.21195223927497864, 0.06113218516111374, -0.43186134099960327, -0.14712490141391754, 0.035002224147319794, -0.11852091550827026, -0.22700245678424835, 0.0040370263159275055, 0.11953519284725189, -0.15055377781391144, -0.16415183246135712, 0.12156613171100616, -0.03470112755894661, -0.18218258023262024, 0.33992448449134827, 0.07167906314134598, -0.28213971853256226, -0.09478907287120819, 0.03418533131480217, 0.08903516083955765, 0.0337536558508873, 0.09704551100730896, -0.11430908739566803, -0.10393771529197693, -0.22464677691459656, -0.13234516978263855, 0.1439947783946991, -0.35616278648376465, 0.2500782608985901, -0.3853304386138916, 0.2235563099384308, -0.06973284482955933, 0.18759696185588837, 0.03308935463428497, 0.24550053477287292, -0.14470086991786957, -0.25311121344566345, -0.13388165831565857, 0.11174064874649048, -0.003908466547727585, 0.3380585312843323, 0.15189681947231293, -0.03689614683389664, -0.061599478125572205, 0.4225603938102722, -0.36834239959716797, -0.15705549716949463, -0.05779048055410385, 0.2927652597427368, 0.21559172868728638, 0.1186998188495636, 0.09201708436012268, 0.03390912711620331, 0.04385855793952942, 0.43203651905059814, -0.22578921914100647, -0.26254063844680786, -0.00975913554430008, 0.09561365097761154, 0.06807124614715576, 0.016783930361270905, 0.014958221465349197, 0.13096357882022858, -0.2902359366416931, -0.44745826721191406, 0.5439445972442627, -0.12239915132522583, 0.061477355659008026, -0.21918810904026031, 0.41131845116615295, -0.03025655448436737, -0.18033367395401, 0.21471266448497772, 0.11878637224435806, -0.04390421509742737, 0.0761328935623169, 0.1382339745759964, -0.054061584174633026, -0.11181113868951797, 0.24311503767967224, 0.0947045385837555, 0.39974725246429443, -0.010206010192632675, 0.07323189079761505, -0.014136562123894691, 0.1083928719162941, 0.11537382006645203, 0.4193919599056244, 0.21414217352867126, -0.09012265503406525, 0.02167007327079773, -0.026070985943078995, 0.30081242322921753, -0.11600905656814575, -0.1569191813468933, 0.24217161536216736, 0.1031634658575058, 0.293378084897995, 0.5501548647880554, 0.5431494116783142, 0.3099210858345032, 0.07505439966917038, 0.08928674459457397, 0.13437555730342865, -0.3968362808227539, 0.20470209419727325, -0.04110538214445114, -0.06828217953443527, 0.21125197410583496, 0.3397402763366699, 0.08672770857810974, 0.27836906909942627, 0.4740336835384369, -0.2789190411567688, 0.699072003364563, 0.04223423823714256, 0.025146760046482086, 0.11739179491996765, -0.4102437496185303, -0.05891824886202812, 0.09630861133337021, -0.06094031035900116, 0.15146535634994507, -0.04024592414498329, 0.1141793429851532, -0.2191358506679535, -0.4743649363517761, -0.14594170451164246, 0.16317467391490936, -0.34506678581237793, -0.24313674867153168, -0.33500176668167114, -0.04164859652519226, -0.209282785654068, 0.05124354362487793, -0.0027483273297548294, -0.2641141414642334, 0.5038256049156189, -0.15968602895736694, -0.029464229941368103, -0.1137816458940506, 0.08222845941781998, -0.06840689480304718, 0.2877364158630371, -0.2398807555437088, 0.08356104046106339, -0.1576254516839981, -0.06620018184185028, 0.07701835036277771, 0.08420346677303314, 0.1617583930492401, -0.022430986166000366, -0.024017704650759697, 0.30296704173088074, 0.026105333119630814, 0.029969222843647003, -0.16432951390743256, 0.1011795699596405, -0.15965217351913452, -0.054726652801036835, 0.3339429497718811, 0.14973419904708862, -0.10814490169286728, -0.30731797218322754, 0.1884663999080658, 0.23310229182243347, -0.2506777048110962, 0.2977088689804077, -0.31574106216430664, -0.1136358454823494, -0.04360131174325943, 0.03542618080973625, -0.09032386541366577, -0.15627750754356384, 0.3586573600769043, -0.4403132498264313, 0.140842005610466, -0.01151714101433754, 0.12180827558040619, -0.16464900970458984, 0.39185452461242676, -0.3925025463104248, -0.023319415748119354, -0.37433120608329773, -0.26937776803970337, -0.28524190187454224, -0.0024455487728118896, -0.26778167486190796, 0.10489596426486969, 0.018870007246732712, 0.5306543111801147, 0.09873606264591217, 0.22344741225242615, -0.013580657541751862, -0.1863219439983368, 0.03728361427783966, 0.5405383706092834, -0.1585293412208557, -0.05958372727036476, -0.6182513236999512, 0.012996843084692955, 0.2954876720905304, -0.33995723724365234, 0.2160763293504715, 0.04241321235895157, -0.019489087164402008, -0.026441289111971855, 0.22777444124221802, 0.36949288845062256, -0.22417417168617249, 0.13274113833904266, 0.141768217086792, 0.12820030748844147, -0.0202169269323349, 0.013831041753292084, -0.3739440441131592, -0.14143356680870056, -0.4535478949546814, 0.3343915641307831, 0.052612122148275375, 0.0878499299287796, -0.08401761949062347, -0.1802682876586914, -0.3305002450942993, 0.26855289936065674, 0.3190816044807434, -0.0074405670166015625, 0.0901811420917511, 0.306702196598053, -0.29943421483039856, 0.10609734058380127, 0.36664626002311707, 0.41817501187324524, 0.06983702629804611, -0.14738857746124268, -0.15634314715862274, -0.47703471779823303, 0.38529032468795776, -0.39936086535453796, -0.13155212998390198, -0.10381151735782623, 0.23263317346572876, 0.27083802223205566, -0.35580411553382874, -0.40528833866119385, -0.17400844395160675, 0.26617902517318726, -0.2498721033334732, 0.10711417347192764, 0.2697892189025879, 0.04657397046685219, -0.2937236726284027, -0.13958626985549927, 0.15717536211013794, 0.0017132312059402466, -0.4819228947162628, 0.18006880581378937, -0.39894938468933105 ]
https://github.com/huggingface/datasets/issues/5961
For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. Is my understanding correct? Where can I print the actual training data for each GPU?
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
37
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. Is my understanding correct? Where can I print the actual training data for each GPU?
[ -0.33584466576576233, -0.42952442169189453, -0.08595259487628937, 0.35857486724853516, 0.07497124373912811, 0.0813596099615097, 0.3470378816127777, 0.24788913130760193, -0.16065239906311035, 0.04934052377939224, -0.035910945385694504, 0.3949976861476898, 0.20944832265377045, 0.33874228596687317, 0.18530091643333435, -0.18089771270751953, 0.07101644575595856, 0.16685862839221954, -0.07171991467475891, -0.14131195843219757, -0.09557715058326721, 0.3191186189651489, -0.16383931040763855, -0.0346568264067173, -0.42982953786849976, -0.19816212356090546, -0.13869622349739075, -0.015908118337392807, 0.08813295513391495, -0.3234651982784271, 0.2559891641139984, 0.20322872698307037, 0.05518539994955063, 0.27944210171699524, -0.00011479325621621683, 0.27195504307746887, -0.10008604824542999, -0.24146124720573425, -0.11472806334495544, 0.019951485097408295, -0.10021679103374481, 0.04963500797748566, -0.35802942514419556, -0.22173821926116943, -0.4318554103374481, -0.26458653807640076, 0.0791330337524414, -0.31133919954299927, 0.22769451141357422, -0.008818279951810837, 0.1374921351671219, 0.17254003882408142, -0.2371823638677597, -0.11669644713401794, -0.07926862686872482, 0.33736205101013184, -0.11537044495344162, -0.12358365207910538, 0.056596606969833374, 0.17954188585281372, 0.030254799872636795, 0.38401147723197937, 0.19777101278305054, 0.14940880239009857, -0.05672403424978256, 0.18229159712791443, -0.24147126078605652, -0.3104214668273926, -0.05596688389778137, 0.24438437819480896, 0.10093636810779572, -0.15094275772571564, -0.348132848739624, -0.5223906636238098, -0.19744080305099487, -0.2727625370025635, -0.07653740048408508, 0.37749987840652466, -0.18392816185951233, 0.10189971327781677, -0.4425641894340515, 0.07367028295993805, -0.15838465094566345, -0.13611111044883728, 0.24799498915672302, 0.377391517162323, -0.20067092776298523, 0.4093121886253357, 0.06696964800357819, 0.4792272746562958, -0.023933254182338715, 0.04921244829893112, -0.06969717890024185, -0.22962349653244019, -0.4112054407596588, -0.17315497994422913, 0.028907790780067444, -0.026150334626436234, 0.2778265178203583, 0.29357609152793884, 0.27266374230384827, 0.07783012092113495, 0.36874130368232727, -0.047269560396671295, 0.37906157970428467, -0.445214182138443, 0.19958090782165527, 0.1999385505914688, -0.06674210727214813, 0.11618074774742126, -0.08821659535169601, -0.13675417006015778, 0.25832074880599976, -0.14467072486877441, -0.3549526035785675, 0.005234770476818085, 0.40112411975860596, -0.11691916733980179, -0.29370176792144775, -0.2701558768749237, -0.09814640134572983, -0.01694471389055252, -0.10946527123451233, 0.2906847894191742, 0.14189180731773376, -0.17247122526168823, -0.43496009707450867, 0.027460746467113495, -0.2687280476093292, -0.37367647886276245, -0.19674542546272278, -0.12428191304206848, -0.14490634202957153, 0.4687481224536896, -0.030100341886281967, -0.20257848501205444, 0.4446249306201935, 0.16659002006053925, 0.0920604020357132, -0.18577919900417328, 0.22703787684440613, -0.1958257406949997, 0.47186893224716187, 0.26169106364250183, 0.13887017965316772, 0.12416927516460419, 0.03243716061115265, 0.2780061364173889, -0.32046258449554443, 0.1680966466665268, -0.15526431798934937, -0.36320093274116516, 0.4745890498161316, 0.06424037367105484, 0.12653696537017822, 0.1536327302455902, -0.2597934305667877, 0.34129273891448975, 0.1896287500858307, -0.09378442168235779, 0.14613838493824005, -0.045420993119478226, -0.39649176597595215, -0.3172013461589813, 0.31494295597076416, 0.3554765582084656, -0.14869101345539093, -0.22335821390151978, 0.3191339373588562, -0.21911053359508514, 0.13811174035072327, 0.37710514664649963, -0.14756175875663757, 0.2004878968000412, -0.42458271980285645, 0.38285306096076965, 0.009037613868713379, -0.13518638908863068, -0.1677432358264923, 0.32733139395713806, -0.030394509434700012, 0.2134213149547577, 0.13667374849319458, -0.03597401827573776, 0.3020155429840088, 0.009342949837446213, -0.11291605979204178, 0.08632445335388184, -0.3497138023376465, -0.15268555283546448, -0.11528637260198593, -0.006714291870594025, -0.08182850480079651, -0.013069942593574524, -0.14804047346115112, 0.07584375143051147, -0.20417749881744385, -0.1871969997882843, 0.5573441386222839, -0.20911166071891785, 0.036312028765678406, 0.14294898509979248, 0.2806127965450287, -0.029886256903409958, 0.04852811619639397, 0.15130895376205444, -0.25021493434906006, 0.2550325095653534, -0.1423303782939911, -0.14906874299049377, 0.12300533056259155, -0.5606223344802856, -0.10759148746728897, -0.06081714481115341, -0.13939014077186584, -0.41461944580078125, 0.03835011273622513, 0.088046133518219, 0.46256405115127563, -0.2970218062400818, -0.313513845205307, 0.1747664213180542, -0.6689097881317139, -0.024947389960289, -0.3861761689186096, 0.10910723358392715, 0.2402857095003128, -0.11258740723133087, 0.03820209205150604, 0.03611217439174652, 0.027869708836078644, -0.4939795136451721, 0.17318634688854218, 0.37116682529449463, 0.27884697914123535, 0.06686746329069138, -0.1645631045103073, 0.23544573783874512, 0.31877249479293823, -0.07683752477169037, -0.16940227150917053, -0.075505830347538, -0.20094723999500275, -0.1373097002506256, -0.12613193690776825, 0.6481679081916809, -0.09006409347057343, 0.3573373556137085, 0.0922601968050003, -0.006538517773151398, 0.025101296603679657, 0.14038506150245667, -0.16469059884548187, -0.1058158352971077, -0.17236055433750153, -0.0912531316280365, 0.32859522104263306, -0.02185320481657982, -0.549628496170044, 0.3286609947681427, 0.5534412264823914, 0.12592236697673798, -0.2175554633140564, -0.19584327936172485, 0.019314490258693695, 0.004803940653800964, 0.28885868191719055, 0.02814517915248871, 0.3420241177082062, 0.12111537903547287, 0.21975389122962952, 0.057011328637599945, -0.007599815726280212, -0.17158278822898865, 0.08119283616542816, 0.1408279836177826, 0.28363677859306335, 0.10404603183269501, -0.4387142062187195, -0.2909930646419525, -0.33811500668525696, 0.046901896595954895, 0.15317170321941376, -0.04926225543022156, -0.17857348918914795, 0.26286083459854126, -0.10002689063549042, -0.07193148881196976, -0.2279774397611618, 0.1185915395617485, 0.014045510441064835, -0.01897246018052101, 0.027209240943193436, 0.24787253141403198, -0.05652299523353577, 0.2609723210334778, 0.2127375602722168, 0.4696338176727295, -0.12517224252223969, 0.1833760291337967, -0.1655263900756836, 0.03361884504556656, -0.1763276904821396, 0.030574902892112732, 0.09455429017543793, -0.00907144695520401, 0.32781317830085754, -0.3196859061717987, -0.1564563661813736, -0.35627081990242004, -0.10841462761163712, 0.22405937314033508, -0.24978777766227722, 0.22627319395542145, 0.06587770581245422, -0.015306029468774796, -0.03654013201594353, 0.11041481047868729, 0.14160728454589844, -0.29163092374801636, -0.10062654316425323, -0.32997047901153564, -0.025217004120349884, -0.03079582378268242, 0.07233411073684692, -0.4891120493412018, -0.09275630116462708, -0.19757641851902008, 0.49801039695739746, 0.010840028524398804, 0.25560176372528076, -0.10218165814876556, 0.12769149243831635, -0.13173002004623413, -0.1377188116312027, -0.019797613844275475, -0.20373141765594482, -0.43579012155532837, 0.04193827882409096, -0.4589936137199402, -0.3159675598144531, -0.0679660439491272, 0.1578163504600525, 0.4778406322002411, 0.40177348256111145, -0.3468494415283203, -0.12651704251766205, 0.11455424875020981, -0.12351307272911072, 0.051921501755714417, -0.12286513298749924, 0.3220878839492798, -0.36680513620376587, 0.034523867070674896, -0.09350880235433578, -0.04513192176818848, 0.2994053363800049, -0.11118003726005554, -0.1643867790699005, 0.21376684308052063, 0.2329997420310974, 0.2652069926261902, 0.8911604881286621, 0.7480823993682861, 0.0032688486389815807, 0.05981016904115677, -0.15368853509426117, 0.21934908628463745, -0.12646980583667755, 0.11339931190013885, 0.04066073149442673, -0.042494937777519226, -0.14369475841522217, 0.23083941638469696, -0.030791372060775757, -0.1231626346707344, 0.15171051025390625, 0.26691752672195435, -0.0819728821516037, -0.3594277501106262, 0.2808273434638977, 0.12370537221431732, 0.4606548547744751, 0.03800702840089798, 0.37171417474746704, 0.10476867854595184, 0.11771168559789658, 0.08818711340427399, -0.08773043751716614, 0.5639621019363403, -0.032026924192905426, -0.6010419726371765, -0.09930851310491562, -0.22346609830856323, 0.24681565165519714, -0.06422507762908936, 0.33347955346107483, -0.2495959997177124, -0.19116643071174622, 0.2716468572616577, 0.040865685790777206, 0.6772844791412354, -0.20155824720859528, -0.38885748386383057, 0.14864003658294678, -0.4915696680545807, 0.09154222160577774, -0.04585833474993706, -0.1323028802871704, 0.5670313239097595, 0.15132960677146912, 0.31525352597236633, -0.18988367915153503, -0.43810155987739563, 0.35715171694755554, -0.02559741772711277, -0.20361480116844177, 0.06112827733159065, -0.11421738564968109, -0.22706831991672516, -0.14158087968826294, 0.2886286675930023, 0.24343451857566833, 0.02377181127667427, -0.25569337606430054, -0.21667613089084625, -0.36119961738586426, 0.15080317854881287, 0.002463746815919876, 0.2840009033679962, 0.29158714413642883, -0.005849868059158325, 0.1818637102842331, 0.4867871403694153, 0.0739843100309372, 0.25297579169273376, 0.46815961599349976, 0.019682105630636215, -0.07993875443935394, 0.3558696210384369, -0.16529278457164764, 0.30421286821365356, 0.6187527179718018, -0.09317395836114883, -0.0014415867626667023, -0.12098293006420135, 0.04371119290590286, -0.5611838102340698, -0.04747850075364113, 0.1258939951658249, 0.0609130896627903, -0.4860973358154297, -0.49586397409439087, 0.3319140076637268, 0.24725113809108734, -0.13781839609146118, 0.5511215925216675, 0.2667909264564514, -0.2618913948535919, 0.3019845187664032, 0.23217086493968964, 0.7719777822494507, 0.019327839836478233, 0.1211027055978775, 0.1801067739725113, 0.1896773725748062, 0.2630405128002167, -0.3742278814315796, 0.3605293035507202, -0.3241676092147827, -0.45271268486976624, -0.05166979134082794, -0.1596045047044754, 0.29038622975349426, 0.528167188167572, 0.15741334855556488, 0.2721465826034546, 0.19130803644657135, 0.0009748248849064112, -0.2638380229473114, 0.11751686781644821, 0.05310254544019699, -0.26358598470687866, -0.07900183647871017, 0.0670417994260788, 0.08534304797649384, 0.33112677931785583, -0.14762957394123077, -0.12184245139360428, 0.043977588415145874, 0.05341710150241852, -0.17625360190868378, -0.27615952491760254, -0.2013711929321289, 0.12524230778217316, 0.07269862294197083, -0.40961092710494995, -0.06895719468593597, 0.1933884620666504, 0.36864954233169556, -0.17538709938526154, -0.05035356432199478, 0.0493374802172184, -0.05643672123551369, -0.29668742418289185, -0.09645387530326843, -0.2205861508846283, 0.14901283383369446, 0.031074851751327515, 0.012389078736305237, -0.019269943237304688, 0.037002500146627426, -0.380550742149353, -0.24691690504550934, -0.0346623919904232, -0.10927261412143707, -0.30306124687194824, -0.06190142780542374, 0.1422021985054016, -0.08996172994375229, -0.18558087944984436, 0.034401822835206985, -0.0045931376516819, -0.2855871319770813, 0.3464326858520508, 0.0837753415107727, -0.26969432830810547, -0.06941302120685577, 0.042438190430402756, 0.18805277347564697, -0.08015134185552597, 0.13907846808433533, -0.04361743852496147, 0.015323899686336517, -0.2263716161251068, -0.029192134737968445, 0.22868908941745758, -0.3454652428627014, 0.17620936036109924, -0.3712182641029358, 0.3642938733100891, -0.06446286290884018, 0.13301730155944824, 0.1614534854888916, 0.1387934684753418, -0.15780843794345856, -0.223464697599411, -0.1686410903930664, 0.17655934393405914, 0.09978970885276794, 0.4354536235332489, 0.1687469631433487, -0.03779039904475212, -0.02490268275141716, 0.35618409514427185, -0.2604629397392273, -0.08816541731357574, -0.17223821580410004, 0.19149571657180786, 0.13282811641693115, 0.18921256065368652, 0.13313843309879303, -0.03680351376533508, -0.06137155741453171, 0.3000052273273468, -0.2084369957447052, -0.1616615355014801, 0.0338166281580925, 0.1677282750606537, 0.0910942479968071, 0.1286768615245819, 0.060656651854515076, 0.19488731026649475, -0.24144434928894043, -0.32733261585235596, 0.39381372928619385, -0.08038552105426788, 0.17550282180309296, -0.052628591656684875, 0.27849075198173523, 0.10226854681968689, -0.28320491313934326, 0.16884876787662506, 0.14157786965370178, -0.026898574084043503, 0.1422765552997589, 0.19093185663223267, -0.10514373332262039, -0.12718771398067474, 0.16853976249694824, 0.10517115890979767, 0.31820765137672424, -0.08803494274616241, 0.008180145174264908, -0.025394245982170105, 0.17196747660636902, -0.011549100279808044, 0.31837940216064453, 0.29769718647003174, -0.10097037255764008, 0.0639558732509613, -0.026257313787937164, 0.17936870455741882, -0.030711811035871506, 0.043635014444589615, 0.19490185379981995, 0.05013827234506607, 0.18044018745422363, 0.602196216583252, 0.6582242250442505, 0.3280295729637146, 0.14840476214885712, 0.09891604632139206, 0.08392523229122162, -0.48276734352111816, 0.3779727518558502, 0.10186824202537537, -0.010010302066802979, 0.363793283700943, 0.26114749908447266, 0.22013038396835327, 0.20073340833187103, 0.26529431343078613, -0.24674810469150543, 0.6788032054901123, 0.09702777117490768, 0.025161398574709892, 0.14753034710884094, -0.4295472800731659, -0.17751112580299377, 0.05939935892820358, -0.017862696200609207, 0.22690808773040771, -0.17169632017612457, 0.1522332727909088, -0.2850830554962158, -0.5434679985046387, -0.15879595279693604, 0.10572017729282379, -0.35404300689697266, -0.23783224821090698, -0.39949965476989746, -0.09148690104484558, -0.19899079203605652, 0.09322844445705414, 0.030180910602211952, -0.355020672082901, 0.5250190496444702, -0.12077713012695312, -0.015075717121362686, -0.0981808751821518, 0.12590134143829346, -0.013873595744371414, 0.2578144073486328, -0.18350844085216522, 0.16499623656272888, -0.20903870463371277, -0.0478740818798542, 0.02872103825211525, 0.16431447863578796, 0.2111167460680008, -0.12510353326797485, -0.023337116464972496, 0.3068634867668152, 0.12250801175832748, 0.07838593423366547, -0.03638976067304611, 0.1732083559036255, -0.025497853755950928, -0.060716938227415085, 0.28642481565475464, 0.0875694751739502, 0.030125342309474945, -0.09096521139144897, 0.21266354620456696, 0.17310133576393127, -0.3713923990726471, 0.3421262502670288, -0.3267953395843506, -0.13950461149215698, 0.013198502361774445, 0.042290087789297104, -0.15987709164619446, -0.1357736736536026, 0.4511496126651764, -0.29564714431762695, 0.1330302357673645, 0.1055070087313652, 0.05700995773077011, -0.14012743532657623, 0.333132803440094, -0.2154289036989212, 0.05903802439570427, -0.4647059142589569, -0.2686998248100281, -0.24331612884998322, -0.04165945202112198, -0.19256004691123962, 0.014715149998664856, 0.07962343096733093, 0.53023362159729, 0.18954876065254211, 0.20450615882873535, -0.005148977041244507, -0.3413792550563812, 0.06165602058172226, 0.6022584438323975, -0.22662529349327087, -0.02221064828336239, -0.600383460521698, 0.11222682148218155, 0.18205232918262482, -0.20507429540157318, 0.19072557985782623, 0.08706258237361908, -0.20441146194934845, 0.0017123054713010788, 0.18138478696346283, 0.3513803780078888, -0.12052596360445023, 0.0666336864233017, 0.02958935685455799, 0.07812995463609695, 0.021978333592414856, -0.06449971348047256, -0.3710622191429138, -0.16474619507789612, -0.3377898335456848, 0.5284016728401184, -0.027836117893457413, 0.08265041559934616, -0.15180638432502747, -0.25020521879196167, -0.28590893745422363, 0.0818486362695694, 0.3372504413127899, -0.1376095563173294, 0.1362256109714508, 0.2384268045425415, -0.24200651049613953, 0.0596957728266716, 0.6554337739944458, 0.5299537777900696, -0.0460180789232254, -0.16443634033203125, -0.1958140730857849, -0.3312655985355377, 0.38550153374671936, -0.4142022728919983, -0.1517190933227539, -0.13001053035259247, 0.23638132214546204, 0.3404814600944519, -0.15720327198505402, -0.4867466688156128, -0.21302485466003418, 0.37431612610816956, -0.42666369676589966, 0.21712777018547058, 0.27920472621917725, 0.13769027590751648, -0.3396315574645996, -0.10461115837097168, 0.22378601133823395, -0.034344859421253204, -0.5757866501808167, 0.1142365038394928, -0.5551273226737976 ]
https://github.com/huggingface/datasets/issues/5961
> For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. Is my understanding correct? Yes exactly :) > Where can I print the actual training data for each GPU? You should call print in the data_collator
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
49
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ > For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. Is my understanding correct? Yes exactly :) > Where can I print the actual training data for each GPU? You should call print in the data_collator
[ -0.347914457321167, -0.4232020378112793, -0.09536373615264893, 0.37167900800704956, 0.12340044975280762, 0.06726889312267303, 0.3374471664428711, 0.24970708787441254, -0.17176666855812073, 0.045485466718673706, -0.06359327584505081, 0.4129130244255066, 0.1829591542482376, 0.35210132598876953, 0.15202173590660095, -0.20253407955169678, 0.02739567682147026, 0.1704651564359665, -0.12409929931163788, -0.14504145085811615, -0.0925244688987732, 0.30689936876296997, -0.16651171445846558, -0.059370193630456924, -0.39257293939590454, -0.19429662823677063, -0.1592004895210266, -0.010584456846117973, 0.03672230988740921, -0.2860039472579956, 0.2142277956008911, 0.2141863852739334, 0.09041891247034073, 0.27373605966567993, -0.00011031264875782654, 0.23121905326843262, -0.11874014884233475, -0.2362535148859024, -0.07415592670440674, 0.01158151775598526, -0.07283536344766617, -0.041958730667829514, -0.3573552966117859, -0.2862743139266968, -0.43302828073501587, -0.2591206729412079, 0.026160812005400658, -0.25860482454299927, 0.21387609839439392, 0.012795943766832352, 0.17777591943740845, 0.18215712904930115, -0.17747905850410461, -0.055938053876161575, -0.03569517657160759, 0.2896443009376526, -0.12977981567382812, -0.12057642638683319, 0.05516745150089264, 0.2091808319091797, 0.0013539232313632965, 0.41547590494155884, 0.21197068691253662, 0.11510474979877472, -0.05482166260480881, 0.2135528177022934, -0.24653497338294983, -0.32453468441963196, -0.07517029345035553, 0.22687891125679016, 0.07425717264413834, -0.2210131734609604, -0.3121035099029541, -0.45995649695396423, -0.23387682437896729, -0.3535674810409546, -0.07772397249937057, 0.3652920722961426, -0.1340389996767044, 0.06847043335437775, -0.4160846471786499, 0.16014035046100616, -0.14962993562221527, -0.15580415725708008, 0.231756791472435, 0.3873045742511749, -0.23404857516288757, 0.37961509823799133, 0.07164591550827026, 0.47591057419776917, 0.019593823701143265, 0.04714493080973625, -0.05674237012863159, -0.1731255203485489, -0.45784205198287964, -0.18223582208156586, 0.01737428642809391, 0.022156039252877235, 0.27284109592437744, 0.32310450077056885, 0.23036012053489685, 0.08360924571752548, 0.3875594139099121, -0.024415988475084305, 0.33221250772476196, -0.3974415361881256, 0.21161751449108124, 0.21895501017570496, -0.09295350313186646, 0.1373669058084488, -0.1014416366815567, -0.1780148446559906, 0.24896398186683655, -0.1748056560754776, -0.37781500816345215, 0.04972464218735695, 0.3831818699836731, -0.0931282490491867, -0.21560803055763245, -0.22124087810516357, -0.11930638551712036, -0.007343307137489319, -0.07660523056983948, 0.30595844984054565, 0.10467465221881866, -0.17130935192108154, -0.38866135478019714, 0.020004604011774063, -0.22974562644958496, -0.39222365617752075, -0.23018769919872284, -0.08108766376972198, -0.17024919390678406, 0.43019968271255493, -0.057232119143009186, -0.155159592628479, 0.4467097520828247, 0.1200258731842041, 0.12445953488349915, -0.19502940773963928, 0.23510825634002686, -0.2620237469673157, 0.4555168151855469, 0.21017301082611084, 0.12152482569217682, 0.1532929241657257, 0.05724822357296944, 0.22760748863220215, -0.3159707486629486, 0.12804245948791504, -0.11276721954345703, -0.3635284900665283, 0.4842570722103119, 0.09783127158880234, 0.12214669585227966, 0.18723751604557037, -0.2404366284608841, 0.3543226718902588, 0.20192396640777588, -0.0046511366963386536, 0.12443872541189194, -0.060228362679481506, -0.39446136355400085, -0.32466921210289, 0.3908887505531311, 0.33632442355155945, -0.1839512437582016, -0.18023055791854858, 0.3643091917037964, -0.26668328046798706, 0.18404768407344818, 0.3589736819267273, -0.12915538251399994, 0.18406561017036438, -0.37697288393974304, 0.40193286538124084, -0.010067455470561981, -0.16460275650024414, -0.14880943298339844, 0.31551188230514526, -0.0060935914516448975, 0.25016045570373535, 0.1325823813676834, -0.054760806262493134, 0.31939825415611267, 0.01883935183286667, -0.12853793799877167, 0.1538524329662323, -0.36606109142303467, -0.09412486851215363, -0.161344975233078, 0.06930030137300491, -0.029701722785830498, 0.011571161448955536, -0.15662124752998352, 0.07564331591129303, -0.21604372560977936, -0.22955231368541718, 0.5505965948104858, -0.22383327782154083, 0.10202916711568832, 0.12473262846469879, 0.30863258242607117, -0.02261565998196602, 0.06185013800859451, 0.20860710740089417, -0.25776800513267517, 0.28861474990844727, -0.08279887586832047, -0.044585127383470535, 0.08061140775680542, -0.5615222454071045, -0.06362415105104446, -0.04510364308953285, -0.145237997174263, -0.3976958394050598, 0.10356183350086212, 0.04705639183521271, 0.4821653366088867, -0.26232150197029114, -0.2778693437576294, 0.19270049035549164, -0.6806437969207764, -0.01195620559155941, -0.39481204748153687, 0.11754612624645233, 0.1811407506465912, -0.0965251550078392, 0.058824002742767334, 0.06416469812393188, 0.04535023868083954, -0.4959653615951538, 0.16432172060012817, 0.4061289131641388, 0.28146201372146606, 0.042894452810287476, -0.18886899948120117, 0.18127334117889404, 0.31465619802474976, -0.06249037757515907, -0.14178989827632904, -0.1486702710390091, -0.17529790103435516, -0.16503101587295532, -0.011018099263310432, 0.6699594855308533, -0.0701160877943039, 0.3201805055141449, 0.11420102417469025, 0.001277826726436615, 0.04587195813655853, 0.14848604798316956, -0.14982441067695618, -0.09453760087490082, -0.18357273936271667, -0.08258115500211716, 0.29822710156440735, -0.011370832100510597, -0.5510948896408081, 0.3181559443473816, 0.5054692029953003, 0.12153428047895432, -0.2597842216491699, -0.23796716332435608, 0.012533837929368019, 0.032372139394283295, 0.31638193130493164, 0.05382103472948074, 0.34500932693481445, 0.1422538310289383, 0.20448312163352966, 0.0734167993068695, 0.020647093653678894, -0.15462395548820496, 0.05459536239504814, 0.10128358006477356, 0.25579512119293213, 0.07709966599941254, -0.44933637976646423, -0.29543551802635193, -0.32278040051460266, 0.01494590938091278, 0.16693457961082458, 0.007368149235844612, -0.16611257195472717, 0.20670394599437714, -0.09025779366493225, -0.09070160239934921, -0.22786322236061096, 0.10572165250778198, 0.013589046895503998, -0.017112597823143005, 0.037268541753292084, 0.21290811896324158, -0.05342329293489456, 0.2693033814430237, 0.2766236364841461, 0.40448063611984253, -0.08020835369825363, 0.17989814281463623, -0.1870773285627365, 0.00426950678229332, -0.14238643646240234, 0.06504389643669128, 0.0895371288061142, 0.030206095427274704, 0.3206195533275604, -0.28502151370048523, -0.13731881976127625, -0.33537447452545166, -0.08059143275022507, 0.19731831550598145, -0.34295761585235596, 0.17882637679576874, 0.06268714368343353, -0.04244327172636986, -0.09523120522499084, 0.11206315457820892, 0.19873957335948944, -0.26508286595344543, -0.1047719419002533, -0.2712864577770233, -0.04654720798134804, -0.07885508239269257, 0.06874097883701324, -0.4758237302303314, -0.17322224378585815, -0.20641887187957764, 0.5024129748344421, 0.055782854557037354, 0.266255259513855, -0.12319996953010559, 0.08664077520370483, -0.126786470413208, -0.11576759815216064, -0.0014519281685352325, -0.19346262514591217, -0.41486820578575134, 0.07958096265792847, -0.47318994998931885, -0.3726237118244171, -0.06908443570137024, 0.1677004098892212, 0.46643298864364624, 0.37381511926651, -0.346427321434021, -0.1549377590417862, 0.09307299554347992, -0.13159826397895813, 0.04277697578072548, -0.08940741419792175, 0.28640031814575195, -0.3454272150993347, 0.04685076326131821, -0.09975314885377884, -0.04287351667881012, 0.294536292552948, -0.08417609333992004, -0.1528707593679428, 0.17062799632549286, 0.2776169180870056, 0.3065270483493805, 0.8011934757232666, 0.723362386226654, -0.025031989440321922, 0.09823280572891235, -0.160822793841362, 0.21555683016777039, -0.06488922238349915, 0.10194123536348343, 0.11845624446868896, -0.06664863228797913, -0.1368759721517563, 0.2053852677345276, -0.06842488795518875, -0.1078571304678917, 0.10805372893810272, 0.242941752076149, -0.03623122721910477, -0.3629447817802429, 0.31298911571502686, 0.17507922649383545, 0.44367215037345886, 0.021063081920146942, 0.3311951756477356, 0.13348834216594696, 0.0940311849117279, 0.11807496845722198, -0.08140288293361664, 0.4656626880168915, 0.004329990595579147, -0.5618239045143127, -0.12601660192012787, -0.2855850160121918, 0.22762833535671234, -0.06296387314796448, 0.28383317589759827, -0.18554216623306274, -0.2366010695695877, 0.230149507522583, 0.06866972148418427, 0.656241774559021, -0.19128383696079254, -0.398780882358551, 0.13179518282413483, -0.48773452639579773, 0.07928840816020966, -0.05224035307765007, -0.16853322088718414, 0.4867168068885803, 0.12649673223495483, 0.36039790511131287, -0.20173820853233337, -0.4306771159172058, 0.3612467050552368, -0.017122860997915268, -0.19735822081565857, 0.06961981952190399, -0.146484375, -0.265556663274765, -0.17230506241321564, 0.2994779348373413, 0.2188851237297058, 0.054712843149900436, -0.2528173327445984, -0.224392831325531, -0.2868681848049164, 0.15520831942558289, 0.011019427329301834, 0.34894925355911255, 0.3030496835708618, -0.05341406911611557, 0.16589230298995972, 0.4143821895122528, 0.07143503427505493, 0.2510451376438141, 0.45179447531700134, -0.004824337549507618, -0.09708072245121002, 0.28846949338912964, -0.1761264204978943, 0.3459961414337158, 0.5448259115219116, -0.09599463641643524, 0.015142595395445824, -0.17703746259212494, 0.07674999535083771, -0.5274648070335388, -0.05327450856566429, 0.13264311850070953, 0.06692323088645935, -0.4682561159133911, -0.44967931509017944, 0.2930780351161957, 0.2029457539319992, -0.10392718017101288, 0.45956748723983765, 0.2608376145362854, -0.28545182943344116, 0.3186594843864441, 0.2698819637298584, 0.7651158571243286, -0.012937184423208237, 0.05099235102534294, 0.19064539670944214, 0.14306744933128357, 0.300235778093338, -0.40584251284599304, 0.30246272683143616, -0.37643513083457947, -0.5368126034736633, -0.03144705295562744, -0.1395886093378067, 0.2987842261791229, 0.52553391456604, 0.05612935870885849, 0.2405480593442917, 0.18268169462680817, 0.03632400184869766, -0.2872380316257477, 0.08074750006198883, 0.0767461359500885, -0.311092346906662, -0.11177591234445572, 0.10602343082427979, 0.06383199989795685, 0.24662624299526215, -0.13946130871772766, -0.08553822338581085, 0.049477510154247284, 0.019673950970172882, -0.06685825437307358, -0.24846132099628448, -0.30337953567504883, 0.1079343929886818, 0.10773810744285583, -0.4127391576766968, -0.08610687404870987, 0.19354462623596191, 0.3924899697303772, -0.15727755427360535, -0.01548308040946722, 0.03839539363980293, 0.03898762911558151, -0.23808982968330383, -0.05718429386615753, -0.2477301061153412, 0.14455176889896393, 0.03864775598049164, 0.0317872017621994, -0.026923339813947678, 0.04436570778489113, -0.3275102376937866, -0.17467838525772095, -0.04179910942912102, -0.11423735320568085, -0.3154250979423523, -0.058617301285266876, 0.14348924160003662, -0.10340497642755508, -0.1671644151210785, 0.07733188569545746, -0.02075948938727379, -0.36048465967178345, 0.36514711380004883, 0.03425288200378418, -0.2559124827384949, -0.07748419046401978, 0.003841917961835861, 0.1954081505537033, -0.03875966742634773, 0.100224569439888, 0.02319294959306717, -0.029924198985099792, -0.22861790657043457, -0.03043808788061142, 0.2916349768638611, -0.34387481212615967, 0.1713627278804779, -0.3282260000705719, 0.35160672664642334, -0.08913364261388779, 0.1626693308353424, 0.14465297758579254, 0.16353796422481537, -0.14855533838272095, -0.22153304517269135, -0.21020002663135529, 0.19417715072631836, 0.11074195802211761, 0.4238513708114624, 0.1637265980243683, 0.05616771802306175, -0.04724343866109848, 0.41649094223976135, -0.3079017996788025, -0.106238454580307, -0.20614051818847656, 0.2624075412750244, 0.13593560457229614, 0.17124693095684052, 0.15432392060756683, -0.006063532084226608, -0.00584624707698822, 0.3439781367778778, -0.23321953415870667, -0.21158698201179504, 0.02140367031097412, 0.14208555221557617, 0.15626919269561768, 0.139054536819458, 0.02342132478952408, 0.21583543717861176, -0.2585315704345703, -0.3657149374485016, 0.42440879344940186, -0.08983367681503296, 0.11432670056819916, -0.05186382308602333, 0.25106802582740784, 0.08203860372304916, -0.2790699005126953, 0.125911146402359, 0.11322413384914398, -0.06212714686989784, 0.20439372956752777, 0.1812160313129425, -0.11732777953147888, -0.11244597285985947, 0.2415488362312317, 0.09969566762447357, 0.28482586145401, -0.09167040884494781, 0.028973808512091637, -0.02965359389781952, 0.11708512157201767, -0.039561763405799866, 0.40646517276763916, 0.2763810455799103, -0.10980186611413956, 0.005249708890914917, 0.003735780715942383, 0.22446683049201965, -0.053449735045433044, 0.0558328777551651, 0.2540106475353241, -0.0032860785722732544, 0.21482816338539124, 0.6381476521492004, 0.6046338677406311, 0.3459823429584503, 0.10121137648820877, 0.06978745758533478, 0.12022856622934341, -0.4861343801021576, 0.314121812582016, 0.016669031232595444, -0.05505245178937912, 0.34363511204719543, 0.2720523774623871, 0.21968699991703033, 0.1975298821926117, 0.23934882879257202, -0.2510238289833069, 0.6070178151130676, 0.1004975363612175, 0.030266614630818367, 0.1261737197637558, -0.4255164563655853, -0.1647859513759613, 0.07478814572095871, -0.05376119539141655, 0.18807125091552734, -0.2163715660572052, 0.16677720844745636, -0.2989409267902374, -0.5278447270393372, -0.14181062579154968, 0.13315458595752716, -0.36847347021102905, -0.17325766384601593, -0.37372830510139465, -0.06798969209194183, -0.2628680467605591, 0.051719702780246735, 0.05151045694947243, -0.3571981191635132, 0.4845019578933716, -0.09914416074752808, 0.013749342411756516, -0.12028079479932785, 0.06096803769469261, -0.010792640969157219, 0.2599257230758667, -0.19600580632686615, 0.16677196323871613, -0.21455825865268707, -0.05400791019201279, 0.006765086203813553, 0.1134277880191803, 0.15928788483142853, -0.05462532863020897, -0.007180027663707733, 0.3169010579586029, 0.143879234790802, 0.056093208491802216, -0.034581661224365234, 0.16354480385780334, 0.014501748606562614, -0.02657683752477169, 0.3163416385650635, 0.11854363977909088, -0.0073625147342681885, -0.15114200115203857, 0.21635083854198456, 0.16239917278289795, -0.3168541193008423, 0.26445046067237854, -0.25180211663246155, -0.1313425451517105, -0.016896937042474747, 0.001567687839269638, -0.19944018125534058, -0.1602737009525299, 0.42462804913520813, -0.30702751874923706, 0.15250977873802185, 0.11248865723609924, 0.07463473081588745, -0.1289568543434143, 0.35223865509033203, -0.19306811690330505, 0.05477968603372574, -0.5252780914306641, -0.32370078563690186, -0.23747855424880981, 0.002412758767604828, -0.16254553198814392, -0.049701787531375885, 0.05396673083305359, 0.5451308488845825, 0.19717267155647278, 0.21035102009773254, -0.06609637290239334, -0.34697768092155457, 0.0666612833738327, 0.5273028612136841, -0.24081510305404663, -0.06597767770290375, -0.6515903472900391, 0.07369350641965866, 0.1704411655664444, -0.1686599850654602, 0.17990079522132874, 0.13832636177539825, -0.13854065537452698, 0.003207344561815262, 0.17722731828689575, 0.2952158451080322, -0.1923065185546875, 0.07640892267227173, 0.025934157893061638, 0.08467500656843185, 0.020652540028095245, 0.010606296360492706, -0.2979644536972046, -0.13819605112075806, -0.37966611981391907, 0.48530200123786926, -0.015960082411766052, 0.07820046693086624, -0.08586924523115158, -0.24234525859355927, -0.32126346230506897, 0.1694738119840622, 0.39838507771492004, -0.16340811550617218, 0.16964760422706604, 0.2632388174533844, -0.19094060361385345, 0.0507049597799778, 0.58773273229599, 0.5096011161804199, -0.01049293763935566, -0.1180410236120224, -0.18688274919986725, -0.3611954152584076, 0.40835344791412354, -0.46026545763015747, -0.12208334356546402, -0.10051509737968445, 0.2219666838645935, 0.319418340921402, -0.15779022872447968, -0.5054298043251038, -0.2128581702709198, 0.3368663191795349, -0.4174727201461792, 0.11997826397418976, 0.29293763637542725, 0.14346203207969666, -0.306477427482605, -0.08903350681066513, 0.12756718695163727, -0.046131815761327744, -0.5232005715370178, 0.09096064418554306, -0.5348384380340576 ]
https://github.com/huggingface/datasets/issues/5961
I print out n_shards, and under multiple GPUs, this value is always 1. Is this value correct?
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
17
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ I print out n_shards, and under multiple GPUs, this value is always 1. Is this value correct?
[ -0.4411472678184509, -0.5177356004714966, -0.08604525774717331, 0.26262933015823364, 0.015819620341062546, -0.052527137100696564, 0.4174102246761322, 0.22069090604782104, -0.012561824172735214, 0.0985802710056305, 0.07519344985485077, 0.29676541686058044, 0.17903944849967957, 0.3083149790763855, 0.029824256896972656, -0.12798991799354553, 0.11298426985740662, 0.10172834992408752, -0.0393192432820797, -0.04098181053996086, -0.20166680216789246, 0.3351096212863922, -0.15422934293746948, -0.11706455051898956, -0.36864495277404785, -0.13218913972377777, -0.0823233425617218, -0.01942899450659752, 0.18084730207920074, -0.34340816736221313, 0.1702427864074707, 0.30582675337791443, -0.005985837429761887, 0.29152369499206543, -0.00011228567746002227, 0.18926531076431274, 0.009875139221549034, -0.2040966898202896, -0.11183363199234009, 0.0946299135684967, -0.12995189428329468, 0.0769314244389534, -0.4380892515182495, -0.1854676455259323, -0.4073556661605835, -0.2784873843193054, -0.0008075013756752014, -0.3366997539997101, 0.16200143098831177, -0.05908183753490448, 0.1632920205593109, 0.18591338396072388, -0.12678033113479614, -0.06848429143428802, 0.07038605213165283, 0.3642595410346985, -0.15200451016426086, -0.17017775774002075, 0.026041671633720398, 0.12725237011909485, 0.002429638057947159, 0.40185990929603577, 0.15302306413650513, 0.26509857177734375, 0.029852066189050674, 0.09936012327671051, -0.16862422227859497, -0.2500556409358978, -0.11583185940980911, 0.24375444650650024, 0.034106943756341934, -0.13576452434062958, -0.3881843686103821, -0.5524798631668091, -0.197063609957695, -0.24276548624038696, -0.008799612522125244, 0.20631234347820282, -0.1009320616722107, -0.021549737080931664, -0.35394877195358276, 0.12318188697099686, -0.03556106984615326, -0.2000175416469574, 0.2806869149208069, 0.3912389874458313, -0.1568245142698288, 0.42533838748931885, 0.24333471059799194, 0.3010513484477997, -0.06274773180484772, 0.07347188889980316, -0.17159973084926605, -0.20910148322582245, -0.4476950466632843, -0.11739825457334518, 0.16759052872657776, 0.03135769069194794, 0.3301422894001007, 0.3594542443752289, 0.20147579908370972, 0.0401698462665081, 0.43594661355018616, -0.016502702608704567, 0.34938666224479675, -0.45391395688056946, 0.33756643533706665, 0.13037224113941193, 0.06230749562382698, 0.02945917472243309, 0.03903774917125702, -0.08234428614377975, 0.300811767578125, -0.33017638325691223, -0.34688031673431396, 0.01169690489768982, 0.45219260454177856, -0.1049516350030899, -0.23266369104385376, -0.38273340463638306, -0.11836035549640656, -0.022887155413627625, -0.07458336651325226, 0.21920520067214966, 0.26604557037353516, -0.18896137177944183, -0.45285922288894653, 0.09993566572666168, -0.2962753176689148, -0.480156809091568, -0.19593913853168488, -0.19186243414878845, -0.07335233688354492, 0.42754870653152466, -0.0013145580887794495, -0.19777566194534302, 0.32946687936782837, 0.11616402864456177, 0.10544757544994354, -0.2497696578502655, 0.20613211393356323, -0.16745348274707794, 0.2123681753873825, 0.31665951013565063, 0.1624673455953598, 0.15625214576721191, 0.016252070665359497, 0.15067824721336365, -0.30617555975914, 0.20272108912467957, -0.11166776716709137, -0.4122900664806366, 0.43624991178512573, 0.09651797264814377, 0.12596021592617035, 0.187257319688797, -0.3617004454135895, 0.3221401870250702, 0.35403212904930115, -0.03586086258292198, 0.07022006064653397, -0.011434649117290974, -0.4633655548095703, -0.3123227655887604, 0.22669866681098938, 0.4224297106266022, -0.08168401569128036, -0.2329346239566803, 0.23068740963935852, -0.2917846441268921, 0.1043521910905838, 0.4898083209991455, -0.19648149609565735, 0.10242146253585815, -0.4032226800918579, 0.5295925140380859, -0.1416810005903244, -0.06986787915229797, -0.2369471937417984, 0.4103141725063324, -0.05076821893453598, 0.08384943008422852, 0.1561807245016098, -0.013463679701089859, 0.3003627061843872, -0.07806497812271118, -0.055280908942222595, 0.20412659645080566, -0.30705419182777405, -0.022863104939460754, -0.16280701756477356, 0.011881627142429352, -0.010127376765012741, 0.02068866789340973, -0.0938490480184555, 0.0119459368288517, -0.12433841824531555, -0.21480807662010193, 0.505230188369751, -0.18872962892055511, 0.1564018726348877, 0.17117305099964142, 0.4274307191371918, -0.16256484389305115, 0.12574005126953125, 0.07378919422626495, -0.30875906348228455, 0.3124621510505676, -0.1756870597600937, -0.17020346224308014, 0.11390804499387741, -0.5557125210762024, -0.027442779392004013, -0.045026883482933044, -0.186563640832901, -0.2725740671157837, 0.059697914868593216, 0.06847988069057465, 0.2869827151298523, -0.4303480386734009, -0.26326948404312134, 0.14707380533218384, -0.5283803343772888, -0.005171172320842743, -0.2711390256881714, 0.11647328734397888, 0.18657635152339935, -0.12448553740978241, 0.018694035708904266, -0.016122549772262573, 0.18648874759674072, -0.4977174997329712, 0.1838340163230896, 0.3832712769508362, 0.30811643600463867, 0.0817122682929039, -0.12540458142757416, 0.1807226836681366, 0.33182045817375183, 0.03671024739742279, -0.11434589326381683, -0.04769153892993927, -0.2077687531709671, -0.22725731134414673, -0.10573437809944153, 0.5842347145080566, -0.11570912599563599, 0.46356984972953796, -0.08658815175294876, -0.011983390897512436, 0.1747535765171051, 0.18182267248630524, -0.1923818439245224, -0.1881994605064392, -0.13631050288677216, -0.11831080913543701, 0.1874210685491562, 0.07156355679035187, -0.3310016393661499, 0.31586575508117676, 0.28396084904670715, 0.09475475549697876, -0.16364476084709167, -0.12702986598014832, 0.06392012536525726, -0.06912701576948166, 0.2508493959903717, 0.18503181636333466, 0.43350300192832947, 0.12975087761878967, 0.1153789609670639, -0.08736400306224823, -0.037753619253635406, -0.1844601184129715, 0.02909410372376442, 0.0704650729894638, 0.26119810342788696, 0.18260082602500916, -0.3092767596244812, -0.35193270444869995, -0.32461023330688477, -0.06287162750959396, 0.3048273026943207, -0.013413310050964355, -0.23724853992462158, 0.21402141451835632, -0.08925797045230865, -0.12587569653987885, -0.14349275827407837, 0.17948290705680847, -0.1246877983212471, -0.08043043315410614, 0.04272080957889557, 0.33485743403434753, -0.1592179536819458, 0.2973276972770691, 0.30493593215942383, 0.43870675563812256, -0.13959237933158875, 0.09812023490667343, -0.10545007139444351, 0.04668120667338371, -0.018112363293766975, 0.0354095920920372, 0.1487450748682022, -0.00027164071798324585, 0.36341172456741333, -0.20655003190040588, -0.20663180947303772, -0.45536690950393677, -0.068424753844738, 0.19926369190216064, -0.26859062910079956, 0.20772822201251984, 0.04789324849843979, -0.0930568277835846, 0.06039603054523468, 0.15131835639476776, 0.21007400751113892, -0.19748198986053467, -0.068700410425663, -0.20818427205085754, -0.11721768975257874, -0.08303703367710114, -0.002841264009475708, -0.22727009654045105, -0.01604992151260376, -0.20529219508171082, 0.4413391351699829, -0.03513595834374428, 0.3110021948814392, -0.04471200704574585, 0.13059894740581512, -0.22234566509723663, -0.05234333127737045, -0.20169290900230408, -0.15263015031814575, -0.24962779879570007, -0.026861749589443207, -0.44745928049087524, -0.3120589852333069, -0.03864473104476929, 0.191709965467453, 0.41736435890197754, 0.5022121071815491, -0.18617379665374756, -0.1714766025543213, 0.0013983622193336487, -0.12172448635101318, 0.11173059046268463, -0.16199709475040436, 0.3147013187408447, -0.2559540569782257, 0.017435766756534576, -0.13408294320106506, -0.13650459051132202, 0.4243752658367157, -0.04165925830602646, -0.11926935613155365, 0.306411474943161, 0.3510684669017792, 0.2595131993293762, 0.8457050323486328, 0.8310247659683228, 0.06463003158569336, 0.1752554327249527, -0.10485338419675827, 0.12764912843704224, -0.14051255583763123, 0.10359332710504532, 0.15408873558044434, -0.026870720088481903, -0.18188300728797913, 0.2127658873796463, -0.028482476249337196, -0.1735931932926178, 0.15400174260139465, 0.14841820299625397, -0.003958374261856079, -0.4029726982116699, 0.2495003640651703, 0.19323071837425232, 0.4154259264469147, 0.05124847590923309, 0.21946488320827484, 0.08077060431241989, 0.17046935856342316, 0.020234744995832443, -0.11629223078489304, 0.596342921257019, -0.03847988694906235, -0.5473150014877319, 0.046510905027389526, -0.2767401337623596, 0.2492232322692871, -0.054418548941612244, 0.3394722640514374, -0.17375844717025757, -0.10426220297813416, 0.2533649504184723, 0.03654078394174576, 0.6893612742424011, -0.2154891937971115, -0.25806617736816406, 0.10470164567232132, -0.4589366614818573, -0.07724442332983017, -0.11523911356925964, -0.10999149084091187, 0.6345522999763489, 0.10481297969818115, 0.2752847969532013, -0.27677881717681885, -0.3737088143825531, 0.3034522235393524, -0.03911088779568672, -0.17082053422927856, -0.05120161175727844, -0.207351416349411, -0.2491386979818344, -0.3226878046989441, 0.26800650358200073, 0.3620937466621399, 0.10638231039047241, -0.1869596391916275, -0.2658209800720215, -0.4273093640804291, -0.09195868670940399, -0.00501110777258873, 0.17872247099876404, 0.33705663681030273, -0.1153804212808609, 0.33318275213241577, 0.35001105070114136, -0.02203495055437088, 0.25540629029273987, 0.4117128849029541, 0.0203021839261055, -0.11494331061840057, 0.2649710774421692, -0.2142414003610611, 0.2332400679588318, 0.5782407522201538, -0.10985296219587326, 0.005845237523317337, -0.18615636229515076, 0.21471315622329712, -0.49495166540145874, -0.14280760288238525, 0.0859406515955925, 0.043068356812000275, -0.41823479533195496, -0.37602707743644714, 0.30778130888938904, 0.2378271222114563, -0.12831063568592072, 0.5823006629943848, 0.48356667160987854, -0.2681965231895447, 0.38658809661865234, 0.21733158826828003, 0.743752121925354, -0.0921303927898407, -0.0885191410779953, 0.00450504943728447, 0.279413104057312, 0.1311756819486618, -0.3246946632862091, 0.4140806496143341, -0.3470797836780548, -0.43519312143325806, -0.005045689642429352, -0.09474451094865799, 0.2979191541671753, 0.5699235796928406, 0.17243517935276031, 0.21821379661560059, 0.13970661163330078, 0.0034155226312577724, -0.3371574580669403, 0.14281055331230164, -0.01602594181895256, -0.3166384696960449, -0.012901538982987404, 0.08448043465614319, 0.014287817291915417, 0.3446871340274811, -0.1264331042766571, -0.010758582502603531, 0.20604689419269562, -0.029948770999908447, -0.22690533101558685, -0.31089574098587036, -0.1588125079870224, 0.18950903415679932, 0.06956618279218674, -0.3882238268852234, -0.01892414316534996, 0.1455165594816208, 0.30211496353149414, -0.18069756031036377, -0.02891205996274948, 0.06546333432197571, -0.07157791405916214, -0.29906290769577026, -0.21763965487480164, -0.218486487865448, 0.026605764403939247, -0.02430585026741028, -0.10978181660175323, -0.23465125262737274, 0.11267085373401642, -0.4598419666290283, -0.19077393412590027, 0.0299813374876976, -0.1755201816558838, -0.22966112196445465, 0.011989641934633255, 0.07059380412101746, -0.09440912306308746, -0.19013383984565735, 0.05202271416783333, 0.05486726388335228, -0.15863201022148132, 0.3021578788757324, 0.05666080117225647, -0.26769736409187317, -0.03630749136209488, 0.07455915212631226, 0.060789406299591064, -0.1133115291595459, 0.02854880318045616, -0.02042723447084427, -0.07227693498134613, -0.21617946028709412, -0.06745783984661102, 0.14675576984882355, -0.3755464255809784, 0.21087448298931122, -0.4256216585636139, 0.27006930112838745, -0.07076455652713776, 0.16835720837116241, 0.09966494143009186, 0.2859489917755127, -0.07587424665689468, -0.23174872994422913, -0.03188261017203331, 0.1644076704978943, -0.033909909427165985, 0.36264872550964355, 0.14299581944942474, -0.1527026891708374, 0.05637316405773163, 0.4002898335456848, -0.2701164782047272, -0.16103968024253845, -0.08977949619293213, 0.18271504342556, 0.1829281598329544, 0.17666922509670258, 0.019945267587900162, 0.019405029714107513, -0.03919915482401848, 0.37048548460006714, -0.13516739010810852, -0.16611537337303162, 0.019122444093227386, 0.15092046558856964, 0.12130871415138245, 0.051834069192409515, 0.04622575268149376, 0.049005165696144104, -0.3447008728981018, -0.3883039057254791, 0.4454006552696228, -0.014485225081443787, 0.0691252201795578, -0.13824276626110077, 0.4335651397705078, 0.040063388645648956, -0.2563329339027405, 0.23368749022483826, 0.1677233874797821, -0.046713341027498245, 0.1075233742594719, 0.19556516408920288, -0.0064683593809604645, -0.1043870747089386, 0.1472165733575821, 0.17226800322532654, 0.41253674030303955, -0.00022033415734767914, -0.06971310079097748, -0.04708288237452507, 0.13946223258972168, 0.07510825991630554, 0.461643248796463, 0.24013210833072662, -0.15845322608947754, 0.0785875990986824, -0.03496571630239487, 0.2161771059036255, -0.101161889731884, -0.1251031458377838, 0.20752011239528656, 0.18996283411979675, 0.2503207325935364, 0.6625103950500488, 0.6368757486343384, 0.2967999279499054, 0.1076052337884903, 0.1265815794467926, 0.1733713299036026, -0.4509574770927429, 0.2513284981250763, -0.007784649729728699, -0.07772362977266312, 0.2171739935874939, 0.3312612771987915, 0.08044258505105972, 0.3114245533943176, 0.49540796875953674, -0.34373539686203003, 0.7242546677589417, 0.13681656122207642, 0.06875370442867279, 0.1586398482322693, -0.3780403137207031, -0.08088763058185577, 0.06148663908243179, -0.006785400211811066, 0.06950017809867859, -0.08365853875875473, 0.19305068254470825, -0.24852298200130463, -0.457347571849823, -0.18971562385559082, 0.13949467241764069, -0.2888585329055786, -0.3046199381351471, -0.33090049028396606, -0.05749252438545227, -0.29403501749038696, 0.06356621533632278, -0.047125089913606644, -0.28846675157546997, 0.5046268701553345, -0.12774555385112762, 0.039376553148031235, -0.19466575980186462, 0.13697899878025055, -0.03683243691921234, 0.31772664189338684, -0.3026016354560852, 0.08888457715511322, -0.13311035931110382, -0.04330498352646828, 0.12793472409248352, 0.06337675452232361, 0.22375549376010895, -0.0775848925113678, -0.034571997821331024, 0.3464168608188629, -0.06160242110490799, 0.10243085771799088, -0.11271733045578003, 0.06871896237134933, -0.16844654083251953, 0.054076217114925385, 0.27790868282318115, 0.08951015025377274, -0.003061961382627487, -0.24362319707870483, 0.24423564970493317, 0.19218897819519043, -0.34780484437942505, 0.3887718915939331, -0.4258798658847809, -0.13094814121723175, 0.019227825105190277, 0.06149832904338837, -0.04530847817659378, -0.2177198827266693, 0.4208241403102875, -0.3409176468849182, 0.13939136266708374, 0.09814785420894623, 0.06838718056678772, -0.12725037336349487, 0.32436704635620117, -0.465871661901474, 0.04524961858987808, -0.4151080548763275, -0.2616741359233856, -0.3298540711402893, -0.04302017390727997, -0.28131696581840515, 0.07702276110649109, 0.11504248529672623, 0.5291211009025574, 0.10534313321113586, 0.20730823278427124, 0.041652861982584, -0.15727129578590393, 0.11560788750648499, 0.5700746178627014, -0.16114528477191925, -0.03808548301458359, -0.6279802918434143, -0.016271010041236877, 0.26348793506622314, -0.3317127525806427, 0.21885216236114502, 0.11044931411743164, -0.13683462142944336, -0.09259030222892761, 0.15778407454490662, 0.4432409703731537, -0.24083325266838074, 0.09477052092552185, 0.1111229658126831, 0.17022639513015747, 0.1039721742272377, 0.01808982342481613, -0.4660789966583252, -0.13371586799621582, -0.4687620997428894, 0.43452945351600647, 0.024218376725912094, 0.0720217153429985, -0.1294405460357666, -0.22622761130332947, -0.33741044998168945, 0.25876134634017944, 0.28593504428863525, 0.03331602364778519, 0.031104229390621185, 0.2880469560623169, -0.24740692973136902, 0.08885914087295532, 0.4729551374912262, 0.3539799451828003, 0.05097600072622299, -0.12372592091560364, -0.15482579171657562, -0.4350983500480652, 0.3425977826118469, -0.36662131547927856, -0.10658623278141022, -0.16290977597236633, 0.2900846600532532, 0.2730199098587036, -0.3124350905418396, -0.42017239332199097, -0.2448151707649231, 0.30615442991256714, -0.2671057879924774, 0.13119783997535706, 0.24466116726398468, 0.15890944004058838, -0.3830150365829468, -0.13359686732292175, 0.125546395778656, 0.020568884909152985, -0.47345632314682007, 0.12438376992940903, -0.4175770878791809 ]
https://github.com/huggingface/datasets/issues/5961
Yes it's correct, and it explains why you always have the same data passed to your map function (the data can't be split). But after being passed to `map`, each GPU keeps one example out of n(GPUs) so that you don't end up with duplicate data across GPUs
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
48
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ Yes it's correct, and it explains why you always have the same data passed to your map function (the data can't be split). But after being passed to `map`, each GPU keeps one example out of n(GPUs) so that you don't end up with duplicate data across GPUs
[ -0.3965552747249603, -0.5092836618423462, -0.10583838820457458, 0.2740623354911804, 0.09118995070457458, -0.07790995389223099, 0.3442014157772064, 0.22046878933906555, 0.0705917626619339, 0.10969898849725723, -0.05882649123668671, 0.474252849817276, 0.2462736815214157, 0.3017978072166443, 0.03295820578932762, -0.11664193868637085, 0.02865011990070343, 0.11272279173135757, -0.2256578803062439, -0.11387534439563751, -0.21732297539710999, 0.2879834473133087, -0.17019644379615784, -0.13735152781009674, -0.3091680109500885, -0.13444112241268158, -0.10840584337711334, 0.061396483331918716, 0.06829258799552917, -0.22696371376514435, 0.1320951282978058, 0.17058220505714417, -0.0863758847117424, 0.3495585322380066, -0.00010638588719302788, 0.1939057558774948, -0.01976151391863823, -0.2307203710079193, -0.05897518992424011, -0.06525731086730957, -0.09514963626861572, 0.07829085737466812, -0.47370660305023193, -0.19157126545906067, -0.35038721561431885, -0.20234918594360352, -0.05394425988197327, -0.3926753103733063, 0.3173311948776245, -0.09090263396501541, 0.22706124186515808, 0.16084614396095276, -0.14831556379795074, -0.1074579656124115, 0.054432161152362823, 0.35567712783813477, -0.16262027621269226, -0.13930031657218933, 0.015189232304692268, 0.16692525148391724, -0.03831838443875313, 0.4355912506580353, 0.0695943757891655, 0.296689510345459, 0.10032953321933746, 0.12415089458227158, -0.17917688190937042, -0.26172107458114624, -0.02411036007106304, 0.21173405647277832, 0.0482659749686718, -0.17959770560264587, -0.3160431981086731, -0.4138432443141937, -0.3186229169368744, -0.24621596932411194, -0.07030691206455231, 0.17381319403648376, -0.1325342059135437, 0.004300428554415703, -0.37894290685653687, 0.14845436811447144, 0.0034845471382141113, -0.17431175708770752, 0.2354026734828949, 0.29452162981033325, -0.1908651739358902, 0.4279633164405823, 0.18527276813983917, 0.3549882769584656, -0.16323411464691162, -0.06257358938455582, -0.10060829669237137, -0.13082385063171387, -0.3963453769683838, -0.12887734174728394, 0.19644127786159515, 0.06987310945987701, 0.4351464509963989, 0.27482324838638306, 0.19151459634304047, 0.1194368302822113, 0.35035645961761475, 0.01997947134077549, 0.4454496204853058, -0.3423845171928406, 0.27043360471725464, 0.12135803699493408, -0.012880446389317513, -0.07380041480064392, -0.1365782618522644, -0.1428689956665039, 0.4060576856136322, -0.10396991670131683, -0.355618953704834, -0.05051865801215172, 0.43574321269989014, -0.10554522275924683, -0.22709131240844727, -0.35208001732826233, -0.1021110936999321, -0.04750250652432442, -0.09731623530387878, 0.3152281939983368, 0.22185108065605164, -0.22058361768722534, -0.4474112391471863, 0.0342722088098526, -0.22233471274375916, -0.2712286114692688, -0.2582089304924011, -0.21477559208869934, -0.1734500229358673, 0.42749863862991333, -0.036065537482500076, -0.18920037150382996, 0.4714653491973877, 0.10784634202718735, 0.11556348204612732, -0.18388520181179047, 0.2976221740245819, -0.21618005633354187, 0.35026511549949646, 0.23938190937042236, 0.18494653701782227, 0.2070656418800354, 0.00195268914103508, 0.1427680402994156, -0.23860514163970947, 0.17311206459999084, -0.18757495284080505, -0.3864670395851135, 0.44612351059913635, 0.14794598519802094, 0.13402022421360016, 0.2196308672428131, -0.31449800729751587, 0.26549145579338074, 0.23613876104354858, -0.123433917760849, 0.032684989273548126, 0.02986239641904831, -0.42980578541755676, -0.38233187794685364, 0.20241175591945648, 0.38960081338882446, -0.05791771411895752, -0.24186381697654724, 0.18033826351165771, -0.2241814136505127, 0.09168592840433121, 0.4978778660297394, -0.245031476020813, 0.05538491532206535, -0.41018104553222656, 0.5418630242347717, -0.06326942890882492, -0.07105222344398499, -0.241923987865448, 0.4067402780056, -0.0772964283823967, 0.134821355342865, 0.018369536846876144, -0.007632497698068619, 0.3557727336883545, -0.10664641857147217, -0.16239942610263824, 0.24111832678318024, -0.2905440032482147, 0.02537296712398529, -0.10207610577344894, 0.07465856522321701, 0.048158712685108185, -0.06882277876138687, -0.24186980724334717, 0.0647219568490982, -0.04263337329030037, -0.13861417770385742, 0.5052061080932617, -0.20557644963264465, 0.1427229791879654, 0.11693400144577026, 0.3943658173084259, -0.1367853283882141, 0.1531909555196762, 0.07613493502140045, -0.36180874705314636, 0.25591933727264404, -0.12651358544826508, -0.10292144119739532, 0.12755538523197174, -0.5777977108955383, -0.03693316504359245, -0.0642937570810318, -0.20373225212097168, -0.32596880197525024, 0.13945288956165314, 0.07407712936401367, 0.28307071328163147, -0.4103224575519562, -0.2071504145860672, 0.098981112241745, -0.4791373014450073, -0.05180912837386131, -0.2254250943660736, 0.08064591139554977, 0.10263466835021973, -0.11315709352493286, -0.015033438801765442, 0.015829790383577347, 0.152035191655159, -0.42121586203575134, 0.20432095229625702, 0.32451632618904114, 0.37417155504226685, 0.024565763771533966, -0.1421939879655838, 0.09170807898044586, 0.282334566116333, 0.04417308419942856, -0.10269136726856232, -0.03134657070040703, -0.1018032431602478, -0.3153291344642639, -0.1174626350402832, 0.5032427310943604, 0.002768317237496376, 0.4221087694168091, -0.03468449413776398, 0.006970159709453583, 0.16605278849601746, 0.11226032674312592, -0.136497363448143, -0.1779223382472992, -0.19817492365837097, -0.08064929395914078, 0.3004474341869354, 0.1620888113975525, -0.3262736201286316, 0.3555035889148712, 0.44940438866615295, 0.13013865053653717, -0.13953520357608795, -0.19402337074279785, -0.048535045236349106, -0.06319617480039597, 0.27642643451690674, 0.09121058881282806, 0.4671958088874817, 0.17033720016479492, 0.16026455163955688, 0.01821618340909481, 0.07606212794780731, -0.08893132954835892, 0.051502618938684464, 0.1082969456911087, 0.307528018951416, 0.10142386704683304, -0.3554530739784241, -0.3023832440376282, -0.3717901408672333, -0.021317340433597565, 0.2120741307735443, -0.08513843268156052, -0.17906245589256287, 0.1686534434556961, -0.13064514100551605, -0.09555225819349289, -0.0919661670923233, 0.11116188764572144, -0.07653376460075378, -0.05652540922164917, -0.004451590124517679, 0.3408583402633667, -0.13993757963180542, 0.30167680978775024, 0.39267727732658386, 0.32931962609291077, -0.06095791980624199, 0.024675613269209862, -0.1750621646642685, -0.020865175873041153, -0.03168545290827751, 0.10556739568710327, 0.1606599986553192, 0.015830818563699722, 0.34041109681129456, -0.15231728553771973, -0.14711551368236542, -0.4043912887573242, -0.1494223177433014, 0.24225279688835144, -0.395847350358963, 0.1494227796792984, 0.08187256753444672, 0.0006903000175952911, -0.06013054400682449, 0.1737235188484192, 0.16295886039733887, -0.3440818786621094, -0.21929100155830383, -0.22010649740695953, -0.09439383447170258, -0.21950867772102356, -0.1498224437236786, -0.32580888271331787, 0.0038058310747146606, -0.24806353449821472, 0.5107688307762146, 0.08730873465538025, 0.30388855934143066, -0.08772057294845581, 0.16121487319469452, -0.1109386533498764, -0.1573166400194168, -0.16753149032592773, -0.3303348422050476, -0.2844567596912384, 0.07491211593151093, -0.4981776475906372, -0.35452526807785034, -0.051300112158060074, 0.2191692739725113, 0.4163534939289093, 0.3550371825695038, -0.23614376783370972, -0.23958353698253632, 0.07793188840150833, -0.04043351858854294, 0.1055598258972168, -0.003524571657180786, 0.36088457703590393, -0.26960286498069763, -0.04199777916073799, -0.22199034690856934, -0.19074755907058716, 0.313069611787796, 0.022669602185487747, -0.0184103362262249, 0.26336848735809326, 0.33622032403945923, 0.26661065220832825, 0.8166880011558533, 0.7689892649650574, 0.05223005637526512, 0.2619008421897888, -0.18246346712112427, 0.20740307867527008, -0.2701968252658844, 0.12629270553588867, 0.16140161454677582, -0.10509983450174332, -0.13805446028709412, 0.21856197714805603, -0.04291100054979324, -0.26517391204833984, 0.14871583878993988, 0.11222352087497711, -0.05474007502198219, -0.35074007511138916, 0.23494479060173035, 0.30265867710113525, 0.30164605379104614, 0.1586824208498001, 0.2769958972930908, 0.07064847648143768, 0.17952056229114532, 0.1283065527677536, -0.18956348299980164, 0.5828249454498291, -0.0388423353433609, -0.5157598257064819, 0.024480849504470825, -0.3250696659088135, 0.2695460617542267, 0.007504083216190338, 0.15823540091514587, -0.14012505114078522, -0.18040117621421814, 0.20035071671009064, 0.055156052112579346, 0.6496487855911255, -0.23829101026058197, -0.2784264087677002, 0.0075047314167022705, -0.4231199622154236, -0.09444612264633179, 0.03936021029949188, -0.09961800277233124, 0.6246872544288635, 0.1715574562549591, 0.34943345189094543, -0.2932548224925995, -0.3441532552242279, 0.1441429704427719, 0.00257236510515213, -0.14087273180484772, -0.0025425776839256287, -0.2244119942188263, -0.30723443627357483, -0.335942804813385, 0.18285797536373138, 0.32834720611572266, 0.01859673485159874, -0.11088543385267258, -0.20003652572631836, -0.3287561237812042, 0.018383018672466278, -0.016821328550577164, 0.21807894110679626, 0.4295184314250946, -0.0796244665980339, 0.18846169114112854, 0.39392945170402527, 0.005116811487823725, 0.09345957636833191, 0.506096363067627, 0.022491730749607086, -0.03219786286354065, 0.25494104623794556, -0.26378268003463745, 0.1661708950996399, 0.4939103424549103, -0.03160231560468674, -0.05735107511281967, -0.22904150187969208, 0.12420323491096497, -0.4030665457248688, -0.21023201942443848, 0.14840112626552582, 0.05192821845412254, -0.322593092918396, -0.40944600105285645, 0.29580092430114746, 0.12065562605857849, -0.17212536931037903, 0.5486755967140198, 0.34028565883636475, -0.16913947463035583, 0.4366650879383087, 0.2111556977033615, 0.7519564628601074, 0.06283930689096451, -0.01564236916601658, 0.10107848048210144, 0.26027238368988037, 0.11679592728614807, -0.23372980952262878, 0.25827598571777344, -0.33563992381095886, -0.4317142367362976, -0.007550079375505447, -0.1559174358844757, 0.21159371733665466, 0.5273828506469727, 0.04027363657951355, 0.20728075504302979, 0.20669883489608765, 0.10548079013824463, -0.3153412640094757, 0.14250129461288452, 0.04812375456094742, -0.26462867856025696, 0.0006271172314882278, 0.17908647656440735, 0.07654432952404022, 0.32973673939704895, -0.04440159723162651, -0.0918077677488327, 0.16554781794548035, -0.088864766061306, -0.06525103002786636, -0.22484970092773438, -0.2275732159614563, 0.18969127535820007, 0.06590548902750015, -0.2651970684528351, -0.07169191539287567, 0.14851327240467072, 0.1787276417016983, -0.13886886835098267, -0.009900801815092564, 0.06576235592365265, 0.060393888503313065, -0.05464501678943634, -0.1645696759223938, -0.2704126536846161, 0.0707603469491005, 0.00034796446561813354, -0.03825778514146805, -0.1818414032459259, 0.034385520964860916, -0.4668411612510681, -0.2390916347503662, 0.07563860714435577, -0.1412692368030548, -0.23741328716278076, -0.014292731881141663, 0.1603318303823471, -0.15473441779613495, -0.14849933981895447, 0.10110369324684143, -0.019087310880422592, -0.1670103669166565, 0.37992680072784424, 0.06651066243648529, -0.29624927043914795, -0.05844421312212944, 0.12109828740358353, 0.12753590941429138, -0.03111361712217331, 0.02076510153710842, -0.115725077688694, -0.10812447965145111, -0.19999027252197266, -0.07127012312412262, 0.19063499569892883, -0.34175610542297363, 0.18152981996536255, -0.4039428234100342, 0.2375476360321045, -0.07108806073665619, 0.21495023369789124, 0.03911691531538963, 0.33682242035865784, -0.16242223978042603, -0.24930265545845032, -0.09219862520694733, 0.18076303601264954, -0.010835264809429646, 0.3476465940475464, 0.18174628913402557, -0.08106480538845062, 0.04499310255050659, 0.39933979511260986, -0.35246485471725464, -0.07682172954082489, -0.017907191067934036, 0.2960563004016876, 0.208746999502182, 0.11960916221141815, 0.08949989080429077, -0.02994542010128498, 0.013324916362762451, 0.4332602620124817, -0.24708382785320282, -0.2327931672334671, 0.002133406698703766, 0.11972982436418533, 0.11078342795372009, 0.06435627490282059, -0.03356637805700302, 0.11812560260295868, -0.2174208015203476, -0.40286776423454285, 0.5289996266365051, -0.06762728095054626, 0.053812868893146515, -0.1855529397726059, 0.37177330255508423, -0.02806662768125534, -0.204216867685318, 0.18815089762210846, 0.11544547230005264, -0.0629984587430954, 0.1233442947268486, 0.09240782260894775, -0.051869314163923264, -0.11828557401895523, 0.2371712327003479, 0.11693507432937622, 0.3932553827762604, -0.0272995475679636, 0.056390199810266495, 0.022566482424736023, 0.16879376769065857, 0.06166752055287361, 0.44014662504196167, 0.27193117141723633, -0.13673381507396698, 0.059847235679626465, -0.05495033413171768, 0.28510499000549316, -0.08857134729623795, -0.13420799374580383, 0.2816607356071472, 0.12710700929164886, 0.26715293526649475, 0.5601784586906433, 0.5723792910575867, 0.31703221797943115, 0.0974741205573082, 0.06458602845668793, 0.16755346953868866, -0.42112821340560913, 0.2132236212491989, -0.03430879861116409, -0.15963898599147797, 0.19827508926391602, 0.33737659454345703, 0.11574824899435043, 0.238824725151062, 0.4376015067100525, -0.2994813024997711, 0.6384474039077759, 0.041017647832632065, 0.05299069732427597, 0.1838652491569519, -0.3633083701133728, -0.02752678096294403, 0.10564830154180527, -0.1261293888092041, 0.14118769764900208, -0.03417268767952919, 0.09074278175830841, -0.23614373803138733, -0.47981616854667664, -0.11139111965894699, 0.15596020221710205, -0.36467596888542175, -0.1744462549686432, -0.35139793157577515, -0.03313642740249634, -0.23338207602500916, 0.03412192314863205, -0.00948940310627222, -0.32800260186195374, 0.6139358282089233, -0.17326602339744568, -0.04175751656293869, -0.09749815613031387, 0.002017321065068245, -0.10227793455123901, 0.24494266510009766, -0.2335803210735321, 0.10887197405099869, -0.19774767756462097, -0.01870182529091835, 0.06579731404781342, 0.14109915494918823, 0.14231383800506592, -0.0017822450026869774, -0.022263893857598305, 0.2941305935382843, 0.09558600187301636, -0.021323051303625107, -0.174348384141922, 0.10742777585983276, -0.16540728509426117, -0.09412570297718048, 0.30748745799064636, 0.1531987190246582, -0.0644812136888504, -0.24348610639572144, 0.21773402392864227, 0.2562704086303711, -0.2608559727668762, 0.3125852644443512, -0.3829716742038727, -0.1270337849855423, -0.0027942657470703125, 0.010739471763372421, -0.13393545150756836, -0.1636800616979599, 0.3696924149990082, -0.4047955870628357, 0.16980218887329102, -0.04665450379252434, 0.10041306167840958, -0.10906299948692322, 0.3380485773086548, -0.34111157059669495, -0.0490986667573452, -0.4251098930835724, -0.29913440346717834, -0.39053499698638916, 0.045556776225566864, -0.2539674937725067, 0.0999172031879425, 0.07174688577651978, 0.5402119159698486, 0.11724568903446198, 0.2766392230987549, -0.015380248427391052, -0.18958289921283722, 0.03126932680606842, 0.5298494100570679, -0.18908491730690002, -0.029278866946697235, -0.5703702569007874, 0.040177494287490845, 0.2934997081756592, -0.31223323941230774, 0.23769620060920715, 0.08325887471437454, -0.02521459385752678, -0.12344783544540405, 0.20357583463191986, 0.2749301493167877, -0.23412702977657318, 0.12599541246891022, 0.12185481935739517, 0.08440776914358139, -0.014998693019151688, 0.01297479122877121, -0.3262394666671753, -0.11893174052238464, -0.43791186809539795, 0.360451340675354, 0.03578798472881317, 0.07284858822822571, -0.05177057161927223, -0.20859530568122864, -0.30241459608078003, 0.2028558999300003, 0.2990073263645172, -0.011360898613929749, 0.07128628343343735, 0.30921435356140137, -0.34468525648117065, 0.13976682722568512, 0.33488601446151733, 0.4700365960597992, 0.06174338608980179, -0.1021050363779068, -0.15039868652820587, -0.40946677327156067, 0.43117064237594604, -0.3955366313457489, -0.15645907819271088, -0.09891123324632645, 0.22054514288902283, 0.22771693766117096, -0.4020948112010956, -0.4735599458217621, -0.22197583317756653, 0.27379128336906433, -0.2637464702129364, 0.07074151933193207, 0.21750731766223907, 0.002428866922855377, -0.26314401626586914, -0.17098113894462585, 0.16888318955898285, 0.012128913775086403, -0.497984915971756, 0.22608238458633423, -0.39807823300361633 ]
https://github.com/huggingface/datasets/issues/5961
> > For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. > > Is my understanding correct? > > Yes exactly :) > > > Where can I print the actual training data for each GPU? > > You should call print in the data_collator OK, when printing the train data in the data collator, each GPU sees different data. Thanks for your reply
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
77
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ > > For each GPU, although see the same data in prepare_data(), the actual training data will not be the same in the end. > > Is my understanding correct? > > Yes exactly :) > > > Where can I print the actual training data for each GPU? > > You should call print in the data_collator OK, when printing the train data in the data collator, each GPU sees different data. Thanks for your reply
[ -0.286543071269989, -0.44449901580810547, -0.09795355796813965, 0.3963581323623657, 0.11219131201505661, 0.07839414477348328, 0.3804986774921417, 0.24164199829101562, -0.16741898655891418, 0.06556814908981323, -0.09847146272659302, 0.401059091091156, 0.1971670687198639, 0.37721991539001465, 0.16482079029083252, -0.2395353615283966, 0.03492288291454315, 0.16347764432430267, -0.14284414052963257, -0.15156346559524536, -0.09411446750164032, 0.2972385287284851, -0.15559273958206177, -0.025857992470264435, -0.4048958420753479, -0.19738103449344635, -0.20605064928531647, -0.0038210470229387283, 0.03740251064300537, -0.26199930906295776, 0.2426261007785797, 0.196005180478096, 0.12110325694084167, 0.34647536277770996, -0.00011071185872424394, 0.22531281411647797, -0.1307348906993866, -0.20698615908622742, -0.05665947124361992, -0.019790135324001312, -0.04340340942144394, -0.07433630526065826, -0.3225833475589752, -0.325184166431427, -0.4502485394477844, -0.22344249486923218, 0.03513878583908081, -0.25455164909362793, 0.20782031118869781, -0.009664472192525864, 0.17077995836734772, 0.17800948023796082, -0.2052030712366104, -0.049200303852558136, -0.028713908046483994, 0.26348215341567993, -0.12487702071666718, -0.07338732481002808, 0.05263897031545639, 0.2221633791923523, -0.021205604076385498, 0.40507546067237854, 0.24389159679412842, 0.12735942006111145, -0.06471829116344452, 0.24133162200450897, -0.20026060938835144, -0.33843794465065, -0.10542581975460052, 0.2314549833536148, 0.10006548464298248, -0.2298770248889923, -0.3000311851501465, -0.43133944272994995, -0.2625015676021576, -0.3552795648574829, -0.08894988149404526, 0.38093915581703186, -0.1468385010957718, 0.052079617977142334, -0.42964401841163635, 0.15916641056537628, -0.15519553422927856, -0.1494550108909607, 0.1756158173084259, 0.3769635856151581, -0.2514720857143402, 0.39570730924606323, 0.038227379322052, 0.5235770344734192, 0.03301900252699852, 0.017127279192209244, -0.00309654395096004, -0.1849258542060852, -0.4695470631122589, -0.15898577868938446, -0.014863085001707077, -0.030917007476091385, 0.2046874612569809, 0.33211749792099, 0.24075263738632202, 0.08871041238307953, 0.36765149235725403, -0.008725123479962349, 0.3674372732639313, -0.3576582074165344, 0.14999686181545258, 0.23572930693626404, -0.11070704460144043, 0.1402415633201599, -0.1546902060508728, -0.20557145774364471, 0.2381047010421753, -0.16665150225162506, -0.3950367569923401, 0.05257463827729225, 0.36611229181289673, -0.10193043202161789, -0.20219555497169495, -0.21969330310821533, -0.13415491580963135, -0.03234052658081055, -0.07416211068630219, 0.2905736565589905, 0.06689827144145966, -0.15299057960510254, -0.3585280776023865, 0.0224011167883873, -0.24622508883476257, -0.34698933362960815, -0.23960621654987335, -0.09731613844633102, -0.19030675292015076, 0.44681742787361145, -0.09905517101287842, -0.15977059304714203, 0.4008038640022278, 0.13804934918880463, 0.12368407100439072, -0.23076662421226501, 0.22349925339221954, -0.2856050133705139, 0.4623897671699524, 0.19170024991035461, 0.12849557399749756, 0.19136500358581543, 0.09366366267204285, 0.23408345878124237, -0.3319525718688965, 0.12613636255264282, -0.12671056389808655, -0.36235886812210083, 0.4680432975292206, 0.09150630235671997, 0.11861944198608398, 0.21285149455070496, -0.2236262410879135, 0.3199158012866974, 0.16497580707073212, -0.004087239503860474, 0.15499286353588104, -0.05636528879404068, -0.3631628155708313, -0.34980273246765137, 0.402718186378479, 0.2806525230407715, -0.17939472198486328, -0.17239925265312195, 0.3841089606285095, -0.2688989043235779, 0.19802072644233704, 0.35093387961387634, -0.14718899130821228, 0.1932118535041809, -0.37650805711746216, 0.35205498337745667, 0.019032973796129227, -0.18552863597869873, -0.14430859684944153, 0.32287800312042236, -0.02327970415353775, 0.2812851667404175, 0.13949967920780182, -0.030507074669003487, 0.3014284372329712, 0.02117755264043808, -0.1369437873363495, 0.12264763563871384, -0.34308576583862305, -0.11029981076717377, -0.1805659532546997, 0.08901403844356537, -0.012494673021137714, 0.019282907247543335, -0.17593331634998322, 0.0960908979177475, -0.21377716958522797, -0.21462729573249817, 0.580713152885437, -0.18787145614624023, 0.06124859303236008, 0.13775292038917542, 0.3041572868824005, 0.010767833329737186, 0.07098732888698578, 0.22636741399765015, -0.21057626605033875, 0.28622615337371826, -0.08272437751293182, -0.03979374095797539, 0.13059279322624207, -0.5554487705230713, -0.07691744714975357, -0.06607227772474289, -0.14638331532478333, -0.39859509468078613, 0.09239128232002258, 0.0751567929983139, 0.5132447481155396, -0.2398553192615509, -0.2844665050506592, 0.2022581696510315, -0.6922416090965271, -0.008724510669708252, -0.3969575762748718, 0.14196062088012695, 0.1778031289577484, -0.07670679688453674, 0.06550902128219604, 0.07462429255247116, 0.02558310702443123, -0.4752381443977356, 0.1440892219543457, 0.41657906770706177, 0.2821665406227112, 0.03444775566458702, -0.243674173951149, 0.2146018147468567, 0.31343039870262146, -0.07498878240585327, -0.10305792838335037, -0.13937044143676758, -0.1668727546930313, -0.17534464597702026, -0.005230141803622246, 0.6554282903671265, -0.08765128999948502, 0.2977064549922943, 0.10612133145332336, -0.022491376847028732, 0.011988021433353424, 0.13922467827796936, -0.13197961449623108, -0.08496853709220886, -0.19435417652130127, -0.05169716477394104, 0.33001628518104553, -0.0012134779244661331, -0.5509125590324402, 0.3066670000553131, 0.5330295562744141, 0.13431552052497864, -0.29171210527420044, -0.28698602318763733, -0.016310013830661774, 0.04330240190029144, 0.328232079744339, 0.062291115522384644, 0.331149160861969, 0.1327839344739914, 0.22585952281951904, 0.09194382280111313, 0.01028236374258995, -0.16021442413330078, 0.0037131309509277344, 0.13707703351974487, 0.2765817940235138, 0.045387838035821915, -0.46141815185546875, -0.2942768633365631, -0.26131367683410645, 0.0526534765958786, 0.17291125655174255, 0.013100223615765572, -0.14673587679862976, 0.21817931532859802, -0.07479382306337357, -0.14514294266700745, -0.27070534229278564, 0.09486176073551178, 0.011067284271121025, 0.0011371895670890808, 0.016222864389419556, 0.19178786873817444, -0.006410591304302216, 0.25782692432403564, 0.22400854527950287, 0.41486048698425293, -0.10294464975595474, 0.19091840088367462, -0.16200794279575348, 0.006531290709972382, -0.18105505406856537, 0.06659716367721558, 0.10677286982536316, 0.05563244968652725, 0.29945138096809387, -0.28292328119277954, -0.08183883875608444, -0.29932859539985657, -0.09564156830310822, 0.20366427302360535, -0.3234332203865051, 0.18489772081375122, 0.03185824677348137, -0.021120525896549225, -0.11828689277172089, 0.105092354118824, 0.19992101192474365, -0.2642745077610016, -0.10442167520523071, -0.2879117727279663, -0.011084876954555511, -0.06877951323986053, 0.079750657081604, -0.5070547461509705, -0.18319669365882874, -0.20624291896820068, 0.5021281242370605, 0.05513833463191986, 0.2588644027709961, -0.14547289907932281, 0.06609092652797699, -0.1184619665145874, -0.07961440086364746, 0.016179747879505157, -0.17338143289089203, -0.4361010491847992, 0.03028307855129242, -0.46770283579826355, -0.37193647027015686, -0.07382108271121979, 0.1732402890920639, 0.45435476303100586, 0.33527448773384094, -0.36963072419166565, -0.15374580025672913, 0.07768579572439194, -0.14606904983520508, 0.08380408585071564, -0.07486636936664581, 0.2808408737182617, -0.3882249891757965, 0.07392709702253342, -0.08214614540338516, -0.06849701702594757, 0.2800666391849518, -0.06699768453836441, -0.14323464035987854, 0.19599172472953796, 0.27359580993652344, 0.2960667312145233, 0.7479658722877502, 0.7249964475631714, -0.050314389169216156, 0.0899980366230011, -0.1732035130262375, 0.2365625500679016, -0.04622398689389229, 0.09515757858753204, 0.1371915191411972, -0.05638228356838226, -0.1384716033935547, 0.20578265190124512, -0.07894901931285858, -0.10263749212026596, 0.10097481310367584, 0.21077701449394226, -0.06676778197288513, -0.34843623638153076, 0.33747974038124084, 0.1764884740114212, 0.4276122748851776, -0.006980374455451965, 0.3002905249595642, 0.12894511222839355, 0.07877439260482788, 0.13245072960853577, -0.05682464316487312, 0.43860071897506714, 0.019142601639032364, -0.5814553499221802, -0.14685854315757751, -0.23892122507095337, 0.21710550785064697, -0.05497921630740166, 0.27589502930641174, -0.16022270917892456, -0.2626572847366333, 0.26502129435539246, 0.07488461583852768, 0.6593090295791626, -0.16823093593120575, -0.4338991343975067, 0.14724299311637878, -0.519662618637085, 0.07308460772037506, -0.061768077313899994, -0.1850123554468155, 0.4969223737716675, 0.12665992975234985, 0.3718138337135315, -0.17638644576072693, -0.4410238564014435, 0.3484647572040558, -0.00395439937710762, -0.21370193362236023, 0.043642766773700714, -0.16620571911334991, -0.21046215295791626, -0.13394497334957123, 0.3043457567691803, 0.15755847096443176, 0.06712344288825989, -0.29533395171165466, -0.2162609100341797, -0.2680646777153015, 0.167706698179245, -0.01368308812379837, 0.37340593338012695, 0.3149082362651825, -0.08500521630048752, 0.10753472149372101, 0.4550235867500305, 0.10900187492370605, 0.22864015400409698, 0.46067067980766296, -0.00060987938195467, -0.09165497124195099, 0.3185289800167084, -0.1436765193939209, 0.31691575050354004, 0.5215116143226624, -0.05324535816907883, 0.018453167751431465, -0.1469598263502121, 0.016192235052585602, -0.5143808126449585, -0.08058016002178192, 0.13279849290847778, 0.06405909359455109, -0.4717099964618683, -0.4783004820346832, 0.30521368980407715, 0.2300693690776825, -0.09837256371974945, 0.4442809820175171, 0.2524147033691406, -0.2549550235271454, 0.3155277967453003, 0.24045170843601227, 0.7969062328338623, -0.01957222819328308, 0.06767198443412781, 0.17916935682296753, 0.09534506499767303, 0.33297356963157654, -0.4315207898616791, 0.3062412142753601, -0.411294549703598, -0.5366024374961853, -0.06173020973801613, -0.16667141020298004, 0.3123842179775238, 0.48321402072906494, 0.06268356740474701, 0.2092181295156479, 0.1755845695734024, 0.05732683837413788, -0.30141913890838623, 0.06999924778938293, 0.058164067566394806, -0.25323793292045593, -0.11694547533988953, 0.08894176781177521, 0.0947900116443634, 0.2583039700984955, -0.13916023075580597, -0.07307064533233643, -0.018350467085838318, 0.04755154252052307, -0.05483429133892059, -0.24012412130832672, -0.31080108880996704, 0.10647688806056976, 0.13462652266025543, -0.42256683111190796, -0.11894874274730682, 0.19473078846931458, 0.42096656560897827, -0.16501551866531372, 0.006653796881437302, 0.02619059383869171, 0.06943605840206146, -0.22862599790096283, -0.033404599875211716, -0.247117817401886, 0.2022428959608078, 0.03998246788978577, -0.0005334615707397461, 0.045996204018592834, 0.052939776331186295, -0.34561318159103394, -0.18563327193260193, -0.020972441881895065, -0.10402071475982666, -0.34145742654800415, -0.0882348045706749, 0.16890770196914673, -0.09607508778572083, -0.1339259147644043, 0.07468976080417633, -0.017690308392047882, -0.35948097705841064, 0.3785780668258667, 0.02788379229605198, -0.2603106200695038, -0.05379842594265938, -0.012564379721879959, 0.24056467413902283, -0.04565657302737236, 0.1059412956237793, 0.014535903930664062, -0.02531106024980545, -0.20236381888389587, -0.04628777503967285, 0.3330862820148468, -0.32843583822250366, 0.1455020159482956, -0.3307781517505646, 0.39758604764938354, -0.03934447839856148, 0.16144947707653046, 0.1592910885810852, 0.18740084767341614, -0.18956264853477478, -0.21918024122714996, -0.18463438749313354, 0.20374071598052979, 0.1022181510925293, 0.45201364159584045, 0.17396898567676544, 0.08074985444545746, -0.04156193137168884, 0.4382022023200989, -0.2995753288269043, -0.12183468788862228, -0.22431591153144836, 0.2414069026708603, 0.135530024766922, 0.19663439691066742, 0.13331416249275208, -0.022695530205965042, -0.018063968047499657, 0.34945738315582275, -0.24550364911556244, -0.20245715975761414, 0.04097399860620499, 0.1475013643503189, 0.17232555150985718, 0.10395965725183487, -0.0025893449783325195, 0.21144729852676392, -0.22211265563964844, -0.3358319401741028, 0.4156058430671692, -0.06368795037269592, 0.11423203349113464, -0.06105656176805496, 0.24116268754005432, 0.08444081991910934, -0.3450769782066345, 0.11664855480194092, 0.09944026172161102, -0.07272971421480179, 0.255967915058136, 0.15718097984790802, -0.1214674636721611, -0.1063806414604187, 0.2306123524904251, 0.07644937932491302, 0.2938285768032074, -0.10503927618265152, 0.009217798709869385, -0.038529153913259506, 0.147641122341156, -0.07098332047462463, 0.40572452545166016, 0.274231880903244, -0.09796787798404694, -0.004461333155632019, 0.018097806721925735, 0.2093815803527832, -0.018930640071630478, 0.0954328253865242, 0.2915823459625244, -0.008952850475907326, 0.1859242171049118, 0.6440369486808777, 0.6222525835037231, 0.38485658168792725, 0.09930574148893356, 0.04446536302566528, 0.10445888340473175, -0.504697322845459, 0.34209200739860535, 0.044244278222322464, -0.06948177516460419, 0.3520568311214447, 0.2699355185031891, 0.21860256791114807, 0.16463196277618408, 0.21605657041072845, -0.2408948391675949, 0.5416643619537354, 0.12121185660362244, 0.008300555869936943, 0.15595051646232605, -0.40713000297546387, -0.20535650849342346, 0.05122959986329079, -0.09054610133171082, 0.19628407061100006, -0.27798616886138916, 0.15036790072917938, -0.31305280327796936, -0.4937051832675934, -0.1238555833697319, 0.11990676820278168, -0.3681567311286926, -0.14127260446548462, -0.40688827633857727, -0.08731549233198166, -0.2659551799297333, 0.058897197246551514, 0.04543346166610718, -0.3776938021183014, 0.46510568261146545, -0.08690309524536133, -0.026110190898180008, -0.08709326386451721, 0.006717538461089134, 0.0011453507468104362, 0.23007377982139587, -0.15329991281032562, 0.18430756032466888, -0.21572916209697723, -0.03230884298682213, 0.04543497413396835, 0.11647578328847885, 0.1474611908197403, -0.058687105774879456, 0.026317507028579712, 0.2794460356235504, 0.18016314506530762, 0.04519829899072647, 0.005764469504356384, 0.15521088242530823, 0.05536693334579468, -0.054831575602293015, 0.2877972722053528, 0.12009276449680328, -0.0027999095618724823, -0.12152720987796783, 0.1949397325515747, 0.18627798557281494, -0.35805824398994446, 0.25003814697265625, -0.2613230049610138, -0.12150036543607712, -0.04840223491191864, -0.0029692426323890686, -0.2428247183561325, -0.18220987915992737, 0.4261106848716736, -0.28591859340667725, 0.12929297983646393, 0.107897087931633, 0.06790879368782043, -0.10430212318897247, 0.3096826672554016, -0.1517057716846466, 0.08039195835590363, -0.49871626496315, -0.32083237171173096, -0.2398839145898819, 0.055986687541007996, -0.13738960027694702, -0.08620363473892212, 0.028229501098394394, 0.5367046594619751, 0.1815619021654129, 0.1782694011926651, -0.0645795464515686, -0.3396725356578827, 0.06526188552379608, 0.533186674118042, -0.24537979066371918, -0.04898707941174507, -0.6642367839813232, 0.06301414221525192, 0.12277565151453018, -0.13864274322986603, 0.16647709906101227, 0.1729516088962555, -0.15186798572540283, 0.023565933108329773, 0.1750534474849701, 0.2938419580459595, -0.1740836650133133, 0.08526468276977539, -0.008280414156615734, 0.10996896028518677, 0.0406469851732254, 0.01713317632675171, -0.2898522615432739, -0.13611137866973877, -0.4031717777252197, 0.49267861247062683, -0.02242197096347809, 0.09396856278181076, -0.08248786628246307, -0.23681160807609558, -0.3335079252719879, 0.17512424290180206, 0.3794712424278259, -0.18732479214668274, 0.23114600777626038, 0.21764665842056274, -0.18568164110183716, 0.022491414099931717, 0.6765444278717041, 0.5361804366111755, 0.03425762802362442, -0.127852201461792, -0.169777512550354, -0.3201259970664978, 0.3866463303565979, -0.4830588400363922, -0.12466912716627121, -0.09217891097068787, 0.20863954722881317, 0.3175640106201172, -0.13620725274085999, -0.5124226808547974, -0.22753998637199402, 0.342561811208725, -0.420255571603775, 0.17407910525798798, 0.2844814360141754, 0.14372548460960388, -0.27399033308029175, -0.10049841552972794, 0.1210521012544632, -0.055018700659275055, -0.5044971108436584, 0.06772513687610626, -0.5140365362167358 ]
https://github.com/huggingface/datasets/issues/5961
Do we have a solution for this one? Or it's required to get "number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU"
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
33
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ Do we have a solution for this one? Or it's required to get "number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU"
[ -0.4867711663246155, -0.4351811110973358, -0.07999777048826218, 0.20005813241004944, 0.09749133884906769, -0.0396166667342186, 0.3830694258213043, 0.24505838751792908, -0.03761538490653038, 0.13198687136173248, 0.10013092309236526, 0.3976881206035614, 0.12254050374031067, 0.30259254574775696, -0.011111155152320862, -0.1409377157688141, 0.0003554113209247589, 0.18500161170959473, -0.03467220067977905, 0.004925921559333801, -0.18822413682937622, 0.2672995328903198, -0.14891502261161804, -0.16513016819953918, -0.36741483211517334, -0.16272993385791779, -0.02426646649837494, -0.010327555239200592, 0.09197863936424255, -0.37241825461387634, 0.17201578617095947, 0.3093021810054779, 0.04743402451276779, 0.2258504182100296, -0.00010879652836592868, 0.23027989268302917, -0.014822809025645256, -0.22579830884933472, -0.10022499412298203, 0.07154884189367294, -0.09250876307487488, 0.1043642982840538, -0.42806994915008545, -0.20016448199748993, -0.4201439619064331, -0.2691290080547333, -0.00019398517906665802, -0.41578900814056396, 0.24026945233345032, -0.0816592276096344, 0.20233584940433502, 0.2594786286354065, -0.1498810052871704, -0.143662229180336, 0.05220988392829895, 0.324139267206192, -0.18353773653507233, -0.1598464697599411, 0.0940418392419815, 0.1179804652929306, -0.02937648445367813, 0.41131383180618286, 0.10593948513269424, 0.29362452030181885, 0.07652464509010315, -0.0029621850699186325, -0.20294353365898132, -0.25731438398361206, -0.1122746467590332, 0.29711341857910156, 0.07714658230543137, -0.0792616605758667, -0.34441453218460083, -0.5765901803970337, -0.21008679270744324, -0.2234797179698944, -0.01731354370713234, 0.20111240446567535, -0.20623941719532013, 0.06300763040781021, -0.322112113237381, 0.16351425647735596, -0.04096712917089462, -0.1946389377117157, 0.26253676414489746, 0.40850216150283813, -0.1367611140012741, 0.3663032650947571, 0.22203406691551208, 0.30865055322647095, -0.06551961600780487, 0.09183594584465027, -0.16579130291938782, -0.19384533166885376, -0.43938228487968445, -0.19363373517990112, 0.12215709686279297, 0.020692940801382065, 0.4226630926132202, 0.3604982793331146, 0.17118945717811584, 0.04982418939471245, 0.4364659786224365, -0.01888733170926571, 0.3441031277179718, -0.4333568513393402, 0.3019137978553772, 0.19632750749588013, 0.06692636013031006, 0.08788417279720306, 0.05195486545562744, -0.10842468589544296, 0.31807011365890503, -0.34607768058776855, -0.324675589799881, 0.07825683057308197, 0.4352480471134186, -0.07008910179138184, -0.2963428497314453, -0.43285199999809265, -0.043451324105262756, 0.017112378031015396, -0.07315972447395325, 0.2993263602256775, 0.27074122428894043, -0.13664959371089935, -0.4509204626083374, 0.12474538385868073, -0.26679110527038574, -0.36393678188323975, -0.2063339501619339, -0.17330145835876465, -0.06718652695417404, 0.3976760506629944, 0.045541003346443176, -0.14657379686832428, 0.3997224271297455, 0.13360607624053955, 0.07056011259555817, -0.1733120083808899, 0.2856701612472534, -0.1283452808856964, 0.2019658386707306, 0.2914547026157379, 0.18617777526378632, 0.14958946406841278, -0.03401098772883415, 0.19623325765132904, -0.29310834407806396, 0.17752215266227722, -0.08113780617713928, -0.3907238245010376, 0.4085814356803894, 0.12511949241161346, 0.14084945619106293, 0.10772494971752167, -0.3138406574726105, 0.25920313596725464, 0.25852614641189575, -0.030015230178833008, 0.04513159394264221, 0.05232507735490799, -0.4399997293949127, -0.2966257929801941, 0.22958561778068542, 0.4328034520149231, -0.04445492848753929, -0.2657029330730438, 0.12835021317005157, -0.247264102101326, 0.1562025249004364, 0.4252067804336548, -0.15718115866184235, 0.08783763647079468, -0.42804357409477234, 0.48785459995269775, -0.10003899037837982, -0.056202828884124756, -0.23781481385231018, 0.3867220878601074, -0.134987011551857, 0.12896166741847992, 0.1673164665699005, 0.005485206842422485, 0.3296876847743988, -0.08374951779842377, -0.03678571805357933, 0.2454763650894165, -0.37850242853164673, 0.04658433794975281, -0.0966707393527031, -0.0618881992995739, -0.018112391233444214, 0.008853152394294739, -0.0665053129196167, 0.06981056928634644, -0.11870931088924408, -0.11651422083377838, 0.45474961400032043, -0.22391779720783234, 0.17099034786224365, 0.11495457589626312, 0.42049479484558105, -0.26009154319763184, 0.07425764203071594, -0.01759042963385582, -0.28834423422813416, 0.3158266544342041, -0.10992182791233063, -0.19382144510746002, 0.08319404721260071, -0.587949812412262, -0.13021725416183472, -0.07994325459003448, -0.13505208492279053, -0.3267778754234314, 0.1015511080622673, 0.04653560370206833, 0.2633609175682068, -0.41087114810943604, -0.2315790355205536, 0.06243867427110672, -0.5193099975585938, 0.007365748286247253, -0.2049274444580078, 0.08686953037977219, 0.19227635860443115, -0.1335848867893219, 0.026116229593753815, -0.04186263680458069, 0.14339183270931244, -0.45158758759498596, 0.1806902289390564, 0.3166401982307434, 0.27360522747039795, 0.0679309293627739, -0.08563859760761261, 0.15705277025699615, 0.295217365026474, 0.030183792114257812, -0.2225904017686844, -0.061903566122055054, -0.2613391578197479, -0.17027267813682556, -0.07477368414402008, 0.5797209739685059, -0.10486981272697449, 0.49478280544281006, -0.002281583845615387, 0.08639004081487656, 0.2522968351840973, 0.09709705412387848, -0.13375896215438843, -0.2023087441921234, -0.1346740424633026, -0.1242307722568512, 0.22980016469955444, 0.019526654854416847, -0.3496742248535156, 0.29640620946884155, 0.345297634601593, 0.18139418959617615, -0.06884936988353729, -0.09421996772289276, 0.07889609038829803, 0.04159080982208252, 0.2613242566585541, 0.1264755129814148, 0.36013656854629517, 0.18280290067195892, 0.11722994595766068, -0.062081001698970795, 0.04057469218969345, -0.1421172320842743, 0.09714757651090622, 0.08565560728311539, 0.2984278202056885, 0.1956746131181717, -0.34088844060897827, -0.29817306995391846, -0.370003879070282, -0.05016927421092987, 0.18087705969810486, -0.07162442058324814, -0.20503515005111694, 0.1587473452091217, -0.13565734028816223, -0.03630658984184265, -0.09147628396749496, 0.1922914981842041, -0.07240220904350281, -0.046259135007858276, 0.10043707489967346, 0.3691900074481964, -0.22866983711719513, 0.3138352632522583, 0.25452011823654175, 0.43922725319862366, -0.050480473786592484, 0.03676655888557434, -0.1458834707736969, -0.02882687933743, 0.03607950732111931, 0.09451010078191757, 0.18104681372642517, -0.046600520610809326, 0.43613895773887634, -0.2600601017475128, -0.19176076352596283, -0.4598686695098877, -0.10248790681362152, 0.2162511944770813, -0.23962651193141937, 0.22174179553985596, 0.07459736615419388, 0.014307007193565369, 0.05251733958721161, 0.08225850015878677, 0.15694864094257355, -0.21821433305740356, -0.13836291432380676, -0.21742840111255646, -0.11998233199119568, -0.08089053630828857, -0.02220337465405464, -0.313431054353714, 0.028133129701018333, -0.3462338149547577, 0.4397164583206177, -0.0030352771282196045, 0.28530222177505493, -0.1289585530757904, 0.13031840324401855, -0.1843489408493042, -0.06968729943037033, -0.1747622787952423, -0.12740030884742737, -0.28853654861450195, 0.06390490382909775, -0.4907034635543823, -0.27610090374946594, -0.05862339958548546, 0.11893729865550995, 0.35443314909935, 0.4739251434803009, -0.20236235857009888, -0.16849683225154877, -0.007058693096041679, -0.06652923673391342, 0.09033918380737305, -0.1795482486486435, 0.3311867415904999, -0.2571737766265869, -0.041656795889139175, -0.18406197428703308, -0.060537297278642654, 0.39646419882774353, -0.11349739134311676, -0.08757573366165161, 0.25364816188812256, 0.35804781317710876, 0.298844575881958, 0.8799726366996765, 0.7010261416435242, 0.07555939257144928, 0.262038916349411, -0.11516449600458145, 0.0946061909198761, -0.17874887585639954, 0.06025336682796478, 0.11438518017530441, -0.07261054217815399, -0.09863859415054321, 0.23788534104824066, -0.04955054074525833, -0.18316037952899933, 0.12702403962612152, 0.12657496333122253, 0.03150925785303116, -0.41780605912208557, 0.24474728107452393, 0.16873899102210999, 0.4238291084766388, 0.08784980326890945, 0.22502775490283966, 0.0714428573846817, 0.17322282493114471, 0.020257078111171722, -0.08743997663259506, 0.6392889022827148, -0.04642878845334053, -0.5310165286064148, 0.07663802057504654, -0.28312885761260986, 0.26482224464416504, 0.0032592937350273132, 0.2897103428840637, -0.20488516986370087, -0.125093474984169, 0.20412251353263855, 0.028764724731445312, 0.6561171412467957, -0.2043289691209793, -0.2633340060710907, 0.01951829344034195, -0.38599738478660583, -0.03449081629514694, -0.029302731156349182, -0.09826983511447906, 0.6185165047645569, 0.11225928366184235, 0.3165300190448761, -0.29850685596466064, -0.3578333258628845, 0.29214829206466675, -0.005687441676855087, -0.1392582505941391, -0.055658042430877686, -0.18408991396427155, -0.2773513197898865, -0.35643240809440613, 0.3470747768878937, 0.43351298570632935, 0.10674547404050827, -0.17574027180671692, -0.35525673627853394, -0.4579679071903229, -0.031104836612939835, -0.039597634226083755, 0.16769665479660034, 0.36700087785720825, -0.096128448843956, 0.31204697489738464, 0.31949129700660706, -0.03270181640982628, 0.2659883499145508, 0.4807182848453522, 0.05383499711751938, -0.1467876434326172, 0.3250400125980377, -0.21308743953704834, 0.22193637490272522, 0.567729651927948, -0.14287306368350983, 0.04848495498299599, -0.19253571331501007, 0.18661539256572723, -0.47705960273742676, -0.11181177198886871, 0.08019386231899261, 0.03345999866724014, -0.41616290807724, -0.30572599172592163, 0.2803391218185425, 0.16545064747333527, -0.10183831304311752, 0.5357622504234314, 0.40938040614128113, -0.28027379512786865, 0.4145693778991699, 0.2898399829864502, 0.723434329032898, -0.04951620101928711, -0.09540358930826187, 0.034345388412475586, 0.30660998821258545, 0.1514645665884018, -0.2992183566093445, 0.3841800093650818, -0.31093376874923706, -0.4508005976676941, 0.018934912979602814, -0.11484362185001373, 0.2845550775527954, 0.6228316426277161, 0.13021983206272125, 0.22423774003982544, 0.09989789128303528, 0.0017763546202331781, -0.27941790223121643, 0.19142498075962067, -0.04312620311975479, -0.3459373116493225, -0.04668248072266579, 0.1236870288848877, 0.008033773861825466, 0.32461875677108765, -0.13325707614421844, -0.09549355506896973, 0.18963441252708435, -0.0885695293545723, -0.17006312310695648, -0.26429158449172974, -0.2569517195224762, 0.1468575894832611, 0.05552208051085472, -0.29415759444236755, 0.04271393269300461, 0.09320159256458282, 0.314874529838562, -0.10657705366611481, -0.019300533458590508, 0.12314307689666748, -0.0559174083173275, -0.2480994313955307, -0.13763892650604248, -0.1824386715888977, 0.08877212554216385, -0.042199376970529556, -0.03795064985752106, -0.2840243875980377, 0.039555106312036514, -0.46485814452171326, -0.18148106336593628, 0.015941103920340538, -0.19473306834697723, -0.2180042415857315, -0.02837374620139599, 0.040130387991666794, -0.0646318644285202, -0.23741570115089417, 0.0905180424451828, -0.029202140867710114, -0.13457269966602325, 0.2709844708442688, 0.07758642733097076, -0.25448083877563477, -0.05254088342189789, -0.0012354515492916107, 0.005636462941765785, -0.057517990469932556, 0.07085937261581421, -0.10240894556045532, -0.10964751243591309, -0.24896591901779175, -0.05183001607656479, 0.1478797346353531, -0.39036309719085693, 0.31473803520202637, -0.3647530674934387, 0.19625547528266907, -0.104898601770401, 0.12462176382541656, 0.04817146062850952, 0.22375556826591492, -0.04020802676677704, -0.2838110327720642, -0.10980075597763062, 0.12238095700740814, -0.046044837683439255, 0.3557295799255371, 0.14157359302043915, -0.07228121161460876, -0.06466474384069443, 0.365362286567688, -0.3188988268375397, -0.1924319565296173, -0.1372956484556198, 0.2506164014339447, 0.15126483142375946, 0.15872378647327423, 0.05265185981988907, 0.02744411677122116, -0.0051904283463954926, 0.3547218441963196, -0.15545201301574707, -0.21687811613082886, -0.033517297357320786, 0.13924413919448853, 0.07309389114379883, 0.08582030236721039, 0.10097190737724304, 0.06738896667957306, -0.32409510016441345, -0.37598612904548645, 0.46309953927993774, -0.11533284187316895, 0.13021843135356903, -0.11858358979225159, 0.39769428968429565, 0.016780855134129524, -0.26131340861320496, 0.22029531002044678, 0.13150282204151154, -0.07026775181293488, 0.032734040170907974, 0.20175787806510925, -0.013056822121143341, -0.08096429705619812, 0.21099887788295746, 0.09699834883213043, 0.45774948596954346, 0.057273801416158676, -0.05661386623978615, 0.04980286583304405, 0.1465631127357483, 0.1453641951084137, 0.3655930757522583, 0.1955164670944214, -0.12481075525283813, 0.1359722912311554, -0.017776265740394592, 0.2657177746295929, -0.1633879542350769, -0.09154796600341797, 0.21069294214248657, 0.11762753874063492, 0.2903514504432678, 0.5855429172515869, 0.5930835008621216, 0.2964600920677185, 0.13688720762729645, 0.11301375925540924, 0.13785478472709656, -0.4564703106880188, 0.28990474343299866, 0.0630403459072113, -0.02127503603696823, 0.18267343938350677, 0.28755220770835876, 0.08803446590900421, 0.3605576157569885, 0.4113282859325409, -0.3580530881881714, 0.6952031254768372, 0.10552694648504257, 0.016259681433439255, 0.18171696364879608, -0.40998223423957825, -0.08214136213064194, 0.05772029608488083, 0.02981337159872055, 0.10316863656044006, -0.017585620284080505, 0.13993456959724426, -0.2176632434129715, -0.4585280418395996, -0.18168115615844727, 0.11790674179792404, -0.32444316148757935, -0.275562584400177, -0.35314977169036865, -0.04756204038858414, -0.32249125838279724, -0.018040552735328674, 0.007746754214167595, -0.24828675389289856, 0.4571482539176941, -0.11534619331359863, 0.05808026343584061, -0.20221169292926788, 0.1801702082157135, -0.0416240356862545, 0.29541516304016113, -0.3272460699081421, 0.06039326637983322, -0.14189781248569489, -0.046864625066518784, 0.0973900556564331, 0.12281573563814163, 0.16230860352516174, -0.05287071317434311, -0.07335159182548523, 0.30295512080192566, -0.04722012206912041, 0.07489460706710815, -0.1816738396883011, 0.0687093585729599, -0.19334833323955536, 0.03624066337943077, 0.27774778008461, 0.12085533887147903, -0.08427400887012482, -0.18392238020896912, 0.216853067278862, 0.1326800137758255, -0.3280528485774994, 0.3486025035381317, -0.304503858089447, -0.13721629977226257, 0.027860324829816818, 0.049521297216415405, -0.03665488213300705, -0.17526797950267792, 0.3990975022315979, -0.4332678020000458, 0.17944100499153137, 0.03047385811805725, 0.09627669304609299, -0.1476316601037979, 0.28505584597587585, -0.4368695616722107, -0.020724892616271973, -0.4190843105316162, -0.24189695715904236, -0.3341257572174072, -0.047317005693912506, -0.23296336829662323, 0.08912955969572067, 0.17821645736694336, 0.49561023712158203, 0.11921170353889465, 0.24518607556819916, -0.011152617633342743, -0.17275606095790863, 0.053974129259586334, 0.5531082153320312, -0.21144099533557892, -0.03149835765361786, -0.5865294337272644, 0.032340437173843384, 0.31358644366264343, -0.40981701016426086, 0.22173874080181122, 0.10499206185340881, -0.10686337202787399, -0.03998902067542076, 0.17583835124969482, 0.4528508484363556, -0.24770092964172363, 0.05223546177148819, 0.11812591552734375, 0.17219656705856323, -0.013445116579532623, 0.023172497749328613, -0.4308016300201416, -0.25075697898864746, -0.47496187686920166, 0.3588680624961853, 0.07048778980970383, 0.1069573163986206, -0.10374115407466888, -0.20774057507514954, -0.3645270764827728, 0.22831231355667114, 0.2551923990249634, 0.029551561921834946, -0.00017417967319488525, 0.3255910873413086, -0.29086947441101074, 0.15200337767601013, 0.39318203926086426, 0.36993715167045593, -0.011737801134586334, -0.1255667507648468, -0.17513057589530945, -0.5471757650375366, 0.35998156666755676, -0.33880406618118286, -0.15447449684143066, -0.05484174191951752, 0.2733842730522156, 0.32039380073547363, -0.32257571816444397, -0.35009801387786865, -0.22035375237464905, 0.29822999238967896, -0.2639874517917633, 0.1999802589416504, 0.23190584778785706, 0.14258860051631927, -0.3186661899089813, -0.11698707938194275, 0.10732150077819824, -0.00037735234946012497, -0.432789146900177, 0.1258898675441742, -0.4598280191421509 ]
https://github.com/huggingface/datasets/issues/5961
For now it's required to have a number of shards that is a factor of the number of GPUs to not have all the workers process the same data (and then skip the right ones to not end up training on duplicate data). It would be quite complex to implement a strategy that would utilize all the GPUs with an arbitrary number of shards even at the end of training
IterableDataset: split by node and map may preprocess samples that will be skipped anyway
There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_
70
IterableDataset: split by node and map may preprocess samples that will be skipped anyway There are two ways an iterable dataset can be split by node: 1. if the number of shards is a factor of number of GPUs: in that case the shards are evenly distributed per GPU 2. otherwise, each GPU iterate on the data and at the end keeps 1 sample out of n(GPUs) - skipping the others. In case 2. it's therefore possible to have the same examples passed to `prepare_dataset` for each GPU. This doesn't sound optimized though, because it runs the preprocessing on samples that won't be used in the end. Could you open a new issue so that we can discuss about this and find a solution ? _Originally posted by @lhoestq in https://github.com/huggingface/datasets/issues/5360#issuecomment-1592729051_ For now it's required to have a number of shards that is a factor of the number of GPUs to not have all the workers process the same data (and then skip the right ones to not end up training on duplicate data). It would be quite complex to implement a strategy that would utilize all the GPUs with an arbitrary number of shards even at the end of training
[ -0.4646584987640381, -0.3735218346118927, -0.0920911431312561, 0.15261659026145935, 0.11911855638027191, -0.04775995761156082, 0.4881906807422638, 0.25509804487228394, -0.039605945348739624, 0.1438959836959839, 0.09474242478609085, 0.3893817067146301, 0.10234491527080536, 0.3299868702888489, 0.025464333593845367, -0.11257008463144302, -0.01936255395412445, 0.17508858442306519, -0.1935591995716095, -0.04135141521692276, -0.17074045538902283, 0.21253205835819244, -0.08814740180969238, -0.1794581264257431, -0.4704786539077759, -0.1424933522939682, 0.03876327723264694, -0.03193410485982895, 0.214351624250412, -0.3092426061630249, 0.20210665464401245, 0.231975257396698, 0.02925056591629982, 0.3052625060081482, -0.00010595210187602788, 0.22739732265472412, -0.0784379318356514, -0.1622389554977417, -0.1584438681602478, 0.05304834619164467, -0.09212372452020645, 0.0632789134979248, -0.4020407199859619, -0.19380809366703033, -0.4203411936759949, -0.16699808835983276, 0.07059630751609802, -0.3308749198913574, 0.29403939843177795, -0.05968312546610832, 0.2038937211036682, 0.2211599200963974, -0.21493476629257202, -0.0732947438955307, -0.07223933935165405, 0.19204768538475037, -0.1744057685136795, -0.13546675443649292, 0.06296990066766739, 0.07788685709238052, -0.03866099193692207, 0.410906046628952, 0.19054904580116272, 0.2907123267650604, 0.03940921276807785, 0.007666841149330139, -0.12817376852035522, -0.28435641527175903, -0.12942185997962952, 0.19696056842803955, -0.027520086616277695, -0.0678979903459549, -0.29525482654571533, -0.5961698293685913, -0.14358335733413696, -0.30397090315818787, -0.00899866595864296, 0.2363901436328888, -0.10506124049425125, 0.02733112871646881, -0.36430343985557556, 0.18800950050354004, -0.05833929404616356, -0.2208143174648285, 0.2574820816516876, 0.3252783417701721, -0.10864076763391495, 0.2973373830318451, 0.2730691432952881, 0.3764985203742981, -0.036846235394477844, 0.11122789978981018, -0.0425722599029541, -0.16437125205993652, -0.4458569884300232, -0.25189751386642456, 0.05392025411128998, 0.03198520839214325, 0.38925066590309143, 0.240983247756958, 0.07352738827466965, 0.12044326961040497, 0.4494038224220276, 0.04027896374464035, 0.26912641525268555, -0.43087705969810486, 0.17228922247886658, 0.0438740998506546, -0.00015662796795368195, 0.010807156562805176, -0.13564956188201904, -0.0745515376329422, 0.3014540672302246, -0.29924920201301575, -0.312605619430542, 0.008974209427833557, 0.35820671916007996, 0.027526378631591797, -0.22362782061100006, -0.3837769329547882, -0.09938482940196991, 0.033301468938589096, -0.09143701195716858, 0.2973322868347168, 0.16625820100307465, -0.11935250461101532, -0.45300883054733276, 0.05276194214820862, -0.25887781381607056, -0.37560999393463135, -0.20718717575073242, -0.1394556760787964, -0.1832837164402008, 0.4223698377609253, 0.09392227232456207, -0.2543185353279114, 0.43262428045272827, 0.13183839619159698, -0.0009570848196744919, -0.17915914952754974, 0.37268710136413574, -0.1789255142211914, 0.17356827855110168, 0.19286181032657623, 0.17606346309185028, 0.08135734498500824, -0.08206157386302948, 0.17178238928318024, -0.2553364336490631, 0.0512222945690155, -0.06290607154369354, -0.4621618986129761, 0.4241853356361389, 0.1553644835948944, 0.06956276297569275, 0.08003479242324829, -0.30870282649993896, 0.2365417182445526, 0.31845349073410034, 0.06654024124145508, 0.016577396541833878, -0.04365915805101395, -0.5199800729751587, -0.18525934219360352, 0.1800585240125656, 0.3559413552284241, -0.00565183162689209, -0.2801204323768616, 0.24540719389915466, -0.1396407186985016, 0.1264391839504242, 0.4502682685852051, -0.20375898480415344, 0.12414676696062088, -0.36262476444244385, 0.47626179456710815, -0.08721505105495453, 0.007112063467502594, -0.20014797151088715, 0.34834572672843933, -0.11501295119524002, 0.10644721239805222, 0.15375807881355286, -0.04251926764845848, 0.323161780834198, -0.1187482476234436, -0.13673408329486847, 0.28414472937583923, -0.3337998688220978, -0.007272116839885712, -0.16807454824447632, -0.04596903175115585, -0.0460171177983284, 0.08413615822792053, 0.012826190330088139, 0.02274545654654503, -0.1751653105020523, -0.1974673718214035, 0.4475470781326294, -0.21877992153167725, 0.1920231580734253, 0.028389424085617065, 0.26529067754745483, -0.07647260278463364, 0.10252361744642258, 0.028590582311153412, -0.2277815192937851, 0.306073933839798, -0.060902100056409836, -0.110305055975914, 0.20453983545303345, -0.5329282879829407, -0.08271510154008865, -0.1355956792831421, -0.20641039311885834, -0.30182814598083496, 0.11883977055549622, 0.07234292477369308, 0.2225853055715561, -0.41366517543792725, -0.19951876997947693, 0.08660335838794708, -0.6116563677787781, 0.000874202698469162, -0.21986161172389984, 0.13305705785751343, 0.12445350736379623, -0.06488332152366638, -0.023150451481342316, 0.06957894563674927, 0.032235946506261826, -0.5056183338165283, 0.2826851010322571, 0.2286330759525299, 0.24073868989944458, 0.09244036674499512, -0.03793172165751457, 0.25515443086624146, 0.2821570336818695, 0.08473316580057144, -0.24822327494621277, -0.055048368871212006, -0.17978431284427643, -0.15307199954986572, -0.025935865938663483, 0.5224043726921082, 0.0013892152346670628, 0.3995853066444397, 0.010696783661842346, 0.06000525504350662, 0.236271932721138, 0.024924948811531067, -0.15981478989124298, -0.08536140620708466, -0.14690735936164856, -0.19079327583312988, 0.18328382074832916, 0.1603204607963562, -0.475172221660614, 0.22418765723705292, 0.3985399305820465, 0.18564514815807343, -0.04140958935022354, -0.19834600389003754, 0.055488474667072296, 0.06501857936382294, 0.1862526834011078, 0.131306454539299, 0.357405424118042, 0.17528970539569855, 0.19827024638652802, -0.04399481415748596, -0.007841534912586212, -0.17383691668510437, 0.027770861983299255, 0.05161472409963608, 0.33153295516967773, 0.1453581601381302, -0.3557678461074829, -0.32438960671424866, -0.3666157126426697, -0.07891035079956055, 0.2670959532260895, -0.04403019696474075, -0.15475982427597046, 0.18427854776382446, -0.09460729360580444, -0.014064565300941467, -0.20443755388259888, 0.21069003641605377, 0.04853960499167442, -0.013807535171508789, 0.1513122022151947, 0.44546404480934143, -0.17533347010612488, 0.37748023867607117, 0.2395538091659546, 0.49469512701034546, -0.12152189016342163, 0.061348192393779755, -0.11332453787326813, 0.011549253016710281, 0.0657171905040741, 0.12639355659484863, 0.2764799892902374, -0.14911605417728424, 0.3371879458427429, -0.15167555212974548, -0.33638590574264526, -0.41080379486083984, -0.051948972046375275, 0.1721455156803131, -0.22019197046756744, 0.12021955847740173, -0.014943186193704605, -0.10123132914304733, 0.00013018399477005005, 0.07196304202079773, 0.07958383113145828, -0.2918386459350586, -0.10506231337785721, -0.23248112201690674, -0.13313204050064087, -0.035348761826753616, -0.08629044890403748, -0.38968169689178467, -0.022934066131711006, -0.30836111307144165, 0.4828628599643707, 0.06573759019374847, 0.2593778073787689, -0.05811580270528793, 0.15897876024246216, -0.2586207091808319, -0.05927946791052818, -0.1778945028781891, -0.2365117073059082, -0.3556006848812103, 0.11361001431941986, -0.4543139636516571, -0.30734679102897644, -0.041248075664043427, 0.03129243105649948, 0.47146138548851013, 0.4726073145866394, -0.2584288716316223, -0.20184344053268433, 0.0387447252869606, -0.10064581781625748, 0.08895115554332733, -0.14833952486515045, 0.3239710032939911, -0.23270994424819946, -0.03488544374704361, -0.09461742639541626, 0.024225711822509766, 0.4084523022174835, -0.03487255796790123, -0.054043062031269073, 0.15547826886177063, 0.310741662979126, 0.31750887632369995, 0.9548544883728027, 0.6218075156211853, -0.036047663539648056, 0.20348848402500153, -0.12612564861774445, 0.0683293491601944, -0.13396906852722168, 0.08971703797578812, 0.14184550940990448, -0.1593468189239502, -0.06144742667675018, 0.2112347036600113, -0.10086886584758759, -0.23370036482810974, 0.1608349233865738, 0.1459934115409851, 0.04020360857248306, -0.4362544119358063, 0.3119473159313202, 0.1257619857788086, 0.4652280807495117, 0.12288163602352142, 0.29832175374031067, 0.1089407354593277, 0.17860552668571472, 0.07631891965866089, -0.16776853799819946, 0.6127808690071106, -0.04484107345342636, -0.48049652576446533, 0.0473739355802536, -0.261839359998703, 0.14129310846328735, -0.04470592364668846, 0.26572176814079285, -0.09853361546993256, -0.17909938097000122, 0.16636070609092712, 0.12030003219842911, 0.6770153045654297, -0.16713494062423706, -0.20092158019542694, -0.042718373239040375, -0.4593386650085449, 0.009371042251586914, -0.039575643837451935, -0.07276320457458496, 0.46488797664642334, 0.1345474123954773, 0.35958626866340637, -0.2189660519361496, -0.36667129397392273, 0.26669245958328247, -0.1319735199213028, -0.16910508275032043, 0.004683345556259155, -0.1689261794090271, -0.23034346103668213, -0.3070704936981201, 0.4312976002693176, 0.38113313913345337, 0.077594093978405, -0.2039284110069275, -0.2792413532733917, -0.43079128861427307, -0.047521546483039856, 0.04467065632343292, 0.2852877974510193, 0.2267169952392578, -0.06973050534725189, 0.29572877287864685, 0.3543314039707184, -0.054559048265218735, 0.16367948055267334, 0.40173104405403137, 0.03636863827705383, -0.09889916330575943, 0.29682448506355286, -0.19546644389629364, 0.30219006538391113, 0.5110889673233032, -0.05835602432489395, 0.052181925624608994, -0.20259198546409607, 0.18873539566993713, -0.48250386118888855, -0.021125085651874542, 0.11130784451961517, 0.10767881572246552, -0.3529070317745209, -0.4057677984237671, 0.20767958462238312, 0.1319296956062317, -0.04372982680797577, 0.3961874544620514, 0.2949121594429016, -0.21563765406608582, 0.3440443277359009, 0.3232114315032959, 0.6880879402160645, 0.005530543625354767, -0.024256518110632896, 0.07640163600444794, 0.28133684396743774, 0.20321586728096008, -0.3719313144683838, 0.4987390339374542, -0.3174961507320404, -0.43257975578308105, 0.040830060839653015, -0.15997323393821716, 0.11397679895162582, 0.5890534520149231, 0.1866135597229004, 0.26560142636299133, 0.20676101744174957, 0.04487656056880951, -0.29078274965286255, 0.22001969814300537, -0.09389905631542206, -0.3498164713382721, -0.031091254204511642, 0.1306268274784088, 0.06714992225170135, 0.30369263887405396, -0.16108940541744232, -0.08517630398273468, 0.26209962368011475, 0.03125897794961929, -0.006984993815422058, -0.22530865669250488, -0.2084043025970459, 0.19079002737998962, 0.09149188548326492, -0.3087039589881897, 0.10887543112039566, 0.11379705369472504, 0.2894982099533081, -0.1843222826719284, 0.017138054594397545, 0.07020077109336853, -0.11786877363920212, -0.23205794394016266, -0.11569684743881226, -0.17968444526195526, 0.14422324299812317, -0.0456538088619709, 0.005916759371757507, -0.23969900608062744, 0.1331581324338913, -0.4303220510482788, -0.20049457252025604, 0.03773197531700134, -0.23022422194480896, -0.2360251098871231, 0.055306416004896164, 0.17091034352779388, -0.1768818199634552, -0.21563568711280823, 0.12192656099796295, -0.07051639258861542, -0.27991703152656555, 0.4080745577812195, 0.02726641297340393, -0.23605415225028992, -0.034792862832546234, -0.02713911235332489, 0.09434312582015991, 0.03834601491689682, 0.18998295068740845, -0.05972578749060631, -0.03022070601582527, -0.2555824816226959, -0.15091609954833984, 0.2723172903060913, -0.4140305519104004, 0.2614995837211609, -0.3388020992279053, 0.15786372125148773, -0.11912460625171661, 0.05272555351257324, 0.07546693086624146, 0.25355109572410583, -0.1066284328699112, -0.2052631825208664, -0.106326624751091, 0.10307663679122925, -0.024280890822410583, 0.38888314366340637, 0.14101895689964294, 0.1271589994430542, -0.05436503887176514, 0.4157770574092865, -0.34028732776641846, -0.08379198610782623, -0.21097388863563538, 0.3031471073627472, 0.14409035444259644, -0.004944260232150555, 0.10335573554039001, 0.02220723405480385, 0.010954480618238449, 0.3511503040790558, -0.19977226853370667, -0.24709466099739075, -0.006124276667833328, 0.08844539523124695, 0.11319795250892639, 0.10929703712463379, 0.0704452320933342, 0.15388968586921692, -0.30433389544487, -0.345661461353302, 0.3616517186164856, -0.14328835904598236, 0.09196987748146057, -0.0842234194278717, 0.45381540060043335, 0.04888847470283508, -0.22285743057727814, 0.10014015436172485, 0.13833653926849365, -0.1292601227760315, 0.12868638336658478, 0.207670658826828, 0.03363047540187836, -0.031560905277729034, 0.2725239098072052, 0.0952623263001442, 0.4545668065547943, -0.015958113595843315, -0.02966625615954399, -0.03381296247243881, 0.09056030958890915, 0.14172270894050598, 0.3731379210948944, 0.29874247312545776, -0.11785655468702316, 0.0375746414065361, 0.09383059293031693, 0.3007858693599701, -0.16079124808311462, -0.15114548802375793, 0.23943379521369934, 0.10455389320850372, 0.2863558828830719, 0.581899881362915, 0.5915328860282898, 0.26353996992111206, 0.02614923007786274, 0.16246601939201355, 0.022096239030361176, -0.5701472759246826, 0.24813923239707947, -0.047634780406951904, -0.11878406256437302, 0.08878545463085175, 0.33733999729156494, 0.1210579127073288, 0.27923956513404846, 0.37193718552589417, -0.2820935845375061, 0.7299982905387878, 0.04530081897974014, -0.05251434072852135, 0.1552204191684723, -0.2943384647369385, -0.21811969578266144, 0.0687689483165741, -0.030453287065029144, 0.09180602431297302, -0.09326678514480591, 0.1441149264574051, -0.19560456275939941, -0.47699233889579773, -0.10404442995786667, 0.0749741941690445, -0.37445980310440063, -0.1648993343114853, -0.3588756322860718, 0.008764341473579407, -0.27118051052093506, 0.03809677064418793, 0.008845686912536621, -0.3504575490951538, 0.5030322670936584, -0.08750064671039581, -0.043271854519844055, -0.042128369212150574, 0.14811423420906067, 0.07698331773281097, 0.35551658272743225, -0.2727181911468506, 0.02269570715725422, -0.2034902423620224, -0.04746579751372337, -0.02025279402732849, 0.09435880929231644, 0.12288513779640198, -0.1417372077703476, -0.04804692789912224, 0.308666855096817, 0.03739273175597191, 0.09552724659442902, -0.2400779277086258, 0.10772517323493958, -0.11150400340557098, -0.017382323741912842, 0.32929322123527527, 0.12491565942764282, -0.0803457647562027, -0.19796282052993774, 0.21379345655441284, 0.07142576575279236, -0.3229876458644867, 0.26338738203048706, -0.1707983911037445, -0.17634332180023193, -0.014321450144052505, 0.1317480355501175, -0.016053810715675354, -0.11170930415391922, 0.4315755069255829, -0.3941892981529236, 0.1660088449716568, 0.016396623104810715, 0.10506676137447357, -0.10006959736347198, 0.33634984493255615, -0.37803736329078674, 0.005704596173018217, -0.43892037868499756, -0.2378348410129547, -0.26872682571411133, -0.013786561787128448, -0.2723225951194763, 0.18179135024547577, 0.07472359389066696, 0.5725484490394592, 0.06413967162370682, 0.18447177112102509, -0.10000157356262207, -0.18516099452972412, 0.09397263824939728, 0.5212671756744385, -0.18781088292598724, -0.04293675348162651, -0.568861186504364, -0.002750348299741745, 0.312885582447052, -0.29243677854537964, 0.23846854269504547, 0.03920406103134155, -0.061431486159563065, 0.04932617396116257, 0.171843022108078, 0.3508399426937103, -0.2141501009464264, 0.07190989702939987, 0.058356113731861115, 0.09833948314189911, 0.015819936990737915, 0.08352977782487869, -0.4303295612335205, -0.20535704493522644, -0.5746203660964966, 0.266876757144928, 0.08666574209928513, 0.004330426454544067, -0.11455327272415161, -0.15274696052074432, -0.3144620656967163, 0.17289811372756958, 0.2797793745994568, 0.09732306003570557, 0.07319869846105576, 0.2573978900909424, -0.2522541284561157, 0.2020246386528015, 0.34286829829216003, 0.460511177778244, 0.0006939917802810669, -0.2607722282409668, -0.19463050365447998, -0.42551425099372864, 0.35748642683029175, -0.3486267328262329, -0.22075584530830383, -0.237163707613945, 0.2735811769962311, 0.34863805770874023, -0.2548482120037079, -0.3436134457588196, -0.2688451111316681, 0.23839540779590607, -0.26833415031433105, 0.11378037929534912, 0.28352710604667664, 0.1846715807914734, -0.2788950204849243, -0.11241868138313293, 0.048725660890340805, -0.030120113864541054, -0.38834619522094727, 0.11550714075565338, -0.535810112953186 ]
https://github.com/huggingface/datasets/issues/5955
This is the actual error: ``` Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values ``` Which means some samples are incorrectly formatted. PyArrow, a storage backend that we use under the hood, requires that all the list elements have the same level of nesting (same number of dimensions) or are `None`. ```python import pyarrow as pa pa.array([[1, 2, 3], 2]) # ArrowInvalid: cannot mix list and non-list, non-null values pa.array([[1, 2, 3], [2]]) # works ```
Strange bug in loading local JSON files, using load_dataset
### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ```
84
Strange bug in loading local JSON files, using load_dataset ### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ``` This is the actual error: ``` Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values ``` Which means some samples are incorrectly formatted. PyArrow, a storage backend that we use under the hood, requires that all the list elements have the same level of nesting (same number of dimensions) or are `None`. ```python import pyarrow as pa pa.array([[1, 2, 3], 2]) # ArrowInvalid: cannot mix list and non-list, non-null values pa.array([[1, 2, 3], [2]]) # works ```
[ -0.1079191341996193, -0.09877710044384003, -0.04527151584625244, 0.54625403881073, 0.23800578713417053, 0.10583063960075378, 0.32995471358299255, 0.41471725702285767, 0.433463454246521, 0.18027374148368835, 0.30697494745254517, 0.3544989824295044, 0.08857817947864532, -0.13640546798706055, -0.10547174513339996, -0.06744220852851868, 0.08452761173248291, -0.009547073394060135, 0.014520485885441303, 0.07071082293987274, -0.34990575909614563, 0.06102985888719559, -0.20450155436992645, -0.047745175659656525, -0.14177332818508148, 0.456112802028656, 0.09776952117681503, 0.14341068267822266, 0.07637789100408554, -0.4001111388206482, 0.12195799499750137, -0.47540849447250366, 0.06789159774780273, 0.5858675241470337, -0.00011682184413075447, 0.13605442643165588, 0.6783233284950256, 0.016895771026611328, -0.45205506682395935, -0.34284862875938416, -0.30446237325668335, -0.42408597469329834, 0.22811347246170044, -0.21921315789222717, 0.10351432114839554, -0.3238019347190857, -0.26198863983154297, -0.532680332660675, 0.27518340945243835, 0.33649954199790955, 0.16198065876960754, -0.17517468333244324, 0.0019384250044822693, -0.04449054226279259, 0.22735115885734558, 0.26910892128944397, 0.09584030508995056, 0.3530004620552063, 0.21918782591819763, 0.12218631058931351, -0.003486666828393936, -0.09438666701316833, 0.023179970681667328, 0.08170858025550842, 0.1781877875328064, -0.15594932436943054, -0.15521232783794403, 0.024081092327833176, 0.20960412919521332, 0.24085532128810883, 0.5802986025810242, -0.2011922299861908, -0.3243646025657654, -0.40753650665283203, -0.10639861971139908, -0.08411029726266861, 0.27893513441085815, 0.18959708511829376, -0.022231638431549072, 0.14058487117290497, -0.24186350405216217, 0.1748257875442505, -0.07088546454906464, 0.10007838904857635, -0.2621647119522095, -0.017503470182418823, -0.1680758148431778, 0.3591461777687073, -0.0687277764081955, -0.1880148947238922, -0.0033193938434123993, -0.18155571818351746, -0.09315060079097748, 0.31341952085494995, -0.22802169620990753, -0.005759984254837036, 0.2764889597892761, -0.22606296837329865, 0.3616534173488617, -0.15366487205028534, 0.10326924920082092, -0.2195126712322235, -0.10564391314983368, 0.2535768151283264, 0.5166653990745544, 0.15541130304336548, 0.16945712268352509, -0.17517408728599548, -0.022446483373641968, 0.06617669761180878, -0.17772018909454346, -0.060757603496313095, 0.07890382409095764, -0.29153895378112793, -0.025204602628946304, -0.10552167892456055, 0.18609541654586792, -0.27407634258270264, 0.01065351814031601, 0.41428810358047485, -0.5187078714370728, 0.057124797254800797, 0.18781214952468872, -0.039950642734766006, -0.12934139370918274, 0.4571419060230255, 0.05867701768875122, 0.16285371780395508, -0.20908217132091522, -0.10218282043933868, -0.13426312804222107, -0.10120513290166855, -0.01784401386976242, -0.29239651560783386, 0.23574888706207275, -0.02498234435915947, 0.14047537744045258, 0.009001962840557098, -0.047144919633865356, -0.3391082286834717, 0.09165649116039276, -0.17600701749324799, -0.06431220471858978, 0.4126504063606262, -0.1781090497970581, -0.060130760073661804, 0.04438324272632599, -0.25068897008895874, -0.1839781403541565, 0.2994746267795563, -0.3287240266799927, -0.2757090628147125, -0.04525196924805641, 0.18523329496383667, -0.2471529245376587, 0.41317304968833923, -0.251520037651062, -0.008032566867768764, 0.08731848001480103, -0.011639170348644257, 0.1714886873960495, -0.2828485369682312, -0.3545953631401062, -0.1260121911764145, 0.05013585090637207, 0.49000346660614014, -0.5150169730186462, 0.015782013535499573, -0.1990775465965271, -0.07543673366308212, 0.03138475865125656, 0.15129753947257996, -0.4056980311870575, 0.20333506166934967, -0.2758890986442566, 0.2955041229724884, 0.10537617653608322, -0.2899070680141449, -0.2744746208190918, 0.628449559211731, -0.3398343622684479, 0.2481864094734192, -0.1884147822856903, -0.1305938959121704, -0.03554704785346985, -0.04318184405565262, 0.7023758888244629, 0.40164199471473694, 0.09302074462175369, 0.16899430751800537, -0.3032596707344055, -0.10869989544153214, 0.15982219576835632, 0.12916110455989838, -0.3595907390117645, 0.031744055449962616, 0.33334606885910034, 0.3403533399105072, 0.2321377396583557, 0.22617530822753906, 0.10956926643848419, 0.33413732051849365, -0.1894966959953308, 0.04336915165185928, 0.2227603793144226, 0.18624350428581238, -0.47161829471588135, 0.19654454290866852, -0.10153766721487045, -0.2664129137992859, -0.054763197898864746, 0.05143986642360687, -0.38339778780937195, 0.41789957880973816, -0.013375407084822655, 0.19073224067687988, 0.04631020128726959, -0.059533603489398956, 0.18924455344676971, 0.2541414201259613, 0.25838515162467957, -0.012400204315781593, -0.20948193967342377, -0.10126052051782608, -0.5174551010131836, 0.10001885890960693, 0.18153104186058044, 0.05179217457771301, -0.18810886144638062, -0.009161774069070816, 0.0877334326505661, -0.13377124071121216, -0.3926655650138855, 0.29208746552467346, 0.36812010407447815, -0.0784335732460022, -0.34173980355262756, -0.02421070635318756, 0.15174022316932678, 0.049466341733932495, 0.23342524468898773, 0.28102028369903564, 0.3487604856491089, -0.15535546839237213, -0.2595699429512024, 0.13254299759864807, -0.1513134241104126, 0.29351288080215454, -0.3074585199356079, -0.3368366062641144, 0.37776973843574524, 0.011276908218860626, -0.05424676835536957, -0.07576765865087509, 0.24848823249340057, 0.2617456316947937, 0.27581822872161865, 0.12630249559879303, -0.0453999787569046, -0.15200471878051758, 0.19443243741989136, -0.18023404479026794, -0.07577352225780487, 0.3541575074195862, -0.052485764026641846, -0.08029438555240631, 0.02853085659444332, 0.05740895867347717, 0.5992541313171387, 0.011760517954826355, 0.07117792963981628, -0.07052295655012131, 0.25145092606544495, -0.3064150810241699, 0.0065401047468185425, 0.011825848370790482, 0.14923587441444397, 0.47324201464653015, 0.5296697616577148, -0.043731726706027985, -0.14843767881393433, -0.2799704074859619, 0.02521747350692749, 0.15300197899341583, -0.22629213333129883, 0.3112896680831909, -0.1947728544473648, -0.02614181488752365, -0.112749844789505, 0.014286722987890244, -0.20607012510299683, -0.14626044034957886, -0.19480839371681213, 0.0223431047052145, -0.3662615418434143, -0.2674672305583954, 0.055482856929302216, 0.05968841165304184, 0.2176438719034195, -0.39140784740448, -0.04101008176803589, 0.017548806965351105, -0.18421223759651184, -0.12480045109987259, 0.21992573142051697, -0.15896767377853394, -0.11626705527305603, 0.055730246007442474, -0.3040270507335663, 0.10620418190956116, -0.19211998581886292, 0.09171733260154724, 0.19365158677101135, 0.323455274105072, 0.07201123982667923, 0.1660037636756897, 0.1154526025056839, 0.11685876548290253, 0.22598882019519806, 0.17603138089179993, -0.16081877052783966, 0.29255664348602295, 0.2645043134689331, 0.22278577089309692, -0.3538368344306946, -0.15751652419567108, -0.1330312341451645, -0.42587509751319885, 0.6776131391525269, 0.0801193118095398, -0.03815116360783577, 0.05892260745167732, 0.2922886312007904, 0.2399677187204361, 0.2733137607574463, -0.002740330994129181, -0.2403624951839447, -0.2591283321380615, 0.016068734228610992, -0.14876225590705872, -0.3684868812561035, -0.12845584750175476, 0.001106753945350647, -0.2621197998523712, -0.06901048868894577, -0.6554127931594849, 0.19015419483184814, -0.14623872935771942, 0.1025533676147461, -0.21862995624542236, -0.2560800313949585, 0.2467140257358551, -0.2855611741542816, 0.07256096601486206, -0.1995972841978073, -0.18265527486801147, -0.028990209102630615, 0.14139151573181152, 0.16821779310703278, 0.13539135456085205, 0.4939875304698944, -0.22657930850982666, -0.11280675232410431, 0.08481201529502869, 0.022724516689777374, 0.35303840041160583, -0.07585309445858002, 0.1539028286933899, -0.6227381825447083, 0.09833519160747528, 0.04990267753601074, 0.04074915871024132, -0.492927223443985, 0.2160109281539917, 0.10285857319831848, -0.16366662085056305, -0.12622353434562683, -0.30846577882766724, -0.21601569652557373, -0.13806745409965515, 0.13939169049263, -0.12041468918323517, -0.2162484973669052, 0.04287765920162201, -0.0005500763654708862, 0.028065800666809082, -0.05288344621658325, -0.2862222492694855, -0.03606640547513962, 0.0998276025056839, 0.03618994355201721, -0.28741708397865295, -0.12745192646980286, -0.18863770365715027, 0.24812911450862885, 0.15046602487564087, 0.5074335932731628, -0.034886643290519714, -0.11625191569328308, 0.08839161694049835, -0.11740144342184067, 0.7648217082023621, -0.027556121349334717, 0.4414243698120117, 0.317099392414093, 0.11626292765140533, -0.4480665326118469, -0.10654748976230621, 0.18743619322776794, 0.23905456066131592, 0.1960403323173523, 0.3915334641933441, 0.03317597508430481, 0.10147887468338013, 0.02215445041656494, 0.5069687366485596, -0.08772032707929611, -0.4126244783401489, -0.23431523144245148, -0.2182304561138153, -0.11141316592693329, -0.11715038865804672, 0.12769566476345062, 0.45710259675979614, -0.04436499625444412, -0.12136270105838776, -0.09601639211177826, -0.0980275347828865, -0.2339448183774948, -0.04855160042643547, 0.1887359470129013, -0.15570473670959473, 0.3411085307598114, -0.03588990867137909, 0.18849068880081177, 0.33934178948402405, 0.5511676073074341, 0.17839345335960388, -0.2552833557128906, 0.18381057679653168, -0.13874231278896332, 0.012210112065076828, 0.08504403382539749, -0.05889590457081795, -0.11099401116371155, 0.0003353618085384369, 0.17163676023483276, -0.2965015769004822, 0.08579817414283752, 0.15572220087051392, -0.10386364161968231, -0.21476279199123383, -0.21238327026367188, 0.6556914448738098, -0.12132614105939865, 0.07814906537532806, 0.3743993937969208, -0.4152477979660034, -0.2207876741886139, 0.302200585603714, -0.20720863342285156, 0.5385361909866333, 0.1146925836801529, -0.09799858927726746, 0.07873443514108658, -0.23044022917747498, 0.31877851486206055, -0.366737425327301, -0.07802332937717438, -0.2695873975753784, 0.23576267063617706, 0.17038747668266296, -0.1989785134792328, -0.026089325547218323, 0.3439415991306305, 0.14282214641571045, -0.08874597400426865, -0.3534877896308899, -0.23081502318382263, -0.18093854188919067, 0.25262635946273804, -0.1242578774690628, -0.1331184208393097, -0.45791715383529663, 0.10602568835020065, -0.11105488240718842, 0.150013267993927, -0.03112689219415188, 0.11077196896076202, -0.039367400109767914, -0.4260411858558655, -0.25789716839790344, 0.16815809905529022, 0.13477084040641785, 0.028582550585269928, 0.2422015368938446, -0.09263619780540466, 0.06834625452756882, 0.16735945641994476, -0.36422908306121826, 0.37182706594467163, -0.20612896978855133, -0.006218358874320984, -0.3226373493671417, 0.09313242137432098, 0.16491641104221344, 0.06103593856096268, 0.0914052203297615, 0.10596248507499695, -0.1950775682926178, -0.14112403988838196, -0.36492469906806946, -0.15498721599578857, 0.18217964470386505, 0.4824652075767517, -0.01357266865670681, -0.20325006544589996, -0.2026030719280243, -0.19683295488357544, 0.2231622040271759, -0.0002664923667907715, 0.09323130548000336, 0.08738139271736145, -0.13734473288059235, -0.1034374088048935, -0.1484062373638153, -0.5106779932975769, -0.05316825583577156, 0.5137205719947815, 0.06502941250801086, -0.12513720989227295, 0.2820632755756378, 0.329397052526474, 0.019348978996276855, -0.13184306025505066, 0.38891327381134033, 0.1352872997522354, -0.2482883185148239, 0.32175785303115845, -0.1809285581111908, 0.1779872477054596, -0.31449079513549805, 0.08598779141902924, -0.043535664677619934, -0.016924474388360977, 0.2455103099346161, -0.6977630853652954, -0.3289809226989746, 0.15442052483558655, -0.005834435112774372, -0.023021169006824493, 0.20833644270896912, -0.08238723874092102, 0.08490708470344543, -0.191864013671875, -0.1759977489709854, 0.1494654417037964, -0.2276686429977417, 0.2091168314218521, -0.08171766996383667, 0.11455613374710083, 0.16769616305828094, -0.12875498831272125, 0.07477661222219467, 0.24057643115520477, -0.03354367986321449, -0.22096459567546844, -0.2655715346336365, 0.10978126525878906, 0.1855902373790741, -0.0660247951745987, -0.13492292165756226, -0.36142924427986145, -0.04122497886419296, -0.0893746018409729, 0.037947751581668854, 0.07007057964801788, -0.1027635931968689, 0.05688587203621864, 0.3957133889198303, 0.28951478004455566, 0.09751443564891815, 0.43220797181129456, 0.07240550965070724, 0.5258294343948364, -0.07998323440551758, 0.28788667917251587, 0.09411537647247314, 0.18881207704544067, -0.6049803495407104, 0.010440165176987648, -0.21039409935474396, 0.2604297995567322, 0.18364562094211578, -0.30805468559265137, 0.2958095967769623, 0.18048429489135742, 0.23868437111377716, 0.380392462015152, -0.4163108170032501, 0.00997169315814972, 0.00158768892288208, 0.10369348526000977, 0.022282853722572327, -0.32697680592536926, 0.34352701902389526, 0.21052424609661102, -0.17718009650707245, 0.04840024560689926, -0.049017854034900665, -0.32335513830184937, -0.3614594042301178, 0.15887995064258575, 0.2714894115924835, 0.27669745683670044, -0.06876258552074432, 0.6148406267166138, -0.18809300661087036, 0.014928578399121761, -0.10535562038421631, 0.15505658090114594, 0.41553211212158203, 0.5874577164649963, 0.12707485258579254, -0.09973669052124023, 0.09058685600757599, 0.2350609004497528, -0.42459726333618164, -0.5100788474082947, 0.3898005783557892, 0.4795421361923218, -0.14312167465686798, 0.22008799016475677, 0.1530127376317978, -0.02923695743083954, 0.033253755420446396, 0.23226673901081085, 0.009952202439308167, -0.02667401172220707, -0.07482485473155975, -0.20061513781547546, -0.1151776909828186, -0.03949829190969467, -0.03354821354150772, 0.15003171563148499, 0.06431405246257782, 0.21205084025859833, 0.1895688772201538, 0.17438848316669464, -0.26524946093559265, -0.15997350215911865, 0.4140821099281311, 0.09756636619567871, -0.010167799890041351, -0.4699559211730957, 0.12507951259613037, 0.29923832416534424, -0.09768328070640564, 0.44551849365234375, -0.10967462509870529, 0.3141118884086609, 0.4573271572589874, -0.0566997192800045, -0.02491813525557518, -0.06094193086028099, 0.06168591231107712, -0.19805079698562622, 0.5180256962776184, -0.07402830570936203, 0.03919914364814758, 0.37434375286102295, 0.0962570533156395, -0.07380013167858124, 0.3352934420108795, 0.33263251185417175, 0.1533837765455246, -0.3477022051811218, 0.019798995926976204, -0.22140781581401825, -0.11236993968486786, -0.34475940465927124, -0.00048075243830680847, -0.14275899529457092, -0.1281222701072693, 0.18901364505290985, 0.16506601870059967, 0.1944686472415924, -0.08909910172224045, 0.051829744130373, -0.372367262840271, 0.4878212511539459, 0.2022443562746048, 0.0476091243326664, 0.019631028175354004, -0.055354297161102295, -0.32254448533058167, 0.10867337882518768, -0.42590370774269104, 0.16200107336044312, 0.3262230455875397, 0.1485372632741928, -0.132751002907753, 0.08141251653432846, -0.22409209609031677, 0.16854827105998993, -0.2773902714252472, 0.09164905548095703, -0.025960445404052734, -0.7420276403427124, 0.1122170239686966, -0.03985775262117386, 0.08690313249826431, -0.4605216979980469, 0.2215259075164795, -0.41794225573539734, -0.04202760010957718, -0.17016670107841492, -0.0799986720085144, -0.1073138415813446, 0.15116949379444122, 0.35857918858528137, 0.1872296929359436, 0.02876437082886696, 0.09024392813444138, -0.04118920490145683, -0.2564046084880829, -0.1267082542181015, -0.13117587566375732, 0.3650962710380554, -0.06163325160741806, 0.2149147093296051, -0.29783210158348083, 0.12937529385089874, -0.007942549884319305, 0.09831157326698303, -0.16139011085033417, -0.13929100334644318, -0.2904249429702759, -0.09346190840005875, -0.33609169721603394, 0.2540903091430664, -0.08193832635879517, 0.13373024761676788, 0.005742710083723068, 0.2724475860595703, 0.14746299386024475, -0.21520894765853882, 0.3609536588191986, -0.3529355525970459, -0.20826497673988342, 0.20780155062675476, 0.15313604474067688, -0.2542553246021271, -0.35568752884864807, -0.2642309069633484, 0.18071407079696655, 0.572973906993866, 0.04903421923518181, -0.2596609592437744, 0.02229216694831848, -0.197586789727211, -0.14539533853530884, -0.07175005972385406, 0.10187496244907379, 0.18945592641830444, 0.042481474578380585, 0.3455488383769989, -0.14231982827186584 ]
https://github.com/huggingface/datasets/issues/5955
@mariosasko I used the same operation to check the original data before and after slicing. This is reflected in my code. 160000 is not a specific number. I can also get output using 150000. This doesn't seem to align very well with what you said. Because if only some sample formats are incorrect. So there should be an error in one of the front and back slices. thank you for your reply.
Strange bug in loading local JSON files, using load_dataset
### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ```
72
Strange bug in loading local JSON files, using load_dataset ### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ``` @mariosasko I used the same operation to check the original data before and after slicing. This is reflected in my code. 160000 is not a specific number. I can also get output using 150000. This doesn't seem to align very well with what you said. Because if only some sample formats are incorrect. So there should be an error in one of the front and back slices. thank you for your reply.
[ -0.1079191341996193, -0.09877710044384003, -0.04527151584625244, 0.54625403881073, 0.23800578713417053, 0.10583063960075378, 0.32995471358299255, 0.41471725702285767, 0.433463454246521, 0.18027374148368835, 0.30697494745254517, 0.3544989824295044, 0.08857817947864532, -0.13640546798706055, -0.10547174513339996, -0.06744220852851868, 0.08452761173248291, -0.009547073394060135, 0.014520485885441303, 0.07071082293987274, -0.34990575909614563, 0.06102985888719559, -0.20450155436992645, -0.047745175659656525, -0.14177332818508148, 0.456112802028656, 0.09776952117681503, 0.14341068267822266, 0.07637789100408554, -0.4001111388206482, 0.12195799499750137, -0.47540849447250366, 0.06789159774780273, 0.5858675241470337, -0.00011682184413075447, 0.13605442643165588, 0.6783233284950256, 0.016895771026611328, -0.45205506682395935, -0.34284862875938416, -0.30446237325668335, -0.42408597469329834, 0.22811347246170044, -0.21921315789222717, 0.10351432114839554, -0.3238019347190857, -0.26198863983154297, -0.532680332660675, 0.27518340945243835, 0.33649954199790955, 0.16198065876960754, -0.17517468333244324, 0.0019384250044822693, -0.04449054226279259, 0.22735115885734558, 0.26910892128944397, 0.09584030508995056, 0.3530004620552063, 0.21918782591819763, 0.12218631058931351, -0.003486666828393936, -0.09438666701316833, 0.023179970681667328, 0.08170858025550842, 0.1781877875328064, -0.15594932436943054, -0.15521232783794403, 0.024081092327833176, 0.20960412919521332, 0.24085532128810883, 0.5802986025810242, -0.2011922299861908, -0.3243646025657654, -0.40753650665283203, -0.10639861971139908, -0.08411029726266861, 0.27893513441085815, 0.18959708511829376, -0.022231638431549072, 0.14058487117290497, -0.24186350405216217, 0.1748257875442505, -0.07088546454906464, 0.10007838904857635, -0.2621647119522095, -0.017503470182418823, -0.1680758148431778, 0.3591461777687073, -0.0687277764081955, -0.1880148947238922, -0.0033193938434123993, -0.18155571818351746, -0.09315060079097748, 0.31341952085494995, -0.22802169620990753, -0.005759984254837036, 0.2764889597892761, -0.22606296837329865, 0.3616534173488617, -0.15366487205028534, 0.10326924920082092, -0.2195126712322235, -0.10564391314983368, 0.2535768151283264, 0.5166653990745544, 0.15541130304336548, 0.16945712268352509, -0.17517408728599548, -0.022446483373641968, 0.06617669761180878, -0.17772018909454346, -0.060757603496313095, 0.07890382409095764, -0.29153895378112793, -0.025204602628946304, -0.10552167892456055, 0.18609541654586792, -0.27407634258270264, 0.01065351814031601, 0.41428810358047485, -0.5187078714370728, 0.057124797254800797, 0.18781214952468872, -0.039950642734766006, -0.12934139370918274, 0.4571419060230255, 0.05867701768875122, 0.16285371780395508, -0.20908217132091522, -0.10218282043933868, -0.13426312804222107, -0.10120513290166855, -0.01784401386976242, -0.29239651560783386, 0.23574888706207275, -0.02498234435915947, 0.14047537744045258, 0.009001962840557098, -0.047144919633865356, -0.3391082286834717, 0.09165649116039276, -0.17600701749324799, -0.06431220471858978, 0.4126504063606262, -0.1781090497970581, -0.060130760073661804, 0.04438324272632599, -0.25068897008895874, -0.1839781403541565, 0.2994746267795563, -0.3287240266799927, -0.2757090628147125, -0.04525196924805641, 0.18523329496383667, -0.2471529245376587, 0.41317304968833923, -0.251520037651062, -0.008032566867768764, 0.08731848001480103, -0.011639170348644257, 0.1714886873960495, -0.2828485369682312, -0.3545953631401062, -0.1260121911764145, 0.05013585090637207, 0.49000346660614014, -0.5150169730186462, 0.015782013535499573, -0.1990775465965271, -0.07543673366308212, 0.03138475865125656, 0.15129753947257996, -0.4056980311870575, 0.20333506166934967, -0.2758890986442566, 0.2955041229724884, 0.10537617653608322, -0.2899070680141449, -0.2744746208190918, 0.628449559211731, -0.3398343622684479, 0.2481864094734192, -0.1884147822856903, -0.1305938959121704, -0.03554704785346985, -0.04318184405565262, 0.7023758888244629, 0.40164199471473694, 0.09302074462175369, 0.16899430751800537, -0.3032596707344055, -0.10869989544153214, 0.15982219576835632, 0.12916110455989838, -0.3595907390117645, 0.031744055449962616, 0.33334606885910034, 0.3403533399105072, 0.2321377396583557, 0.22617530822753906, 0.10956926643848419, 0.33413732051849365, -0.1894966959953308, 0.04336915165185928, 0.2227603793144226, 0.18624350428581238, -0.47161829471588135, 0.19654454290866852, -0.10153766721487045, -0.2664129137992859, -0.054763197898864746, 0.05143986642360687, -0.38339778780937195, 0.41789957880973816, -0.013375407084822655, 0.19073224067687988, 0.04631020128726959, -0.059533603489398956, 0.18924455344676971, 0.2541414201259613, 0.25838515162467957, -0.012400204315781593, -0.20948193967342377, -0.10126052051782608, -0.5174551010131836, 0.10001885890960693, 0.18153104186058044, 0.05179217457771301, -0.18810886144638062, -0.009161774069070816, 0.0877334326505661, -0.13377124071121216, -0.3926655650138855, 0.29208746552467346, 0.36812010407447815, -0.0784335732460022, -0.34173980355262756, -0.02421070635318756, 0.15174022316932678, 0.049466341733932495, 0.23342524468898773, 0.28102028369903564, 0.3487604856491089, -0.15535546839237213, -0.2595699429512024, 0.13254299759864807, -0.1513134241104126, 0.29351288080215454, -0.3074585199356079, -0.3368366062641144, 0.37776973843574524, 0.011276908218860626, -0.05424676835536957, -0.07576765865087509, 0.24848823249340057, 0.2617456316947937, 0.27581822872161865, 0.12630249559879303, -0.0453999787569046, -0.15200471878051758, 0.19443243741989136, -0.18023404479026794, -0.07577352225780487, 0.3541575074195862, -0.052485764026641846, -0.08029438555240631, 0.02853085659444332, 0.05740895867347717, 0.5992541313171387, 0.011760517954826355, 0.07117792963981628, -0.07052295655012131, 0.25145092606544495, -0.3064150810241699, 0.0065401047468185425, 0.011825848370790482, 0.14923587441444397, 0.47324201464653015, 0.5296697616577148, -0.043731726706027985, -0.14843767881393433, -0.2799704074859619, 0.02521747350692749, 0.15300197899341583, -0.22629213333129883, 0.3112896680831909, -0.1947728544473648, -0.02614181488752365, -0.112749844789505, 0.014286722987890244, -0.20607012510299683, -0.14626044034957886, -0.19480839371681213, 0.0223431047052145, -0.3662615418434143, -0.2674672305583954, 0.055482856929302216, 0.05968841165304184, 0.2176438719034195, -0.39140784740448, -0.04101008176803589, 0.017548806965351105, -0.18421223759651184, -0.12480045109987259, 0.21992573142051697, -0.15896767377853394, -0.11626705527305603, 0.055730246007442474, -0.3040270507335663, 0.10620418190956116, -0.19211998581886292, 0.09171733260154724, 0.19365158677101135, 0.323455274105072, 0.07201123982667923, 0.1660037636756897, 0.1154526025056839, 0.11685876548290253, 0.22598882019519806, 0.17603138089179993, -0.16081877052783966, 0.29255664348602295, 0.2645043134689331, 0.22278577089309692, -0.3538368344306946, -0.15751652419567108, -0.1330312341451645, -0.42587509751319885, 0.6776131391525269, 0.0801193118095398, -0.03815116360783577, 0.05892260745167732, 0.2922886312007904, 0.2399677187204361, 0.2733137607574463, -0.002740330994129181, -0.2403624951839447, -0.2591283321380615, 0.016068734228610992, -0.14876225590705872, -0.3684868812561035, -0.12845584750175476, 0.001106753945350647, -0.2621197998523712, -0.06901048868894577, -0.6554127931594849, 0.19015419483184814, -0.14623872935771942, 0.1025533676147461, -0.21862995624542236, -0.2560800313949585, 0.2467140257358551, -0.2855611741542816, 0.07256096601486206, -0.1995972841978073, -0.18265527486801147, -0.028990209102630615, 0.14139151573181152, 0.16821779310703278, 0.13539135456085205, 0.4939875304698944, -0.22657930850982666, -0.11280675232410431, 0.08481201529502869, 0.022724516689777374, 0.35303840041160583, -0.07585309445858002, 0.1539028286933899, -0.6227381825447083, 0.09833519160747528, 0.04990267753601074, 0.04074915871024132, -0.492927223443985, 0.2160109281539917, 0.10285857319831848, -0.16366662085056305, -0.12622353434562683, -0.30846577882766724, -0.21601569652557373, -0.13806745409965515, 0.13939169049263, -0.12041468918323517, -0.2162484973669052, 0.04287765920162201, -0.0005500763654708862, 0.028065800666809082, -0.05288344621658325, -0.2862222492694855, -0.03606640547513962, 0.0998276025056839, 0.03618994355201721, -0.28741708397865295, -0.12745192646980286, -0.18863770365715027, 0.24812911450862885, 0.15046602487564087, 0.5074335932731628, -0.034886643290519714, -0.11625191569328308, 0.08839161694049835, -0.11740144342184067, 0.7648217082023621, -0.027556121349334717, 0.4414243698120117, 0.317099392414093, 0.11626292765140533, -0.4480665326118469, -0.10654748976230621, 0.18743619322776794, 0.23905456066131592, 0.1960403323173523, 0.3915334641933441, 0.03317597508430481, 0.10147887468338013, 0.02215445041656494, 0.5069687366485596, -0.08772032707929611, -0.4126244783401489, -0.23431523144245148, -0.2182304561138153, -0.11141316592693329, -0.11715038865804672, 0.12769566476345062, 0.45710259675979614, -0.04436499625444412, -0.12136270105838776, -0.09601639211177826, -0.0980275347828865, -0.2339448183774948, -0.04855160042643547, 0.1887359470129013, -0.15570473670959473, 0.3411085307598114, -0.03588990867137909, 0.18849068880081177, 0.33934178948402405, 0.5511676073074341, 0.17839345335960388, -0.2552833557128906, 0.18381057679653168, -0.13874231278896332, 0.012210112065076828, 0.08504403382539749, -0.05889590457081795, -0.11099401116371155, 0.0003353618085384369, 0.17163676023483276, -0.2965015769004822, 0.08579817414283752, 0.15572220087051392, -0.10386364161968231, -0.21476279199123383, -0.21238327026367188, 0.6556914448738098, -0.12132614105939865, 0.07814906537532806, 0.3743993937969208, -0.4152477979660034, -0.2207876741886139, 0.302200585603714, -0.20720863342285156, 0.5385361909866333, 0.1146925836801529, -0.09799858927726746, 0.07873443514108658, -0.23044022917747498, 0.31877851486206055, -0.366737425327301, -0.07802332937717438, -0.2695873975753784, 0.23576267063617706, 0.17038747668266296, -0.1989785134792328, -0.026089325547218323, 0.3439415991306305, 0.14282214641571045, -0.08874597400426865, -0.3534877896308899, -0.23081502318382263, -0.18093854188919067, 0.25262635946273804, -0.1242578774690628, -0.1331184208393097, -0.45791715383529663, 0.10602568835020065, -0.11105488240718842, 0.150013267993927, -0.03112689219415188, 0.11077196896076202, -0.039367400109767914, -0.4260411858558655, -0.25789716839790344, 0.16815809905529022, 0.13477084040641785, 0.028582550585269928, 0.2422015368938446, -0.09263619780540466, 0.06834625452756882, 0.16735945641994476, -0.36422908306121826, 0.37182706594467163, -0.20612896978855133, -0.006218358874320984, -0.3226373493671417, 0.09313242137432098, 0.16491641104221344, 0.06103593856096268, 0.0914052203297615, 0.10596248507499695, -0.1950775682926178, -0.14112403988838196, -0.36492469906806946, -0.15498721599578857, 0.18217964470386505, 0.4824652075767517, -0.01357266865670681, -0.20325006544589996, -0.2026030719280243, -0.19683295488357544, 0.2231622040271759, -0.0002664923667907715, 0.09323130548000336, 0.08738139271736145, -0.13734473288059235, -0.1034374088048935, -0.1484062373638153, -0.5106779932975769, -0.05316825583577156, 0.5137205719947815, 0.06502941250801086, -0.12513720989227295, 0.2820632755756378, 0.329397052526474, 0.019348978996276855, -0.13184306025505066, 0.38891327381134033, 0.1352872997522354, -0.2482883185148239, 0.32175785303115845, -0.1809285581111908, 0.1779872477054596, -0.31449079513549805, 0.08598779141902924, -0.043535664677619934, -0.016924474388360977, 0.2455103099346161, -0.6977630853652954, -0.3289809226989746, 0.15442052483558655, -0.005834435112774372, -0.023021169006824493, 0.20833644270896912, -0.08238723874092102, 0.08490708470344543, -0.191864013671875, -0.1759977489709854, 0.1494654417037964, -0.2276686429977417, 0.2091168314218521, -0.08171766996383667, 0.11455613374710083, 0.16769616305828094, -0.12875498831272125, 0.07477661222219467, 0.24057643115520477, -0.03354367986321449, -0.22096459567546844, -0.2655715346336365, 0.10978126525878906, 0.1855902373790741, -0.0660247951745987, -0.13492292165756226, -0.36142924427986145, -0.04122497886419296, -0.0893746018409729, 0.037947751581668854, 0.07007057964801788, -0.1027635931968689, 0.05688587203621864, 0.3957133889198303, 0.28951478004455566, 0.09751443564891815, 0.43220797181129456, 0.07240550965070724, 0.5258294343948364, -0.07998323440551758, 0.28788667917251587, 0.09411537647247314, 0.18881207704544067, -0.6049803495407104, 0.010440165176987648, -0.21039409935474396, 0.2604297995567322, 0.18364562094211578, -0.30805468559265137, 0.2958095967769623, 0.18048429489135742, 0.23868437111377716, 0.380392462015152, -0.4163108170032501, 0.00997169315814972, 0.00158768892288208, 0.10369348526000977, 0.022282853722572327, -0.32697680592536926, 0.34352701902389526, 0.21052424609661102, -0.17718009650707245, 0.04840024560689926, -0.049017854034900665, -0.32335513830184937, -0.3614594042301178, 0.15887995064258575, 0.2714894115924835, 0.27669745683670044, -0.06876258552074432, 0.6148406267166138, -0.18809300661087036, 0.014928578399121761, -0.10535562038421631, 0.15505658090114594, 0.41553211212158203, 0.5874577164649963, 0.12707485258579254, -0.09973669052124023, 0.09058685600757599, 0.2350609004497528, -0.42459726333618164, -0.5100788474082947, 0.3898005783557892, 0.4795421361923218, -0.14312167465686798, 0.22008799016475677, 0.1530127376317978, -0.02923695743083954, 0.033253755420446396, 0.23226673901081085, 0.009952202439308167, -0.02667401172220707, -0.07482485473155975, -0.20061513781547546, -0.1151776909828186, -0.03949829190969467, -0.03354821354150772, 0.15003171563148499, 0.06431405246257782, 0.21205084025859833, 0.1895688772201538, 0.17438848316669464, -0.26524946093559265, -0.15997350215911865, 0.4140821099281311, 0.09756636619567871, -0.010167799890041351, -0.4699559211730957, 0.12507951259613037, 0.29923832416534424, -0.09768328070640564, 0.44551849365234375, -0.10967462509870529, 0.3141118884086609, 0.4573271572589874, -0.0566997192800045, -0.02491813525557518, -0.06094193086028099, 0.06168591231107712, -0.19805079698562622, 0.5180256962776184, -0.07402830570936203, 0.03919914364814758, 0.37434375286102295, 0.0962570533156395, -0.07380013167858124, 0.3352934420108795, 0.33263251185417175, 0.1533837765455246, -0.3477022051811218, 0.019798995926976204, -0.22140781581401825, -0.11236993968486786, -0.34475940465927124, -0.00048075243830680847, -0.14275899529457092, -0.1281222701072693, 0.18901364505290985, 0.16506601870059967, 0.1944686472415924, -0.08909910172224045, 0.051829744130373, -0.372367262840271, 0.4878212511539459, 0.2022443562746048, 0.0476091243326664, 0.019631028175354004, -0.055354297161102295, -0.32254448533058167, 0.10867337882518768, -0.42590370774269104, 0.16200107336044312, 0.3262230455875397, 0.1485372632741928, -0.132751002907753, 0.08141251653432846, -0.22409209609031677, 0.16854827105998993, -0.2773902714252472, 0.09164905548095703, -0.025960445404052734, -0.7420276403427124, 0.1122170239686966, -0.03985775262117386, 0.08690313249826431, -0.4605216979980469, 0.2215259075164795, -0.41794225573539734, -0.04202760010957718, -0.17016670107841492, -0.0799986720085144, -0.1073138415813446, 0.15116949379444122, 0.35857918858528137, 0.1872296929359436, 0.02876437082886696, 0.09024392813444138, -0.04118920490145683, -0.2564046084880829, -0.1267082542181015, -0.13117587566375732, 0.3650962710380554, -0.06163325160741806, 0.2149147093296051, -0.29783210158348083, 0.12937529385089874, -0.007942549884319305, 0.09831157326698303, -0.16139011085033417, -0.13929100334644318, -0.2904249429702759, -0.09346190840005875, -0.33609169721603394, 0.2540903091430664, -0.08193832635879517, 0.13373024761676788, 0.005742710083723068, 0.2724475860595703, 0.14746299386024475, -0.21520894765853882, 0.3609536588191986, -0.3529355525970459, -0.20826497673988342, 0.20780155062675476, 0.15313604474067688, -0.2542553246021271, -0.35568752884864807, -0.2642309069633484, 0.18071407079696655, 0.572973906993866, 0.04903421923518181, -0.2596609592437744, 0.02229216694831848, -0.197586789727211, -0.14539533853530884, -0.07175005972385406, 0.10187496244907379, 0.18945592641830444, 0.042481474578380585, 0.3455488383769989, -0.14231982827186584 ]
https://github.com/huggingface/datasets/issues/5955
Our JSON loader does the following in your case: ```python import json import pyarrow as pa with open(file, encoding="utf-8") as f: dataset = json.load(f) keys = set().union(*[row.keys() for row in dataset]) mapping = {col: [row.get(col) for row in dataset] for col in keys} pa_table = pa.Table.from_pydict(mapping) # the ArrowInvalid error comes from here ``` So if this code throws an error with correctly-formatted JSON, then this is an Arrow bug and should be reported in their repo. > I used the same operation to check the original data before and after slicing. This is reflected in my code. 160000 is not a specific number. I can also get output using 150000. This doesn't seem to align very well with what you said. Because if only some sample formats are incorrect. So there should be an error in one of the front and back slices. You should shuffle the data to make sure that's not the case
Strange bug in loading local JSON files, using load_dataset
### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ```
156
Strange bug in loading local JSON files, using load_dataset ### Describe the bug I am using 'load_dataset 'loads a JSON file, but I found a strange bug: an error will be reported when the length of the JSON file exceeds 160000 (uncertain exact number). I have checked the data through the following code and there are no issues. So I cannot determine the true reason for this error. The data is a list containing a dictionary. As follows: [ {'input': 'someting...', 'target': 'someting...', 'type': 'someting...', 'history': ['someting...', ...]}, ... ] ### Steps to reproduce the bug ``` import json from datasets import load_dataset path = "target.json" temp_path = "temp.json" with open(path, "r") as f: data = json.load(f) print(f"\n-------the JSON file length is: {len(data)}-------\n") with open(temp_path, "w") as f: json.dump(data[:160000], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works when the JSON file length is 160000-------\n") with open(temp_path, "w") as f: json.dump(data[160000:], f) dataset = load_dataset("json", data_files=temp_path) print("\n-------This works and eliminates data issues-------\n") with open(temp_path, "w") as f: json.dump(data[:170000], f) dataset = load_dataset("json", data_files=temp_path) ``` ### Expected behavior ``` -------the JSON file length is: 173049------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3328.81it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 639.47it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-acf3c7f418c5f4b4/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 265.85it/s] -------This works when the JSON file length is 160000------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 2038.05it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 794.83it/s] Dataset json downloaded and prepared to /root/.cache/huggingface/datasets/json/default-a42f04b263ceea6a/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4. Subsequent calls will reuse this data. 100%|████████████████████████████████████████████| 1/1 [00:00<00:00, 681.00it/s] -------This works and eliminates data issues------- Downloading and preparing dataset json/default to /root/.cache/huggingface/datasets/json/default-63f391c89599c7b0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 100%|███████████████████| 1/1 [00:00<00:00, 3682.44it/s] Extracting data files: 100%|█████████████████████| 1/1 [00:00<00:00, 788.70it/s] Generating train split: 0 examples [00:00, ? examples/s]Failed to read file '/home/lakala/hjc/code/pycode/glm/temp.json' with error <class 'pyarrow.lib.ArrowInvalid'>: cannot mix list and non-list, non-null values Traceback (most recent call last): File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1858, in _prepare_split_single for _, table in generator: File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/packaged_modules/json/json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at /home/lakala/hjc/code/pycode/glm/temp.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/lakala/hjc/code/pycode/glm/test.py", line 22, in <module> dataset = load_dataset("json", data_files=temp_path) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/lakala/conda/envs/glm/lib/python3.8/site-packages/datasets/builder.py", line 1891, 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 ``` ### Environment info ``` Ubuntu==22.04 python==3.8 pytorch-transformers==1.2.0 transformers== 4.27.1 datasets==2.12.0 numpy==1.24.3 pandas==1.5.3 ``` Our JSON loader does the following in your case: ```python import json import pyarrow as pa with open(file, encoding="utf-8") as f: dataset = json.load(f) keys = set().union(*[row.keys() for row in dataset]) mapping = {col: [row.get(col) for row in dataset] for col in keys} pa_table = pa.Table.from_pydict(mapping) # the ArrowInvalid error comes from here ``` So if this code throws an error with correctly-formatted JSON, then this is an Arrow bug and should be reported in their repo. > I used the same operation to check the original data before and after slicing. This is reflected in my code. 160000 is not a specific number. I can also get output using 150000. This doesn't seem to align very well with what you said. Because if only some sample formats are incorrect. So there should be an error in one of the front and back slices. You should shuffle the data to make sure that's not the case
[ -0.1079191341996193, -0.09877710044384003, -0.04527151584625244, 0.54625403881073, 0.23800578713417053, 0.10583063960075378, 0.32995471358299255, 0.41471725702285767, 0.433463454246521, 0.18027374148368835, 0.30697494745254517, 0.3544989824295044, 0.08857817947864532, -0.13640546798706055, -0.10547174513339996, -0.06744220852851868, 0.08452761173248291, -0.009547073394060135, 0.014520485885441303, 0.07071082293987274, -0.34990575909614563, 0.06102985888719559, -0.20450155436992645, -0.047745175659656525, -0.14177332818508148, 0.456112802028656, 0.09776952117681503, 0.14341068267822266, 0.07637789100408554, -0.4001111388206482, 0.12195799499750137, -0.47540849447250366, 0.06789159774780273, 0.5858675241470337, -0.00011682184413075447, 0.13605442643165588, 0.6783233284950256, 0.016895771026611328, -0.45205506682395935, -0.34284862875938416, -0.30446237325668335, -0.42408597469329834, 0.22811347246170044, -0.21921315789222717, 0.10351432114839554, -0.3238019347190857, -0.26198863983154297, -0.532680332660675, 0.27518340945243835, 0.33649954199790955, 0.16198065876960754, -0.17517468333244324, 0.0019384250044822693, -0.04449054226279259, 0.22735115885734558, 0.26910892128944397, 0.09584030508995056, 0.3530004620552063, 0.21918782591819763, 0.12218631058931351, -0.003486666828393936, -0.09438666701316833, 0.023179970681667328, 0.08170858025550842, 0.1781877875328064, -0.15594932436943054, -0.15521232783794403, 0.024081092327833176, 0.20960412919521332, 0.24085532128810883, 0.5802986025810242, -0.2011922299861908, -0.3243646025657654, -0.40753650665283203, -0.10639861971139908, -0.08411029726266861, 0.27893513441085815, 0.18959708511829376, -0.022231638431549072, 0.14058487117290497, -0.24186350405216217, 0.1748257875442505, -0.07088546454906464, 0.10007838904857635, -0.2621647119522095, -0.017503470182418823, -0.1680758148431778, 0.3591461777687073, -0.0687277764081955, -0.1880148947238922, -0.0033193938434123993, -0.18155571818351746, -0.09315060079097748, 0.31341952085494995, -0.22802169620990753, -0.005759984254837036, 0.2764889597892761, -0.22606296837329865, 0.3616534173488617, -0.15366487205028534, 0.10326924920082092, -0.2195126712322235, -0.10564391314983368, 0.2535768151283264, 0.5166653990745544, 0.15541130304336548, 0.16945712268352509, -0.17517408728599548, -0.022446483373641968, 0.06617669761180878, -0.17772018909454346, -0.060757603496313095, 0.07890382409095764, -0.29153895378112793, -0.025204602628946304, -0.10552167892456055, 0.18609541654586792, -0.27407634258270264, 0.01065351814031601, 0.41428810358047485, -0.5187078714370728, 0.057124797254800797, 0.18781214952468872, -0.039950642734766006, -0.12934139370918274, 0.4571419060230255, 0.05867701768875122, 0.16285371780395508, -0.20908217132091522, -0.10218282043933868, -0.13426312804222107, -0.10120513290166855, -0.01784401386976242, -0.29239651560783386, 0.23574888706207275, -0.02498234435915947, 0.14047537744045258, 0.009001962840557098, -0.047144919633865356, -0.3391082286834717, 0.09165649116039276, -0.17600701749324799, -0.06431220471858978, 0.4126504063606262, -0.1781090497970581, -0.060130760073661804, 0.04438324272632599, -0.25068897008895874, -0.1839781403541565, 0.2994746267795563, -0.3287240266799927, -0.2757090628147125, -0.04525196924805641, 0.18523329496383667, -0.2471529245376587, 0.41317304968833923, -0.251520037651062, -0.008032566867768764, 0.08731848001480103, -0.011639170348644257, 0.1714886873960495, -0.2828485369682312, -0.3545953631401062, -0.1260121911764145, 0.05013585090637207, 0.49000346660614014, -0.5150169730186462, 0.015782013535499573, -0.1990775465965271, -0.07543673366308212, 0.03138475865125656, 0.15129753947257996, -0.4056980311870575, 0.20333506166934967, -0.2758890986442566, 0.2955041229724884, 0.10537617653608322, -0.2899070680141449, -0.2744746208190918, 0.628449559211731, -0.3398343622684479, 0.2481864094734192, -0.1884147822856903, -0.1305938959121704, -0.03554704785346985, -0.04318184405565262, 0.7023758888244629, 0.40164199471473694, 0.09302074462175369, 0.16899430751800537, -0.3032596707344055, -0.10869989544153214, 0.15982219576835632, 0.12916110455989838, -0.3595907390117645, 0.031744055449962616, 0.33334606885910034, 0.3403533399105072, 0.2321377396583557, 0.22617530822753906, 0.10956926643848419, 0.33413732051849365, -0.1894966959953308, 0.04336915165185928, 0.2227603793144226, 0.18624350428581238, -0.47161829471588135, 0.19654454290866852, -0.10153766721487045, -0.2664129137992859, -0.054763197898864746, 0.05143986642360687, -0.38339778780937195, 0.41789957880973816, -0.013375407084822655, 0.19073224067687988, 0.04631020128726959, -0.059533603489398956, 0.18924455344676971, 0.2541414201259613, 0.25838515162467957, -0.012400204315781593, -0.20948193967342377, -0.10126052051782608, -0.5174551010131836, 0.10001885890960693, 0.18153104186058044, 0.05179217457771301, -0.18810886144638062, -0.009161774069070816, 0.0877334326505661, -0.13377124071121216, -0.3926655650138855, 0.29208746552467346, 0.36812010407447815, -0.0784335732460022, -0.34173980355262756, -0.02421070635318756, 0.15174022316932678, 0.049466341733932495, 0.23342524468898773, 0.28102028369903564, 0.3487604856491089, -0.15535546839237213, -0.2595699429512024, 0.13254299759864807, -0.1513134241104126, 0.29351288080215454, -0.3074585199356079, -0.3368366062641144, 0.37776973843574524, 0.011276908218860626, -0.05424676835536957, -0.07576765865087509, 0.24848823249340057, 0.2617456316947937, 0.27581822872161865, 0.12630249559879303, -0.0453999787569046, -0.15200471878051758, 0.19443243741989136, -0.18023404479026794, -0.07577352225780487, 0.3541575074195862, -0.052485764026641846, -0.08029438555240631, 0.02853085659444332, 0.05740895867347717, 0.5992541313171387, 0.011760517954826355, 0.07117792963981628, -0.07052295655012131, 0.25145092606544495, -0.3064150810241699, 0.0065401047468185425, 0.011825848370790482, 0.14923587441444397, 0.47324201464653015, 0.5296697616577148, -0.043731726706027985, -0.14843767881393433, -0.2799704074859619, 0.02521747350692749, 0.15300197899341583, -0.22629213333129883, 0.3112896680831909, -0.1947728544473648, -0.02614181488752365, -0.112749844789505, 0.014286722987890244, -0.20607012510299683, -0.14626044034957886, -0.19480839371681213, 0.0223431047052145, -0.3662615418434143, -0.2674672305583954, 0.055482856929302216, 0.05968841165304184, 0.2176438719034195, -0.39140784740448, -0.04101008176803589, 0.017548806965351105, -0.18421223759651184, -0.12480045109987259, 0.21992573142051697, -0.15896767377853394, -0.11626705527305603, 0.055730246007442474, -0.3040270507335663, 0.10620418190956116, -0.19211998581886292, 0.09171733260154724, 0.19365158677101135, 0.323455274105072, 0.07201123982667923, 0.1660037636756897, 0.1154526025056839, 0.11685876548290253, 0.22598882019519806, 0.17603138089179993, -0.16081877052783966, 0.29255664348602295, 0.2645043134689331, 0.22278577089309692, -0.3538368344306946, -0.15751652419567108, -0.1330312341451645, -0.42587509751319885, 0.6776131391525269, 0.0801193118095398, -0.03815116360783577, 0.05892260745167732, 0.2922886312007904, 0.2399677187204361, 0.2733137607574463, -0.002740330994129181, -0.2403624951839447, -0.2591283321380615, 0.016068734228610992, -0.14876225590705872, -0.3684868812561035, -0.12845584750175476, 0.001106753945350647, -0.2621197998523712, -0.06901048868894577, -0.6554127931594849, 0.19015419483184814, -0.14623872935771942, 0.1025533676147461, -0.21862995624542236, -0.2560800313949585, 0.2467140257358551, -0.2855611741542816, 0.07256096601486206, -0.1995972841978073, -0.18265527486801147, -0.028990209102630615, 0.14139151573181152, 0.16821779310703278, 0.13539135456085205, 0.4939875304698944, -0.22657930850982666, -0.11280675232410431, 0.08481201529502869, 0.022724516689777374, 0.35303840041160583, -0.07585309445858002, 0.1539028286933899, -0.6227381825447083, 0.09833519160747528, 0.04990267753601074, 0.04074915871024132, -0.492927223443985, 0.2160109281539917, 0.10285857319831848, -0.16366662085056305, -0.12622353434562683, -0.30846577882766724, -0.21601569652557373, -0.13806745409965515, 0.13939169049263, -0.12041468918323517, -0.2162484973669052, 0.04287765920162201, -0.0005500763654708862, 0.028065800666809082, -0.05288344621658325, -0.2862222492694855, -0.03606640547513962, 0.0998276025056839, 0.03618994355201721, -0.28741708397865295, -0.12745192646980286, -0.18863770365715027, 0.24812911450862885, 0.15046602487564087, 0.5074335932731628, -0.034886643290519714, -0.11625191569328308, 0.08839161694049835, -0.11740144342184067, 0.7648217082023621, -0.027556121349334717, 0.4414243698120117, 0.317099392414093, 0.11626292765140533, -0.4480665326118469, -0.10654748976230621, 0.18743619322776794, 0.23905456066131592, 0.1960403323173523, 0.3915334641933441, 0.03317597508430481, 0.10147887468338013, 0.02215445041656494, 0.5069687366485596, -0.08772032707929611, -0.4126244783401489, -0.23431523144245148, -0.2182304561138153, -0.11141316592693329, -0.11715038865804672, 0.12769566476345062, 0.45710259675979614, -0.04436499625444412, -0.12136270105838776, -0.09601639211177826, -0.0980275347828865, -0.2339448183774948, -0.04855160042643547, 0.1887359470129013, -0.15570473670959473, 0.3411085307598114, -0.03588990867137909, 0.18849068880081177, 0.33934178948402405, 0.5511676073074341, 0.17839345335960388, -0.2552833557128906, 0.18381057679653168, -0.13874231278896332, 0.012210112065076828, 0.08504403382539749, -0.05889590457081795, -0.11099401116371155, 0.0003353618085384369, 0.17163676023483276, -0.2965015769004822, 0.08579817414283752, 0.15572220087051392, -0.10386364161968231, -0.21476279199123383, -0.21238327026367188, 0.6556914448738098, -0.12132614105939865, 0.07814906537532806, 0.3743993937969208, -0.4152477979660034, -0.2207876741886139, 0.302200585603714, -0.20720863342285156, 0.5385361909866333, 0.1146925836801529, -0.09799858927726746, 0.07873443514108658, -0.23044022917747498, 0.31877851486206055, -0.366737425327301, -0.07802332937717438, -0.2695873975753784, 0.23576267063617706, 0.17038747668266296, -0.1989785134792328, -0.026089325547218323, 0.3439415991306305, 0.14282214641571045, -0.08874597400426865, -0.3534877896308899, -0.23081502318382263, -0.18093854188919067, 0.25262635946273804, -0.1242578774690628, -0.1331184208393097, -0.45791715383529663, 0.10602568835020065, -0.11105488240718842, 0.150013267993927, -0.03112689219415188, 0.11077196896076202, -0.039367400109767914, -0.4260411858558655, -0.25789716839790344, 0.16815809905529022, 0.13477084040641785, 0.028582550585269928, 0.2422015368938446, -0.09263619780540466, 0.06834625452756882, 0.16735945641994476, -0.36422908306121826, 0.37182706594467163, -0.20612896978855133, -0.006218358874320984, -0.3226373493671417, 0.09313242137432098, 0.16491641104221344, 0.06103593856096268, 0.0914052203297615, 0.10596248507499695, -0.1950775682926178, -0.14112403988838196, -0.36492469906806946, -0.15498721599578857, 0.18217964470386505, 0.4824652075767517, -0.01357266865670681, -0.20325006544589996, -0.2026030719280243, -0.19683295488357544, 0.2231622040271759, -0.0002664923667907715, 0.09323130548000336, 0.08738139271736145, -0.13734473288059235, -0.1034374088048935, -0.1484062373638153, -0.5106779932975769, -0.05316825583577156, 0.5137205719947815, 0.06502941250801086, -0.12513720989227295, 0.2820632755756378, 0.329397052526474, 0.019348978996276855, -0.13184306025505066, 0.38891327381134033, 0.1352872997522354, -0.2482883185148239, 0.32175785303115845, -0.1809285581111908, 0.1779872477054596, -0.31449079513549805, 0.08598779141902924, -0.043535664677619934, -0.016924474388360977, 0.2455103099346161, -0.6977630853652954, -0.3289809226989746, 0.15442052483558655, -0.005834435112774372, -0.023021169006824493, 0.20833644270896912, -0.08238723874092102, 0.08490708470344543, -0.191864013671875, -0.1759977489709854, 0.1494654417037964, -0.2276686429977417, 0.2091168314218521, -0.08171766996383667, 0.11455613374710083, 0.16769616305828094, -0.12875498831272125, 0.07477661222219467, 0.24057643115520477, -0.03354367986321449, -0.22096459567546844, -0.2655715346336365, 0.10978126525878906, 0.1855902373790741, -0.0660247951745987, -0.13492292165756226, -0.36142924427986145, -0.04122497886419296, -0.0893746018409729, 0.037947751581668854, 0.07007057964801788, -0.1027635931968689, 0.05688587203621864, 0.3957133889198303, 0.28951478004455566, 0.09751443564891815, 0.43220797181129456, 0.07240550965070724, 0.5258294343948364, -0.07998323440551758, 0.28788667917251587, 0.09411537647247314, 0.18881207704544067, -0.6049803495407104, 0.010440165176987648, -0.21039409935474396, 0.2604297995567322, 0.18364562094211578, -0.30805468559265137, 0.2958095967769623, 0.18048429489135742, 0.23868437111377716, 0.380392462015152, -0.4163108170032501, 0.00997169315814972, 0.00158768892288208, 0.10369348526000977, 0.022282853722572327, -0.32697680592536926, 0.34352701902389526, 0.21052424609661102, -0.17718009650707245, 0.04840024560689926, -0.049017854034900665, -0.32335513830184937, -0.3614594042301178, 0.15887995064258575, 0.2714894115924835, 0.27669745683670044, -0.06876258552074432, 0.6148406267166138, -0.18809300661087036, 0.014928578399121761, -0.10535562038421631, 0.15505658090114594, 0.41553211212158203, 0.5874577164649963, 0.12707485258579254, -0.09973669052124023, 0.09058685600757599, 0.2350609004497528, -0.42459726333618164, -0.5100788474082947, 0.3898005783557892, 0.4795421361923218, -0.14312167465686798, 0.22008799016475677, 0.1530127376317978, -0.02923695743083954, 0.033253755420446396, 0.23226673901081085, 0.009952202439308167, -0.02667401172220707, -0.07482485473155975, -0.20061513781547546, -0.1151776909828186, -0.03949829190969467, -0.03354821354150772, 0.15003171563148499, 0.06431405246257782, 0.21205084025859833, 0.1895688772201538, 0.17438848316669464, -0.26524946093559265, -0.15997350215911865, 0.4140821099281311, 0.09756636619567871, -0.010167799890041351, -0.4699559211730957, 0.12507951259613037, 0.29923832416534424, -0.09768328070640564, 0.44551849365234375, -0.10967462509870529, 0.3141118884086609, 0.4573271572589874, -0.0566997192800045, -0.02491813525557518, -0.06094193086028099, 0.06168591231107712, -0.19805079698562622, 0.5180256962776184, -0.07402830570936203, 0.03919914364814758, 0.37434375286102295, 0.0962570533156395, -0.07380013167858124, 0.3352934420108795, 0.33263251185417175, 0.1533837765455246, -0.3477022051811218, 0.019798995926976204, -0.22140781581401825, -0.11236993968486786, -0.34475940465927124, -0.00048075243830680847, -0.14275899529457092, -0.1281222701072693, 0.18901364505290985, 0.16506601870059967, 0.1944686472415924, -0.08909910172224045, 0.051829744130373, -0.372367262840271, 0.4878212511539459, 0.2022443562746048, 0.0476091243326664, 0.019631028175354004, -0.055354297161102295, -0.32254448533058167, 0.10867337882518768, -0.42590370774269104, 0.16200107336044312, 0.3262230455875397, 0.1485372632741928, -0.132751002907753, 0.08141251653432846, -0.22409209609031677, 0.16854827105998993, -0.2773902714252472, 0.09164905548095703, -0.025960445404052734, -0.7420276403427124, 0.1122170239686966, -0.03985775262117386, 0.08690313249826431, -0.4605216979980469, 0.2215259075164795, -0.41794225573539734, -0.04202760010957718, -0.17016670107841492, -0.0799986720085144, -0.1073138415813446, 0.15116949379444122, 0.35857918858528137, 0.1872296929359436, 0.02876437082886696, 0.09024392813444138, -0.04118920490145683, -0.2564046084880829, -0.1267082542181015, -0.13117587566375732, 0.3650962710380554, -0.06163325160741806, 0.2149147093296051, -0.29783210158348083, 0.12937529385089874, -0.007942549884319305, 0.09831157326698303, -0.16139011085033417, -0.13929100334644318, -0.2904249429702759, -0.09346190840005875, -0.33609169721603394, 0.2540903091430664, -0.08193832635879517, 0.13373024761676788, 0.005742710083723068, 0.2724475860595703, 0.14746299386024475, -0.21520894765853882, 0.3609536588191986, -0.3529355525970459, -0.20826497673988342, 0.20780155062675476, 0.15313604474067688, -0.2542553246021271, -0.35568752884864807, -0.2642309069633484, 0.18071407079696655, 0.572973906993866, 0.04903421923518181, -0.2596609592437744, 0.02229216694831848, -0.197586789727211, -0.14539533853530884, -0.07175005972385406, 0.10187496244907379, 0.18945592641830444, 0.042481474578380585, 0.3455488383769989, -0.14231982827186584 ]
https://github.com/huggingface/datasets/issues/5953
cc @sanchit-gandhi @Vaibhavs10 @lhoestq - this is mainly for demos that use Common Voice datasets as done here: https://github.com/facebookresearch/fairseq/tree/main/examples/mms#-transformers
Bad error message when trying to download gated dataset
### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
19
Bad error message when trying to download gated dataset ### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 cc @sanchit-gandhi @Vaibhavs10 @lhoestq - this is mainly for demos that use Common Voice datasets as done here: https://github.com/facebookresearch/fairseq/tree/main/examples/mms#-transformers
[ -0.2910834550857544, -0.24233008921146393, 0.11376997828483582, 0.28113362193107605, 0.4399706721305847, 0.1367226243019104, 0.28315269947052, 0.18023063242435455, 0.02009575068950653, 0.15855589509010315, -0.41839614510536194, -0.16160747408866882, 0.03821331635117531, 0.06896946579217911, 0.09538041055202484, 0.032373957335948944, 0.1215248703956604, -0.07715115696191788, 0.03349883854389191, -0.086275115609169, -0.21023842692375183, 0.025769973173737526, -0.22894561290740967, 0.44970083236694336, -0.2746562659740448, -0.016474667936563492, -0.03204021602869034, 0.5527821183204651, -0.17026221752166748, -0.304437518119812, 0.365519642829895, 0.05719923600554466, 0.07487547397613525, 0.20205792784690857, -0.00011953379726037383, 0.11945769190788269, 0.4015398621559143, -0.06258092820644379, -0.23526766896247864, -0.2491738498210907, -0.4586632251739502, -0.10343196243047714, -0.32971614599227905, -0.14405594766139984, -0.002043098211288452, -0.2154848277568817, 0.07323388010263443, 0.10686725378036499, 0.3369942307472229, 0.23172785341739655, 0.11226662993431091, 0.2569122314453125, 0.35404354333877563, -0.15269123017787933, -0.09855003654956818, -0.008254468441009521, -0.06660322099924088, 0.5634390115737915, 0.11621896922588348, 0.16239574551582336, 0.15930400788784027, 0.136821910738945, -0.2523663341999054, -0.014546910300850868, 0.49576887488365173, -0.16906200349330902, -0.15808455646038055, -0.3775421380996704, -0.01068251021206379, 0.49602773785591125, -0.010123331099748611, -0.050585925579071045, -0.34111204743385315, -0.4358579218387604, -0.05281969532370567, -0.1613587588071823, 0.20850634574890137, 0.30007481575012207, -0.30883365869522095, 0.36778509616851807, -0.34516823291778564, -0.1699851006269455, -0.0753726214170456, 0.0853542909026146, -0.0656762421131134, 0.35800454020500183, 0.14319130778312683, 0.15003269910812378, -0.033011097460985184, -0.26985087990760803, -0.2466515302658081, -0.28598853945732117, -0.2851129174232483, 0.132000133395195, -0.16588057577610016, -0.15979713201522827, 0.24964916706085205, 0.37853139638900757, 0.24190999567508698, 0.2913118898868561, -0.5035306811332703, 0.060302212834358215, -0.21706324815750122, -0.04339517652988434, 0.28527599573135376, 0.05687978118658066, -0.023343820124864578, 0.16308987140655518, 0.4708404242992401, 0.4824879765510559, 0.19592466950416565, 0.037902697920799255, 0.022440072149038315, 0.04341788962483406, -0.02638472616672516, 0.05899864062666893, 0.3890644609928131, -0.4395676851272583, -0.3730820417404175, 0.024059727787971497, -0.1778060495853424, 0.10459442436695099, 0.12995727360248566, 0.5462892651557922, -0.11972609162330627, -0.14243149757385254, -0.10674985498189926, 0.1528814435005188, -0.21953406929969788, -0.4129561185836792, -0.13279828429222107, -0.17960548400878906, 0.027463369071483612, 0.15213629603385925, -0.03406207635998726, -0.1943729668855667, 0.19683171808719635, -0.2965853214263916, -0.14699605107307434, 0.009854838252067566, -0.37033611536026, -0.024973701685667038, -0.05517638102173805, 0.26649317145347595, 0.2125111222267151, 0.07207469642162323, 0.03295229375362396, -0.23411837220191956, -0.05721775442361832, -0.10119681060314178, -0.12842246890068054, -0.6543936133384705, 0.09142963588237762, 0.10127194225788116, -0.5258939266204834, -0.027124620974063873, -0.18084020912647247, 0.04340945929288864, -0.1741907149553299, -0.1758711338043213, -0.02401791885495186, 0.13013491034507751, -0.16595882177352905, -0.008232660591602325, 0.2092408984899521, 0.6641110181808472, 0.06569211930036545, -0.2337663620710373, -0.15413811802864075, -0.32532984018325806, 0.06073026359081268, 0.3088633418083191, -0.17285805940628052, 0.39849385619163513, -0.2845204174518585, 0.580757200717926, 0.000790327787399292, -0.46642976999282837, -0.7262557148933411, 0.34982091188430786, -0.08260530978441238, 0.27460479736328125, 0.10424058139324188, 0.04835512116551399, 0.2935149669647217, -0.04868682101368904, 0.211354598402977, 0.08484722673892975, 0.08597449958324432, -0.12034052610397339, -0.1358029842376709, -0.2515827715396881, -0.013664623722434044, 0.14004948735237122, 0.09743142873048782, 0.3722021281719208, 0.3517691493034363, 0.33165445923805237, 0.6285654902458191, 0.020645838230848312, -0.036972492933273315, 0.2745622396469116, 0.5249727964401245, -0.048632774502038956, -0.19210854172706604, -0.17666193842887878, -0.2890605330467224, 0.25386863946914673, -0.10740898549556732, 0.27406588196754456, -0.3012474775314331, -0.12781840562820435, -0.43559348583221436, 0.0668775886297226, -0.2966436743736267, 0.02236662060022354, 0.007067367434501648, -0.15515434741973877, 0.12587419152259827, 0.009479410946369171, 0.051061615347862244, 0.6214250326156616, -0.1856619417667389, 0.21813534200191498, -0.3008047938346863, 0.19291716814041138, -0.005668588448315859, -0.1607896089553833, 0.1599390208721161, 0.13451740145683289, 0.5338273048400879, -0.026586897671222687, -0.08566383272409439, 0.421622097492218, -0.17149555683135986, 0.09196744859218597, -0.3337697684764862, 0.23686867952346802, 0.345895379781723, -0.1611878126859665, -0.17515356838703156, 0.0986727774143219, 0.21438321471214294, 0.14856231212615967, -0.05771365761756897, 0.2181411236524582, 0.2656932473182678, 0.033175040036439896, -0.061979521065950394, 0.23261909186840057, 0.2944014072418213, 0.0027866140007972717, 0.0019441097974777222, 0.08097301423549652, 0.24295400083065033, 0.11289060860872269, -0.06539633870124817, -0.025341210886836052, 0.044316306710243225, 0.032838448882102966, 0.36926257610321045, -0.22003161907196045, 0.2944103181362152, 0.047858111560344696, -0.00827866792678833, -0.008479751646518707, 0.3803418278694153, 0.3283654451370239, 0.32564350962638855, 0.09218405932188034, -0.12036003917455673, 0.23958377540111542, -0.02513950690627098, -0.17344535887241364, 0.3853999972343445, -0.017228413373231888, -0.22051535546779633, 0.15953367948532104, -0.13404732942581177, -0.19883593916893005, -0.16763950884342194, -0.4307210445404053, -0.036258257925510406, 0.3685009479522705, -0.5825729966163635, -0.14441236853599548, -0.2938927710056305, -0.17056918144226074, 0.07233522832393646, -0.11394999921321869, -0.39726006984710693, -0.19774776697158813, 0.019625883549451828, 0.5626672506332397, -0.10103937238454819, 0.11861443519592285, -0.08043227344751358, 0.011486276984214783, -0.06237281486392021, 0.19467271864414215, -0.15936359763145447, 0.09921334683895111, -0.31962209939956665, -0.058280009776353836, 0.303349107503891, -0.12355727702379227, 0.04794790595769882, -0.24125832319259644, -0.18235813081264496, -0.4411284029483795, 0.16949936747550964, 0.1705792099237442, -0.17510250210762024, 0.409170001745224, 0.13404443860054016, 0.3379439413547516, 0.1903788447380066, 0.1096859946846962, 0.2887125611305237, 0.22408562898635864, -0.1570878028869629, -0.04427892714738846, -0.16566646099090576, -0.022582802921533585, -0.08744978159666061, -0.09199120104312897, -0.16295838356018066, -0.4005160927772522, 0.27000343799591064, -0.3703625500202179, 0.16847513616085052, 0.4286927878856659, 0.06198602914810181, 0.08471164107322693, -0.09086006879806519, -0.15867601335048676, -0.09859031438827515, -0.3248373866081238, 0.2998582720756531, 0.11364684998989105, -0.3338841497898102, -0.05695310980081558, 0.0859905555844307, 0.07909943908452988, -0.292316198348999, -0.43653300404548645, -0.1435989886522293, -0.21422120928764343, 0.2803303599357605, 0.0025293342769145966, -0.14266861975193024, 0.23180067539215088, -0.2732248604297638, 0.023146823048591614, 0.016965016722679138, -0.21566131711006165, 0.0670764371752739, 0.010476140305399895, 0.3478473424911499, -0.07651260495185852, 0.3513559401035309, 0.026130929589271545, 0.34979185461997986, 0.1984333097934723, 0.3158639073371887, 0.38522616028785706, -0.0537281408905983, 0.26139724254608154, 0.10157148540019989, -0.14808018505573273, 0.030921440571546555, 0.12697038054466248, -0.13834252953529358, 0.10881249606609344, 0.12465989589691162, 0.07097029685974121, -0.31702014803886414, -0.5742523670196533, -0.05743550509214401, -0.30862170457839966, -0.4599819779396057, 0.31301239132881165, -0.07758311927318573, 0.38665276765823364, 0.4452838897705078, 0.10630017518997192, -0.09869588166475296, 0.2773113250732422, 0.38878676295280457, 0.1897796243429184, 0.07632067799568176, -0.1771172732114792, -0.27192893624305725, -0.3709234595298767, 0.2242303192615509, 0.07249318808317184, 0.2402772307395935, -0.30152639746665955, 0.07766258716583252, 0.12134397774934769, -0.041969846934080124, 0.3528978228569031, -0.08038831502199173, 0.6159146428108215, -0.23009923100471497, 0.20723988115787506, -0.22239992022514343, -0.1577439308166504, 0.018248967826366425, -0.14138400554656982, 0.18066120147705078, 0.42769601941108704, -0.5877941846847534, 0.010643154382705688, -0.11366251111030579, -0.22375993430614471, -0.3114534914493561, -0.09309904277324677, -0.2576058506965637, -0.4546360969543457, -0.4896072745323181, 0.2433195412158966, 0.15483447909355164, 0.2070293128490448, 0.06497624516487122, -0.03502659499645233, 0.2392854243516922, 0.21879687905311584, -0.03654744476079941, 0.08314250409603119, 0.1150156706571579, 0.04199819639325142, 0.34373027086257935, 0.24708743393421173, 0.35576382279396057, 0.17591428756713867, 0.6639750599861145, 0.5626799464225769, -0.23023271560668945, -0.004132851958274841, 0.11013324558734894, -0.1410987228155136, 0.5136085152626038, 0.06634394824504852, 0.07985988259315491, 0.7597638368606567, 0.2528665363788605, -0.27303627133369446, -0.0009984038770198822, 0.24077236652374268, 0.021897047758102417, -0.15266966819763184, -0.20899111032485962, 0.15896743535995483, -0.30649858713150024, -0.0991877019405365, 0.1785781979560852, 0.41934290528297424, -0.020169729366898537, 0.13495893776416779, -0.14134156703948975, 1.088686466217041, 0.18313196301460266, 0.07597368955612183, 0.43394532799720764, -0.4744122326374054, 0.1279040426015854, -0.29606425762176514, 0.12735615670681, -0.03822223097085953, 0.04905697703361511, -0.1331041008234024, 0.11969603598117828, -0.15400196611881256, 0.04075903072953224, 0.030552655458450317, 0.32588011026382446, -0.049212872982025146, -0.10816076397895813, 0.06379196792840958, 0.13781234622001648, -0.4747120440006256, -0.12143535166978836, -0.46357133984565735, 0.0783674418926239, -0.10965979099273682, 0.500636637210846, -0.06702069938182831, -0.30010393261909485, -0.1321365386247635, -0.2555209994316101, -0.4757479727268219, 0.33804982900619507, 0.11440251767635345, 0.07898944616317749, 0.006290385499596596, 0.26861438155174255, -0.11805227398872375, -0.02567213401198387, 0.00650421716272831, 0.15344960987567902, -0.5712547302246094, 0.23242150247097015, -0.05614802613854408, -0.022341551259160042, 0.12904220819473267, -0.010354474186897278, 0.3320024013519287, -0.16329237818717957, -0.5239814519882202, -0.045583754777908325, -0.07642288506031036, -0.238118514418602, -0.13334524631500244, -0.13985760509967804, 0.24257442355155945, -0.19030369818210602, 0.008708223700523376, 0.04715932905673981, 0.15088021755218506, -0.27965396642684937, 0.033075809478759766, 0.08567258715629578, -0.09919354319572449, -0.12250567972660065, 0.2510603964328766, -0.35412144660949707, -0.09665066003799438, 0.4360445737838745, -0.19344893097877502, 0.15730911493301392, 0.5104482173919678, -0.13162930309772491, -0.15768685936927795, -0.18840628862380981, 0.08744847774505615, 0.08802579343318939, -0.5327839851379395, -0.01592104695737362, -0.019625304266810417, 0.12189403176307678, -0.44926732778549194, 0.13791964948177338, 0.34159013628959656, -0.10507407784461975, -0.02286098152399063, -0.3368982672691345, -0.19848071038722992, 0.08595225214958191, -0.18657784163951874, -0.018307944759726524, -0.17759530246257782, 0.27689817547798157, 0.13040441274642944, -0.2580571174621582, -0.21253103017807007, -0.056031931191682816, -0.33336931467056274, -0.18998679518699646, 0.09729446470737457, 0.12167279422283173, 0.04756816476583481, -0.22524553537368774, -0.0017254799604415894, 0.18275964260101318, -0.2938920855522156, -0.022611288353800774, -0.16655048727989197, 0.1898839771747589, 0.20727184414863586, -0.33079540729522705, -0.00749211385846138, -0.20830203592777252, -0.008118461817502975, 0.07644879072904587, 0.2587353587150574, 0.5852013230323792, 0.23585088551044464, -0.33047541975975037, 0.24516189098358154, 0.2726234495639801, -0.6120889186859131, 0.2626725435256958, 0.04181499034166336, 0.1436551809310913, -0.10843217372894287, -0.003381699323654175, -0.1850132793188095, -0.006830446422100067, -0.17989085614681244, -0.03943152725696564, 0.24793866276741028, 0.14886154234409332, 0.5709382891654968, -0.15832167863845825, 0.02782561630010605, 0.30763840675354004, 0.2982943058013916, -0.08276478946208954, -0.06902879476547241, -0.151149183511734, 0.04427695646882057, 0.13644427061080933, -0.24473947286605835, 0.058691758662462234, -0.05417752265930176, -0.08150812983512878, -0.05168113484978676, 0.042843982577323914, -0.08732803910970688, 0.0553150475025177, 0.04024166241288185, 0.06351111829280853, 0.3052489757537842, 0.5167137980461121, -0.12145823985338211, 0.14543956518173218, -0.1954861283302307, 0.13444028794765472, 0.3726135790348053, -0.31480470299720764, 0.14707627892494202, 0.4698861539363861, -0.2542370855808258, 0.07036752253770828, -0.09700998663902283, 0.3371080458164215, 0.07004164159297943, -0.3350706100463867, -0.11779803782701492, -0.18883055448532104, -0.14840073883533478, -0.21958336234092712, -0.20054230093955994, -0.01589040830731392, -0.3773273825645447, -0.10256122052669525, -0.19541580975055695, 0.16841834783554077, -0.2253764569759369, 0.08470853418111801, 0.04699726402759552, -0.1484605371952057, -0.1611018031835556, 0.061966672539711, 0.12334234267473221, -0.3837183117866516, 0.03805183619260788, -0.09038043022155762, -0.1862923949956894, -0.11323622614145279, -0.22034811973571777, 0.3356418311595917, 0.3138921856880188, -0.19761323928833008, 0.14470286667346954, 0.2575016915798187, -0.28503191471099854, 0.43289992213249207, 0.5137104392051697, 0.5138193964958191, 0.10800740867853165, 0.29635822772979736, 0.2243003249168396, 0.21105533838272095, 0.13111716508865356, 0.0583655908703804, 0.29181793332099915, 0.09802210330963135, 0.3544723391532898, 0.14918723702430725, 0.07617860287427902, -0.09697318077087402, 0.025527266785502434, -0.1734696328639984, 0.05290228873491287, -0.04719433933496475, 0.6683246493339539, -0.2581630051136017, 0.12196756899356842, -0.22736915946006775, -0.04505845531821251, -0.26821231842041016, 0.1457405835390091, 0.21966210007667542, -0.17659544944763184, 0.20320840179920197, -0.42767977714538574, 0.02984946221113205, -0.21123027801513672, 0.24297645688056946, 0.4580625295639038, -0.10234716534614563, -0.22541381418704987, 0.08980494737625122, -0.6377158761024475, 0.3143046498298645, -0.09975434839725494, -0.1257753223180771, 0.04813544079661369, 0.17482727766036987, -0.1693086475133896, 0.06353728473186493, 0.12172649800777435, 0.12121793627738953, -0.25117307901382446, 0.1666630655527115, -0.05846887081861496, -0.03808272257447243, 0.058093827217817307, 0.15651103854179382, -0.11942866444587708, -0.35113853216171265, 0.5051125288009644, -0.17309993505477905, -0.05530908703804016, 0.3530036509037018, -0.061433855444192886, 0.041913725435733795, -0.08998547494411469, 0.31096351146698, 0.12650325894355774, 0.38722848892211914, 0.042109787464141846, -0.19389969110488892, -0.2732853293418884, -0.1568191647529602, -0.25461673736572266, 0.03473344445228577, -0.09978309273719788, 0.30633047223091125, 0.10739296674728394, -0.08423327654600143, -0.21500781178474426, 0.4758688509464264, 0.030121348798274994, -0.19139999151229858, -0.24043911695480347, 0.040482714772224426, -0.2555764317512512, -0.009742394089698792, -0.07693107426166534, -0.20573097467422485, 0.10219859331846237, 0.11405423283576965, -0.3285716772079468, -0.4315008819103241, 0.8132106065750122, -0.3085569739341736, -0.00665496289730072, -0.22305062413215637, 0.49516117572784424, 0.2379680871963501, -0.310775488615036, -0.301699697971344, 0.058478355407714844, 0.20364487171173096, -0.05379505082964897, -0.1569199562072754, -0.06840495765209198, -0.31260111927986145, -0.10619852691888809, -0.025066494941711426, 0.07611473649740219, -0.08417966961860657, -0.5427252650260925, 0.618014931678772, -0.11091821640729904 ]
https://github.com/huggingface/datasets/issues/5953
Hi ! the error for me is ``` FileNotFoundError: Couldn't find a dataset script at /content/mozilla-foundation/common_voice_13_0/common_voice_13_0.py or any data file in the same directory. Couldn't find 'mozilla-foundation/common_voice_13_0' on the Hugging Face Hub either: FileNotFoundError: Dataset 'mozilla-foundation/common_voice_13_0' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` And tbh idk how you managed to get your error. "n_shards.json" is not even a thing in `datasets`
Bad error message when trying to download gated dataset
### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
75
Bad error message when trying to download gated dataset ### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Hi ! the error for me is ``` FileNotFoundError: Couldn't find a dataset script at /content/mozilla-foundation/common_voice_13_0/common_voice_13_0.py or any data file in the same directory. Couldn't find 'mozilla-foundation/common_voice_13_0' on the Hugging Face Hub either: FileNotFoundError: Dataset 'mozilla-foundation/common_voice_13_0' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`. ``` And tbh idk how you managed to get your error. "n_shards.json" is not even a thing in `datasets`
[ -0.2910834550857544, -0.24233008921146393, 0.11376997828483582, 0.28113362193107605, 0.4399706721305847, 0.1367226243019104, 0.28315269947052, 0.18023063242435455, 0.02009575068950653, 0.15855589509010315, -0.41839614510536194, -0.16160747408866882, 0.03821331635117531, 0.06896946579217911, 0.09538041055202484, 0.032373957335948944, 0.1215248703956604, -0.07715115696191788, 0.03349883854389191, -0.086275115609169, -0.21023842692375183, 0.025769973173737526, -0.22894561290740967, 0.44970083236694336, -0.2746562659740448, -0.016474667936563492, -0.03204021602869034, 0.5527821183204651, -0.17026221752166748, -0.304437518119812, 0.365519642829895, 0.05719923600554466, 0.07487547397613525, 0.20205792784690857, -0.00011953379726037383, 0.11945769190788269, 0.4015398621559143, -0.06258092820644379, -0.23526766896247864, -0.2491738498210907, -0.4586632251739502, -0.10343196243047714, -0.32971614599227905, -0.14405594766139984, -0.002043098211288452, -0.2154848277568817, 0.07323388010263443, 0.10686725378036499, 0.3369942307472229, 0.23172785341739655, 0.11226662993431091, 0.2569122314453125, 0.35404354333877563, -0.15269123017787933, -0.09855003654956818, -0.008254468441009521, -0.06660322099924088, 0.5634390115737915, 0.11621896922588348, 0.16239574551582336, 0.15930400788784027, 0.136821910738945, -0.2523663341999054, -0.014546910300850868, 0.49576887488365173, -0.16906200349330902, -0.15808455646038055, -0.3775421380996704, -0.01068251021206379, 0.49602773785591125, -0.010123331099748611, -0.050585925579071045, -0.34111204743385315, -0.4358579218387604, -0.05281969532370567, -0.1613587588071823, 0.20850634574890137, 0.30007481575012207, -0.30883365869522095, 0.36778509616851807, -0.34516823291778564, -0.1699851006269455, -0.0753726214170456, 0.0853542909026146, -0.0656762421131134, 0.35800454020500183, 0.14319130778312683, 0.15003269910812378, -0.033011097460985184, -0.26985087990760803, -0.2466515302658081, -0.28598853945732117, -0.2851129174232483, 0.132000133395195, -0.16588057577610016, -0.15979713201522827, 0.24964916706085205, 0.37853139638900757, 0.24190999567508698, 0.2913118898868561, -0.5035306811332703, 0.060302212834358215, -0.21706324815750122, -0.04339517652988434, 0.28527599573135376, 0.05687978118658066, -0.023343820124864578, 0.16308987140655518, 0.4708404242992401, 0.4824879765510559, 0.19592466950416565, 0.037902697920799255, 0.022440072149038315, 0.04341788962483406, -0.02638472616672516, 0.05899864062666893, 0.3890644609928131, -0.4395676851272583, -0.3730820417404175, 0.024059727787971497, -0.1778060495853424, 0.10459442436695099, 0.12995727360248566, 0.5462892651557922, -0.11972609162330627, -0.14243149757385254, -0.10674985498189926, 0.1528814435005188, -0.21953406929969788, -0.4129561185836792, -0.13279828429222107, -0.17960548400878906, 0.027463369071483612, 0.15213629603385925, -0.03406207635998726, -0.1943729668855667, 0.19683171808719635, -0.2965853214263916, -0.14699605107307434, 0.009854838252067566, -0.37033611536026, -0.024973701685667038, -0.05517638102173805, 0.26649317145347595, 0.2125111222267151, 0.07207469642162323, 0.03295229375362396, -0.23411837220191956, -0.05721775442361832, -0.10119681060314178, -0.12842246890068054, -0.6543936133384705, 0.09142963588237762, 0.10127194225788116, -0.5258939266204834, -0.027124620974063873, -0.18084020912647247, 0.04340945929288864, -0.1741907149553299, -0.1758711338043213, -0.02401791885495186, 0.13013491034507751, -0.16595882177352905, -0.008232660591602325, 0.2092408984899521, 0.6641110181808472, 0.06569211930036545, -0.2337663620710373, -0.15413811802864075, -0.32532984018325806, 0.06073026359081268, 0.3088633418083191, -0.17285805940628052, 0.39849385619163513, -0.2845204174518585, 0.580757200717926, 0.000790327787399292, -0.46642976999282837, -0.7262557148933411, 0.34982091188430786, -0.08260530978441238, 0.27460479736328125, 0.10424058139324188, 0.04835512116551399, 0.2935149669647217, -0.04868682101368904, 0.211354598402977, 0.08484722673892975, 0.08597449958324432, -0.12034052610397339, -0.1358029842376709, -0.2515827715396881, -0.013664623722434044, 0.14004948735237122, 0.09743142873048782, 0.3722021281719208, 0.3517691493034363, 0.33165445923805237, 0.6285654902458191, 0.020645838230848312, -0.036972492933273315, 0.2745622396469116, 0.5249727964401245, -0.048632774502038956, -0.19210854172706604, -0.17666193842887878, -0.2890605330467224, 0.25386863946914673, -0.10740898549556732, 0.27406588196754456, -0.3012474775314331, -0.12781840562820435, -0.43559348583221436, 0.0668775886297226, -0.2966436743736267, 0.02236662060022354, 0.007067367434501648, -0.15515434741973877, 0.12587419152259827, 0.009479410946369171, 0.051061615347862244, 0.6214250326156616, -0.1856619417667389, 0.21813534200191498, -0.3008047938346863, 0.19291716814041138, -0.005668588448315859, -0.1607896089553833, 0.1599390208721161, 0.13451740145683289, 0.5338273048400879, -0.026586897671222687, -0.08566383272409439, 0.421622097492218, -0.17149555683135986, 0.09196744859218597, -0.3337697684764862, 0.23686867952346802, 0.345895379781723, -0.1611878126859665, -0.17515356838703156, 0.0986727774143219, 0.21438321471214294, 0.14856231212615967, -0.05771365761756897, 0.2181411236524582, 0.2656932473182678, 0.033175040036439896, -0.061979521065950394, 0.23261909186840057, 0.2944014072418213, 0.0027866140007972717, 0.0019441097974777222, 0.08097301423549652, 0.24295400083065033, 0.11289060860872269, -0.06539633870124817, -0.025341210886836052, 0.044316306710243225, 0.032838448882102966, 0.36926257610321045, -0.22003161907196045, 0.2944103181362152, 0.047858111560344696, -0.00827866792678833, -0.008479751646518707, 0.3803418278694153, 0.3283654451370239, 0.32564350962638855, 0.09218405932188034, -0.12036003917455673, 0.23958377540111542, -0.02513950690627098, -0.17344535887241364, 0.3853999972343445, -0.017228413373231888, -0.22051535546779633, 0.15953367948532104, -0.13404732942581177, -0.19883593916893005, -0.16763950884342194, -0.4307210445404053, -0.036258257925510406, 0.3685009479522705, -0.5825729966163635, -0.14441236853599548, -0.2938927710056305, -0.17056918144226074, 0.07233522832393646, -0.11394999921321869, -0.39726006984710693, -0.19774776697158813, 0.019625883549451828, 0.5626672506332397, -0.10103937238454819, 0.11861443519592285, -0.08043227344751358, 0.011486276984214783, -0.06237281486392021, 0.19467271864414215, -0.15936359763145447, 0.09921334683895111, -0.31962209939956665, -0.058280009776353836, 0.303349107503891, -0.12355727702379227, 0.04794790595769882, -0.24125832319259644, -0.18235813081264496, -0.4411284029483795, 0.16949936747550964, 0.1705792099237442, -0.17510250210762024, 0.409170001745224, 0.13404443860054016, 0.3379439413547516, 0.1903788447380066, 0.1096859946846962, 0.2887125611305237, 0.22408562898635864, -0.1570878028869629, -0.04427892714738846, -0.16566646099090576, -0.022582802921533585, -0.08744978159666061, -0.09199120104312897, -0.16295838356018066, -0.4005160927772522, 0.27000343799591064, -0.3703625500202179, 0.16847513616085052, 0.4286927878856659, 0.06198602914810181, 0.08471164107322693, -0.09086006879806519, -0.15867601335048676, -0.09859031438827515, -0.3248373866081238, 0.2998582720756531, 0.11364684998989105, -0.3338841497898102, -0.05695310980081558, 0.0859905555844307, 0.07909943908452988, -0.292316198348999, -0.43653300404548645, -0.1435989886522293, -0.21422120928764343, 0.2803303599357605, 0.0025293342769145966, -0.14266861975193024, 0.23180067539215088, -0.2732248604297638, 0.023146823048591614, 0.016965016722679138, -0.21566131711006165, 0.0670764371752739, 0.010476140305399895, 0.3478473424911499, -0.07651260495185852, 0.3513559401035309, 0.026130929589271545, 0.34979185461997986, 0.1984333097934723, 0.3158639073371887, 0.38522616028785706, -0.0537281408905983, 0.26139724254608154, 0.10157148540019989, -0.14808018505573273, 0.030921440571546555, 0.12697038054466248, -0.13834252953529358, 0.10881249606609344, 0.12465989589691162, 0.07097029685974121, -0.31702014803886414, -0.5742523670196533, -0.05743550509214401, -0.30862170457839966, -0.4599819779396057, 0.31301239132881165, -0.07758311927318573, 0.38665276765823364, 0.4452838897705078, 0.10630017518997192, -0.09869588166475296, 0.2773113250732422, 0.38878676295280457, 0.1897796243429184, 0.07632067799568176, -0.1771172732114792, -0.27192893624305725, -0.3709234595298767, 0.2242303192615509, 0.07249318808317184, 0.2402772307395935, -0.30152639746665955, 0.07766258716583252, 0.12134397774934769, -0.041969846934080124, 0.3528978228569031, -0.08038831502199173, 0.6159146428108215, -0.23009923100471497, 0.20723988115787506, -0.22239992022514343, -0.1577439308166504, 0.018248967826366425, -0.14138400554656982, 0.18066120147705078, 0.42769601941108704, -0.5877941846847534, 0.010643154382705688, -0.11366251111030579, -0.22375993430614471, -0.3114534914493561, -0.09309904277324677, -0.2576058506965637, -0.4546360969543457, -0.4896072745323181, 0.2433195412158966, 0.15483447909355164, 0.2070293128490448, 0.06497624516487122, -0.03502659499645233, 0.2392854243516922, 0.21879687905311584, -0.03654744476079941, 0.08314250409603119, 0.1150156706571579, 0.04199819639325142, 0.34373027086257935, 0.24708743393421173, 0.35576382279396057, 0.17591428756713867, 0.6639750599861145, 0.5626799464225769, -0.23023271560668945, -0.004132851958274841, 0.11013324558734894, -0.1410987228155136, 0.5136085152626038, 0.06634394824504852, 0.07985988259315491, 0.7597638368606567, 0.2528665363788605, -0.27303627133369446, -0.0009984038770198822, 0.24077236652374268, 0.021897047758102417, -0.15266966819763184, -0.20899111032485962, 0.15896743535995483, -0.30649858713150024, -0.0991877019405365, 0.1785781979560852, 0.41934290528297424, -0.020169729366898537, 0.13495893776416779, -0.14134156703948975, 1.088686466217041, 0.18313196301460266, 0.07597368955612183, 0.43394532799720764, -0.4744122326374054, 0.1279040426015854, -0.29606425762176514, 0.12735615670681, -0.03822223097085953, 0.04905697703361511, -0.1331041008234024, 0.11969603598117828, -0.15400196611881256, 0.04075903072953224, 0.030552655458450317, 0.32588011026382446, -0.049212872982025146, -0.10816076397895813, 0.06379196792840958, 0.13781234622001648, -0.4747120440006256, -0.12143535166978836, -0.46357133984565735, 0.0783674418926239, -0.10965979099273682, 0.500636637210846, -0.06702069938182831, -0.30010393261909485, -0.1321365386247635, -0.2555209994316101, -0.4757479727268219, 0.33804982900619507, 0.11440251767635345, 0.07898944616317749, 0.006290385499596596, 0.26861438155174255, -0.11805227398872375, -0.02567213401198387, 0.00650421716272831, 0.15344960987567902, -0.5712547302246094, 0.23242150247097015, -0.05614802613854408, -0.022341551259160042, 0.12904220819473267, -0.010354474186897278, 0.3320024013519287, -0.16329237818717957, -0.5239814519882202, -0.045583754777908325, -0.07642288506031036, -0.238118514418602, -0.13334524631500244, -0.13985760509967804, 0.24257442355155945, -0.19030369818210602, 0.008708223700523376, 0.04715932905673981, 0.15088021755218506, -0.27965396642684937, 0.033075809478759766, 0.08567258715629578, -0.09919354319572449, -0.12250567972660065, 0.2510603964328766, -0.35412144660949707, -0.09665066003799438, 0.4360445737838745, -0.19344893097877502, 0.15730911493301392, 0.5104482173919678, -0.13162930309772491, -0.15768685936927795, -0.18840628862380981, 0.08744847774505615, 0.08802579343318939, -0.5327839851379395, -0.01592104695737362, -0.019625304266810417, 0.12189403176307678, -0.44926732778549194, 0.13791964948177338, 0.34159013628959656, -0.10507407784461975, -0.02286098152399063, -0.3368982672691345, -0.19848071038722992, 0.08595225214958191, -0.18657784163951874, -0.018307944759726524, -0.17759530246257782, 0.27689817547798157, 0.13040441274642944, -0.2580571174621582, -0.21253103017807007, -0.056031931191682816, -0.33336931467056274, -0.18998679518699646, 0.09729446470737457, 0.12167279422283173, 0.04756816476583481, -0.22524553537368774, -0.0017254799604415894, 0.18275964260101318, -0.2938920855522156, -0.022611288353800774, -0.16655048727989197, 0.1898839771747589, 0.20727184414863586, -0.33079540729522705, -0.00749211385846138, -0.20830203592777252, -0.008118461817502975, 0.07644879072904587, 0.2587353587150574, 0.5852013230323792, 0.23585088551044464, -0.33047541975975037, 0.24516189098358154, 0.2726234495639801, -0.6120889186859131, 0.2626725435256958, 0.04181499034166336, 0.1436551809310913, -0.10843217372894287, -0.003381699323654175, -0.1850132793188095, -0.006830446422100067, -0.17989085614681244, -0.03943152725696564, 0.24793866276741028, 0.14886154234409332, 0.5709382891654968, -0.15832167863845825, 0.02782561630010605, 0.30763840675354004, 0.2982943058013916, -0.08276478946208954, -0.06902879476547241, -0.151149183511734, 0.04427695646882057, 0.13644427061080933, -0.24473947286605835, 0.058691758662462234, -0.05417752265930176, -0.08150812983512878, -0.05168113484978676, 0.042843982577323914, -0.08732803910970688, 0.0553150475025177, 0.04024166241288185, 0.06351111829280853, 0.3052489757537842, 0.5167137980461121, -0.12145823985338211, 0.14543956518173218, -0.1954861283302307, 0.13444028794765472, 0.3726135790348053, -0.31480470299720764, 0.14707627892494202, 0.4698861539363861, -0.2542370855808258, 0.07036752253770828, -0.09700998663902283, 0.3371080458164215, 0.07004164159297943, -0.3350706100463867, -0.11779803782701492, -0.18883055448532104, -0.14840073883533478, -0.21958336234092712, -0.20054230093955994, -0.01589040830731392, -0.3773273825645447, -0.10256122052669525, -0.19541580975055695, 0.16841834783554077, -0.2253764569759369, 0.08470853418111801, 0.04699726402759552, -0.1484605371952057, -0.1611018031835556, 0.061966672539711, 0.12334234267473221, -0.3837183117866516, 0.03805183619260788, -0.09038043022155762, -0.1862923949956894, -0.11323622614145279, -0.22034811973571777, 0.3356418311595917, 0.3138921856880188, -0.19761323928833008, 0.14470286667346954, 0.2575016915798187, -0.28503191471099854, 0.43289992213249207, 0.5137104392051697, 0.5138193964958191, 0.10800740867853165, 0.29635822772979736, 0.2243003249168396, 0.21105533838272095, 0.13111716508865356, 0.0583655908703804, 0.29181793332099915, 0.09802210330963135, 0.3544723391532898, 0.14918723702430725, 0.07617860287427902, -0.09697318077087402, 0.025527266785502434, -0.1734696328639984, 0.05290228873491287, -0.04719433933496475, 0.6683246493339539, -0.2581630051136017, 0.12196756899356842, -0.22736915946006775, -0.04505845531821251, -0.26821231842041016, 0.1457405835390091, 0.21966210007667542, -0.17659544944763184, 0.20320840179920197, -0.42767977714538574, 0.02984946221113205, -0.21123027801513672, 0.24297645688056946, 0.4580625295639038, -0.10234716534614563, -0.22541381418704987, 0.08980494737625122, -0.6377158761024475, 0.3143046498298645, -0.09975434839725494, -0.1257753223180771, 0.04813544079661369, 0.17482727766036987, -0.1693086475133896, 0.06353728473186493, 0.12172649800777435, 0.12121793627738953, -0.25117307901382446, 0.1666630655527115, -0.05846887081861496, -0.03808272257447243, 0.058093827217817307, 0.15651103854179382, -0.11942866444587708, -0.35113853216171265, 0.5051125288009644, -0.17309993505477905, -0.05530908703804016, 0.3530036509037018, -0.061433855444192886, 0.041913725435733795, -0.08998547494411469, 0.31096351146698, 0.12650325894355774, 0.38722848892211914, 0.042109787464141846, -0.19389969110488892, -0.2732853293418884, -0.1568191647529602, -0.25461673736572266, 0.03473344445228577, -0.09978309273719788, 0.30633047223091125, 0.10739296674728394, -0.08423327654600143, -0.21500781178474426, 0.4758688509464264, 0.030121348798274994, -0.19139999151229858, -0.24043911695480347, 0.040482714772224426, -0.2555764317512512, -0.009742394089698792, -0.07693107426166534, -0.20573097467422485, 0.10219859331846237, 0.11405423283576965, -0.3285716772079468, -0.4315008819103241, 0.8132106065750122, -0.3085569739341736, -0.00665496289730072, -0.22305062413215637, 0.49516117572784424, 0.2379680871963501, -0.310775488615036, -0.301699697971344, 0.058478355407714844, 0.20364487171173096, -0.05379505082964897, -0.1569199562072754, -0.06840495765209198, -0.31260111927986145, -0.10619852691888809, -0.025066494941711426, 0.07611473649740219, -0.08417966961860657, -0.5427252650260925, 0.618014931678772, -0.11091821640729904 ]
https://github.com/huggingface/datasets/issues/5953
Okay, I am able to reproduce @patrickvonplaten's original error: https://github.com/Vaibhavs10/scratchpad/blob/main/cv13_datasets_test.ipynb Also not sure why it looks for `n_shards.json`
Bad error message when trying to download gated dataset
### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
18
Bad error message when trying to download gated dataset ### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Okay, I am able to reproduce @patrickvonplaten's original error: https://github.com/Vaibhavs10/scratchpad/blob/main/cv13_datasets_test.ipynb Also not sure why it looks for `n_shards.json`
[ -0.2910834550857544, -0.24233008921146393, 0.11376997828483582, 0.28113362193107605, 0.4399706721305847, 0.1367226243019104, 0.28315269947052, 0.18023063242435455, 0.02009575068950653, 0.15855589509010315, -0.41839614510536194, -0.16160747408866882, 0.03821331635117531, 0.06896946579217911, 0.09538041055202484, 0.032373957335948944, 0.1215248703956604, -0.07715115696191788, 0.03349883854389191, -0.086275115609169, -0.21023842692375183, 0.025769973173737526, -0.22894561290740967, 0.44970083236694336, -0.2746562659740448, -0.016474667936563492, -0.03204021602869034, 0.5527821183204651, -0.17026221752166748, -0.304437518119812, 0.365519642829895, 0.05719923600554466, 0.07487547397613525, 0.20205792784690857, -0.00011953379726037383, 0.11945769190788269, 0.4015398621559143, -0.06258092820644379, -0.23526766896247864, -0.2491738498210907, -0.4586632251739502, -0.10343196243047714, -0.32971614599227905, -0.14405594766139984, -0.002043098211288452, -0.2154848277568817, 0.07323388010263443, 0.10686725378036499, 0.3369942307472229, 0.23172785341739655, 0.11226662993431091, 0.2569122314453125, 0.35404354333877563, -0.15269123017787933, -0.09855003654956818, -0.008254468441009521, -0.06660322099924088, 0.5634390115737915, 0.11621896922588348, 0.16239574551582336, 0.15930400788784027, 0.136821910738945, -0.2523663341999054, -0.014546910300850868, 0.49576887488365173, -0.16906200349330902, -0.15808455646038055, -0.3775421380996704, -0.01068251021206379, 0.49602773785591125, -0.010123331099748611, -0.050585925579071045, -0.34111204743385315, -0.4358579218387604, -0.05281969532370567, -0.1613587588071823, 0.20850634574890137, 0.30007481575012207, -0.30883365869522095, 0.36778509616851807, -0.34516823291778564, -0.1699851006269455, -0.0753726214170456, 0.0853542909026146, -0.0656762421131134, 0.35800454020500183, 0.14319130778312683, 0.15003269910812378, -0.033011097460985184, -0.26985087990760803, -0.2466515302658081, -0.28598853945732117, -0.2851129174232483, 0.132000133395195, -0.16588057577610016, -0.15979713201522827, 0.24964916706085205, 0.37853139638900757, 0.24190999567508698, 0.2913118898868561, -0.5035306811332703, 0.060302212834358215, -0.21706324815750122, -0.04339517652988434, 0.28527599573135376, 0.05687978118658066, -0.023343820124864578, 0.16308987140655518, 0.4708404242992401, 0.4824879765510559, 0.19592466950416565, 0.037902697920799255, 0.022440072149038315, 0.04341788962483406, -0.02638472616672516, 0.05899864062666893, 0.3890644609928131, -0.4395676851272583, -0.3730820417404175, 0.024059727787971497, -0.1778060495853424, 0.10459442436695099, 0.12995727360248566, 0.5462892651557922, -0.11972609162330627, -0.14243149757385254, -0.10674985498189926, 0.1528814435005188, -0.21953406929969788, -0.4129561185836792, -0.13279828429222107, -0.17960548400878906, 0.027463369071483612, 0.15213629603385925, -0.03406207635998726, -0.1943729668855667, 0.19683171808719635, -0.2965853214263916, -0.14699605107307434, 0.009854838252067566, -0.37033611536026, -0.024973701685667038, -0.05517638102173805, 0.26649317145347595, 0.2125111222267151, 0.07207469642162323, 0.03295229375362396, -0.23411837220191956, -0.05721775442361832, -0.10119681060314178, -0.12842246890068054, -0.6543936133384705, 0.09142963588237762, 0.10127194225788116, -0.5258939266204834, -0.027124620974063873, -0.18084020912647247, 0.04340945929288864, -0.1741907149553299, -0.1758711338043213, -0.02401791885495186, 0.13013491034507751, -0.16595882177352905, -0.008232660591602325, 0.2092408984899521, 0.6641110181808472, 0.06569211930036545, -0.2337663620710373, -0.15413811802864075, -0.32532984018325806, 0.06073026359081268, 0.3088633418083191, -0.17285805940628052, 0.39849385619163513, -0.2845204174518585, 0.580757200717926, 0.000790327787399292, -0.46642976999282837, -0.7262557148933411, 0.34982091188430786, -0.08260530978441238, 0.27460479736328125, 0.10424058139324188, 0.04835512116551399, 0.2935149669647217, -0.04868682101368904, 0.211354598402977, 0.08484722673892975, 0.08597449958324432, -0.12034052610397339, -0.1358029842376709, -0.2515827715396881, -0.013664623722434044, 0.14004948735237122, 0.09743142873048782, 0.3722021281719208, 0.3517691493034363, 0.33165445923805237, 0.6285654902458191, 0.020645838230848312, -0.036972492933273315, 0.2745622396469116, 0.5249727964401245, -0.048632774502038956, -0.19210854172706604, -0.17666193842887878, -0.2890605330467224, 0.25386863946914673, -0.10740898549556732, 0.27406588196754456, -0.3012474775314331, -0.12781840562820435, -0.43559348583221436, 0.0668775886297226, -0.2966436743736267, 0.02236662060022354, 0.007067367434501648, -0.15515434741973877, 0.12587419152259827, 0.009479410946369171, 0.051061615347862244, 0.6214250326156616, -0.1856619417667389, 0.21813534200191498, -0.3008047938346863, 0.19291716814041138, -0.005668588448315859, -0.1607896089553833, 0.1599390208721161, 0.13451740145683289, 0.5338273048400879, -0.026586897671222687, -0.08566383272409439, 0.421622097492218, -0.17149555683135986, 0.09196744859218597, -0.3337697684764862, 0.23686867952346802, 0.345895379781723, -0.1611878126859665, -0.17515356838703156, 0.0986727774143219, 0.21438321471214294, 0.14856231212615967, -0.05771365761756897, 0.2181411236524582, 0.2656932473182678, 0.033175040036439896, -0.061979521065950394, 0.23261909186840057, 0.2944014072418213, 0.0027866140007972717, 0.0019441097974777222, 0.08097301423549652, 0.24295400083065033, 0.11289060860872269, -0.06539633870124817, -0.025341210886836052, 0.044316306710243225, 0.032838448882102966, 0.36926257610321045, -0.22003161907196045, 0.2944103181362152, 0.047858111560344696, -0.00827866792678833, -0.008479751646518707, 0.3803418278694153, 0.3283654451370239, 0.32564350962638855, 0.09218405932188034, -0.12036003917455673, 0.23958377540111542, -0.02513950690627098, -0.17344535887241364, 0.3853999972343445, -0.017228413373231888, -0.22051535546779633, 0.15953367948532104, -0.13404732942581177, -0.19883593916893005, -0.16763950884342194, -0.4307210445404053, -0.036258257925510406, 0.3685009479522705, -0.5825729966163635, -0.14441236853599548, -0.2938927710056305, -0.17056918144226074, 0.07233522832393646, -0.11394999921321869, -0.39726006984710693, -0.19774776697158813, 0.019625883549451828, 0.5626672506332397, -0.10103937238454819, 0.11861443519592285, -0.08043227344751358, 0.011486276984214783, -0.06237281486392021, 0.19467271864414215, -0.15936359763145447, 0.09921334683895111, -0.31962209939956665, -0.058280009776353836, 0.303349107503891, -0.12355727702379227, 0.04794790595769882, -0.24125832319259644, -0.18235813081264496, -0.4411284029483795, 0.16949936747550964, 0.1705792099237442, -0.17510250210762024, 0.409170001745224, 0.13404443860054016, 0.3379439413547516, 0.1903788447380066, 0.1096859946846962, 0.2887125611305237, 0.22408562898635864, -0.1570878028869629, -0.04427892714738846, -0.16566646099090576, -0.022582802921533585, -0.08744978159666061, -0.09199120104312897, -0.16295838356018066, -0.4005160927772522, 0.27000343799591064, -0.3703625500202179, 0.16847513616085052, 0.4286927878856659, 0.06198602914810181, 0.08471164107322693, -0.09086006879806519, -0.15867601335048676, -0.09859031438827515, -0.3248373866081238, 0.2998582720756531, 0.11364684998989105, -0.3338841497898102, -0.05695310980081558, 0.0859905555844307, 0.07909943908452988, -0.292316198348999, -0.43653300404548645, -0.1435989886522293, -0.21422120928764343, 0.2803303599357605, 0.0025293342769145966, -0.14266861975193024, 0.23180067539215088, -0.2732248604297638, 0.023146823048591614, 0.016965016722679138, -0.21566131711006165, 0.0670764371752739, 0.010476140305399895, 0.3478473424911499, -0.07651260495185852, 0.3513559401035309, 0.026130929589271545, 0.34979185461997986, 0.1984333097934723, 0.3158639073371887, 0.38522616028785706, -0.0537281408905983, 0.26139724254608154, 0.10157148540019989, -0.14808018505573273, 0.030921440571546555, 0.12697038054466248, -0.13834252953529358, 0.10881249606609344, 0.12465989589691162, 0.07097029685974121, -0.31702014803886414, -0.5742523670196533, -0.05743550509214401, -0.30862170457839966, -0.4599819779396057, 0.31301239132881165, -0.07758311927318573, 0.38665276765823364, 0.4452838897705078, 0.10630017518997192, -0.09869588166475296, 0.2773113250732422, 0.38878676295280457, 0.1897796243429184, 0.07632067799568176, -0.1771172732114792, -0.27192893624305725, -0.3709234595298767, 0.2242303192615509, 0.07249318808317184, 0.2402772307395935, -0.30152639746665955, 0.07766258716583252, 0.12134397774934769, -0.041969846934080124, 0.3528978228569031, -0.08038831502199173, 0.6159146428108215, -0.23009923100471497, 0.20723988115787506, -0.22239992022514343, -0.1577439308166504, 0.018248967826366425, -0.14138400554656982, 0.18066120147705078, 0.42769601941108704, -0.5877941846847534, 0.010643154382705688, -0.11366251111030579, -0.22375993430614471, -0.3114534914493561, -0.09309904277324677, -0.2576058506965637, -0.4546360969543457, -0.4896072745323181, 0.2433195412158966, 0.15483447909355164, 0.2070293128490448, 0.06497624516487122, -0.03502659499645233, 0.2392854243516922, 0.21879687905311584, -0.03654744476079941, 0.08314250409603119, 0.1150156706571579, 0.04199819639325142, 0.34373027086257935, 0.24708743393421173, 0.35576382279396057, 0.17591428756713867, 0.6639750599861145, 0.5626799464225769, -0.23023271560668945, -0.004132851958274841, 0.11013324558734894, -0.1410987228155136, 0.5136085152626038, 0.06634394824504852, 0.07985988259315491, 0.7597638368606567, 0.2528665363788605, -0.27303627133369446, -0.0009984038770198822, 0.24077236652374268, 0.021897047758102417, -0.15266966819763184, -0.20899111032485962, 0.15896743535995483, -0.30649858713150024, -0.0991877019405365, 0.1785781979560852, 0.41934290528297424, -0.020169729366898537, 0.13495893776416779, -0.14134156703948975, 1.088686466217041, 0.18313196301460266, 0.07597368955612183, 0.43394532799720764, -0.4744122326374054, 0.1279040426015854, -0.29606425762176514, 0.12735615670681, -0.03822223097085953, 0.04905697703361511, -0.1331041008234024, 0.11969603598117828, -0.15400196611881256, 0.04075903072953224, 0.030552655458450317, 0.32588011026382446, -0.049212872982025146, -0.10816076397895813, 0.06379196792840958, 0.13781234622001648, -0.4747120440006256, -0.12143535166978836, -0.46357133984565735, 0.0783674418926239, -0.10965979099273682, 0.500636637210846, -0.06702069938182831, -0.30010393261909485, -0.1321365386247635, -0.2555209994316101, -0.4757479727268219, 0.33804982900619507, 0.11440251767635345, 0.07898944616317749, 0.006290385499596596, 0.26861438155174255, -0.11805227398872375, -0.02567213401198387, 0.00650421716272831, 0.15344960987567902, -0.5712547302246094, 0.23242150247097015, -0.05614802613854408, -0.022341551259160042, 0.12904220819473267, -0.010354474186897278, 0.3320024013519287, -0.16329237818717957, -0.5239814519882202, -0.045583754777908325, -0.07642288506031036, -0.238118514418602, -0.13334524631500244, -0.13985760509967804, 0.24257442355155945, -0.19030369818210602, 0.008708223700523376, 0.04715932905673981, 0.15088021755218506, -0.27965396642684937, 0.033075809478759766, 0.08567258715629578, -0.09919354319572449, -0.12250567972660065, 0.2510603964328766, -0.35412144660949707, -0.09665066003799438, 0.4360445737838745, -0.19344893097877502, 0.15730911493301392, 0.5104482173919678, -0.13162930309772491, -0.15768685936927795, -0.18840628862380981, 0.08744847774505615, 0.08802579343318939, -0.5327839851379395, -0.01592104695737362, -0.019625304266810417, 0.12189403176307678, -0.44926732778549194, 0.13791964948177338, 0.34159013628959656, -0.10507407784461975, -0.02286098152399063, -0.3368982672691345, -0.19848071038722992, 0.08595225214958191, -0.18657784163951874, -0.018307944759726524, -0.17759530246257782, 0.27689817547798157, 0.13040441274642944, -0.2580571174621582, -0.21253103017807007, -0.056031931191682816, -0.33336931467056274, -0.18998679518699646, 0.09729446470737457, 0.12167279422283173, 0.04756816476583481, -0.22524553537368774, -0.0017254799604415894, 0.18275964260101318, -0.2938920855522156, -0.022611288353800774, -0.16655048727989197, 0.1898839771747589, 0.20727184414863586, -0.33079540729522705, -0.00749211385846138, -0.20830203592777252, -0.008118461817502975, 0.07644879072904587, 0.2587353587150574, 0.5852013230323792, 0.23585088551044464, -0.33047541975975037, 0.24516189098358154, 0.2726234495639801, -0.6120889186859131, 0.2626725435256958, 0.04181499034166336, 0.1436551809310913, -0.10843217372894287, -0.003381699323654175, -0.1850132793188095, -0.006830446422100067, -0.17989085614681244, -0.03943152725696564, 0.24793866276741028, 0.14886154234409332, 0.5709382891654968, -0.15832167863845825, 0.02782561630010605, 0.30763840675354004, 0.2982943058013916, -0.08276478946208954, -0.06902879476547241, -0.151149183511734, 0.04427695646882057, 0.13644427061080933, -0.24473947286605835, 0.058691758662462234, -0.05417752265930176, -0.08150812983512878, -0.05168113484978676, 0.042843982577323914, -0.08732803910970688, 0.0553150475025177, 0.04024166241288185, 0.06351111829280853, 0.3052489757537842, 0.5167137980461121, -0.12145823985338211, 0.14543956518173218, -0.1954861283302307, 0.13444028794765472, 0.3726135790348053, -0.31480470299720764, 0.14707627892494202, 0.4698861539363861, -0.2542370855808258, 0.07036752253770828, -0.09700998663902283, 0.3371080458164215, 0.07004164159297943, -0.3350706100463867, -0.11779803782701492, -0.18883055448532104, -0.14840073883533478, -0.21958336234092712, -0.20054230093955994, -0.01589040830731392, -0.3773273825645447, -0.10256122052669525, -0.19541580975055695, 0.16841834783554077, -0.2253764569759369, 0.08470853418111801, 0.04699726402759552, -0.1484605371952057, -0.1611018031835556, 0.061966672539711, 0.12334234267473221, -0.3837183117866516, 0.03805183619260788, -0.09038043022155762, -0.1862923949956894, -0.11323622614145279, -0.22034811973571777, 0.3356418311595917, 0.3138921856880188, -0.19761323928833008, 0.14470286667346954, 0.2575016915798187, -0.28503191471099854, 0.43289992213249207, 0.5137104392051697, 0.5138193964958191, 0.10800740867853165, 0.29635822772979736, 0.2243003249168396, 0.21105533838272095, 0.13111716508865356, 0.0583655908703804, 0.29181793332099915, 0.09802210330963135, 0.3544723391532898, 0.14918723702430725, 0.07617860287427902, -0.09697318077087402, 0.025527266785502434, -0.1734696328639984, 0.05290228873491287, -0.04719433933496475, 0.6683246493339539, -0.2581630051136017, 0.12196756899356842, -0.22736915946006775, -0.04505845531821251, -0.26821231842041016, 0.1457405835390091, 0.21966210007667542, -0.17659544944763184, 0.20320840179920197, -0.42767977714538574, 0.02984946221113205, -0.21123027801513672, 0.24297645688056946, 0.4580625295639038, -0.10234716534614563, -0.22541381418704987, 0.08980494737625122, -0.6377158761024475, 0.3143046498298645, -0.09975434839725494, -0.1257753223180771, 0.04813544079661369, 0.17482727766036987, -0.1693086475133896, 0.06353728473186493, 0.12172649800777435, 0.12121793627738953, -0.25117307901382446, 0.1666630655527115, -0.05846887081861496, -0.03808272257447243, 0.058093827217817307, 0.15651103854179382, -0.11942866444587708, -0.35113853216171265, 0.5051125288009644, -0.17309993505477905, -0.05530908703804016, 0.3530036509037018, -0.061433855444192886, 0.041913725435733795, -0.08998547494411469, 0.31096351146698, 0.12650325894355774, 0.38722848892211914, 0.042109787464141846, -0.19389969110488892, -0.2732853293418884, -0.1568191647529602, -0.25461673736572266, 0.03473344445228577, -0.09978309273719788, 0.30633047223091125, 0.10739296674728394, -0.08423327654600143, -0.21500781178474426, 0.4758688509464264, 0.030121348798274994, -0.19139999151229858, -0.24043911695480347, 0.040482714772224426, -0.2555764317512512, -0.009742394089698792, -0.07693107426166534, -0.20573097467422485, 0.10219859331846237, 0.11405423283576965, -0.3285716772079468, -0.4315008819103241, 0.8132106065750122, -0.3085569739341736, -0.00665496289730072, -0.22305062413215637, 0.49516117572784424, 0.2379680871963501, -0.310775488615036, -0.301699697971344, 0.058478355407714844, 0.20364487171173096, -0.05379505082964897, -0.1569199562072754, -0.06840495765209198, -0.31260111927986145, -0.10619852691888809, -0.025066494941711426, 0.07611473649740219, -0.08417966961860657, -0.5427252650260925, 0.618014931678772, -0.11091821640729904 ]
https://github.com/huggingface/datasets/issues/5953
Ok I see, this file is downloaded from the CV dataset script - let me investigate
Bad error message when trying to download gated dataset
### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
16
Bad error message when trying to download gated dataset ### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Ok I see, this file is downloaded from the CV dataset script - let me investigate
[ -0.2910834550857544, -0.24233008921146393, 0.11376997828483582, 0.28113362193107605, 0.4399706721305847, 0.1367226243019104, 0.28315269947052, 0.18023063242435455, 0.02009575068950653, 0.15855589509010315, -0.41839614510536194, -0.16160747408866882, 0.03821331635117531, 0.06896946579217911, 0.09538041055202484, 0.032373957335948944, 0.1215248703956604, -0.07715115696191788, 0.03349883854389191, -0.086275115609169, -0.21023842692375183, 0.025769973173737526, -0.22894561290740967, 0.44970083236694336, -0.2746562659740448, -0.016474667936563492, -0.03204021602869034, 0.5527821183204651, -0.17026221752166748, -0.304437518119812, 0.365519642829895, 0.05719923600554466, 0.07487547397613525, 0.20205792784690857, -0.00011953379726037383, 0.11945769190788269, 0.4015398621559143, -0.06258092820644379, -0.23526766896247864, -0.2491738498210907, -0.4586632251739502, -0.10343196243047714, -0.32971614599227905, -0.14405594766139984, -0.002043098211288452, -0.2154848277568817, 0.07323388010263443, 0.10686725378036499, 0.3369942307472229, 0.23172785341739655, 0.11226662993431091, 0.2569122314453125, 0.35404354333877563, -0.15269123017787933, -0.09855003654956818, -0.008254468441009521, -0.06660322099924088, 0.5634390115737915, 0.11621896922588348, 0.16239574551582336, 0.15930400788784027, 0.136821910738945, -0.2523663341999054, -0.014546910300850868, 0.49576887488365173, -0.16906200349330902, -0.15808455646038055, -0.3775421380996704, -0.01068251021206379, 0.49602773785591125, -0.010123331099748611, -0.050585925579071045, -0.34111204743385315, -0.4358579218387604, -0.05281969532370567, -0.1613587588071823, 0.20850634574890137, 0.30007481575012207, -0.30883365869522095, 0.36778509616851807, -0.34516823291778564, -0.1699851006269455, -0.0753726214170456, 0.0853542909026146, -0.0656762421131134, 0.35800454020500183, 0.14319130778312683, 0.15003269910812378, -0.033011097460985184, -0.26985087990760803, -0.2466515302658081, -0.28598853945732117, -0.2851129174232483, 0.132000133395195, -0.16588057577610016, -0.15979713201522827, 0.24964916706085205, 0.37853139638900757, 0.24190999567508698, 0.2913118898868561, -0.5035306811332703, 0.060302212834358215, -0.21706324815750122, -0.04339517652988434, 0.28527599573135376, 0.05687978118658066, -0.023343820124864578, 0.16308987140655518, 0.4708404242992401, 0.4824879765510559, 0.19592466950416565, 0.037902697920799255, 0.022440072149038315, 0.04341788962483406, -0.02638472616672516, 0.05899864062666893, 0.3890644609928131, -0.4395676851272583, -0.3730820417404175, 0.024059727787971497, -0.1778060495853424, 0.10459442436695099, 0.12995727360248566, 0.5462892651557922, -0.11972609162330627, -0.14243149757385254, -0.10674985498189926, 0.1528814435005188, -0.21953406929969788, -0.4129561185836792, -0.13279828429222107, -0.17960548400878906, 0.027463369071483612, 0.15213629603385925, -0.03406207635998726, -0.1943729668855667, 0.19683171808719635, -0.2965853214263916, -0.14699605107307434, 0.009854838252067566, -0.37033611536026, -0.024973701685667038, -0.05517638102173805, 0.26649317145347595, 0.2125111222267151, 0.07207469642162323, 0.03295229375362396, -0.23411837220191956, -0.05721775442361832, -0.10119681060314178, -0.12842246890068054, -0.6543936133384705, 0.09142963588237762, 0.10127194225788116, -0.5258939266204834, -0.027124620974063873, -0.18084020912647247, 0.04340945929288864, -0.1741907149553299, -0.1758711338043213, -0.02401791885495186, 0.13013491034507751, -0.16595882177352905, -0.008232660591602325, 0.2092408984899521, 0.6641110181808472, 0.06569211930036545, -0.2337663620710373, -0.15413811802864075, -0.32532984018325806, 0.06073026359081268, 0.3088633418083191, -0.17285805940628052, 0.39849385619163513, -0.2845204174518585, 0.580757200717926, 0.000790327787399292, -0.46642976999282837, -0.7262557148933411, 0.34982091188430786, -0.08260530978441238, 0.27460479736328125, 0.10424058139324188, 0.04835512116551399, 0.2935149669647217, -0.04868682101368904, 0.211354598402977, 0.08484722673892975, 0.08597449958324432, -0.12034052610397339, -0.1358029842376709, -0.2515827715396881, -0.013664623722434044, 0.14004948735237122, 0.09743142873048782, 0.3722021281719208, 0.3517691493034363, 0.33165445923805237, 0.6285654902458191, 0.020645838230848312, -0.036972492933273315, 0.2745622396469116, 0.5249727964401245, -0.048632774502038956, -0.19210854172706604, -0.17666193842887878, -0.2890605330467224, 0.25386863946914673, -0.10740898549556732, 0.27406588196754456, -0.3012474775314331, -0.12781840562820435, -0.43559348583221436, 0.0668775886297226, -0.2966436743736267, 0.02236662060022354, 0.007067367434501648, -0.15515434741973877, 0.12587419152259827, 0.009479410946369171, 0.051061615347862244, 0.6214250326156616, -0.1856619417667389, 0.21813534200191498, -0.3008047938346863, 0.19291716814041138, -0.005668588448315859, -0.1607896089553833, 0.1599390208721161, 0.13451740145683289, 0.5338273048400879, -0.026586897671222687, -0.08566383272409439, 0.421622097492218, -0.17149555683135986, 0.09196744859218597, -0.3337697684764862, 0.23686867952346802, 0.345895379781723, -0.1611878126859665, -0.17515356838703156, 0.0986727774143219, 0.21438321471214294, 0.14856231212615967, -0.05771365761756897, 0.2181411236524582, 0.2656932473182678, 0.033175040036439896, -0.061979521065950394, 0.23261909186840057, 0.2944014072418213, 0.0027866140007972717, 0.0019441097974777222, 0.08097301423549652, 0.24295400083065033, 0.11289060860872269, -0.06539633870124817, -0.025341210886836052, 0.044316306710243225, 0.032838448882102966, 0.36926257610321045, -0.22003161907196045, 0.2944103181362152, 0.047858111560344696, -0.00827866792678833, -0.008479751646518707, 0.3803418278694153, 0.3283654451370239, 0.32564350962638855, 0.09218405932188034, -0.12036003917455673, 0.23958377540111542, -0.02513950690627098, -0.17344535887241364, 0.3853999972343445, -0.017228413373231888, -0.22051535546779633, 0.15953367948532104, -0.13404732942581177, -0.19883593916893005, -0.16763950884342194, -0.4307210445404053, -0.036258257925510406, 0.3685009479522705, -0.5825729966163635, -0.14441236853599548, -0.2938927710056305, -0.17056918144226074, 0.07233522832393646, -0.11394999921321869, -0.39726006984710693, -0.19774776697158813, 0.019625883549451828, 0.5626672506332397, -0.10103937238454819, 0.11861443519592285, -0.08043227344751358, 0.011486276984214783, -0.06237281486392021, 0.19467271864414215, -0.15936359763145447, 0.09921334683895111, -0.31962209939956665, -0.058280009776353836, 0.303349107503891, -0.12355727702379227, 0.04794790595769882, -0.24125832319259644, -0.18235813081264496, -0.4411284029483795, 0.16949936747550964, 0.1705792099237442, -0.17510250210762024, 0.409170001745224, 0.13404443860054016, 0.3379439413547516, 0.1903788447380066, 0.1096859946846962, 0.2887125611305237, 0.22408562898635864, -0.1570878028869629, -0.04427892714738846, -0.16566646099090576, -0.022582802921533585, -0.08744978159666061, -0.09199120104312897, -0.16295838356018066, -0.4005160927772522, 0.27000343799591064, -0.3703625500202179, 0.16847513616085052, 0.4286927878856659, 0.06198602914810181, 0.08471164107322693, -0.09086006879806519, -0.15867601335048676, -0.09859031438827515, -0.3248373866081238, 0.2998582720756531, 0.11364684998989105, -0.3338841497898102, -0.05695310980081558, 0.0859905555844307, 0.07909943908452988, -0.292316198348999, -0.43653300404548645, -0.1435989886522293, -0.21422120928764343, 0.2803303599357605, 0.0025293342769145966, -0.14266861975193024, 0.23180067539215088, -0.2732248604297638, 0.023146823048591614, 0.016965016722679138, -0.21566131711006165, 0.0670764371752739, 0.010476140305399895, 0.3478473424911499, -0.07651260495185852, 0.3513559401035309, 0.026130929589271545, 0.34979185461997986, 0.1984333097934723, 0.3158639073371887, 0.38522616028785706, -0.0537281408905983, 0.26139724254608154, 0.10157148540019989, -0.14808018505573273, 0.030921440571546555, 0.12697038054466248, -0.13834252953529358, 0.10881249606609344, 0.12465989589691162, 0.07097029685974121, -0.31702014803886414, -0.5742523670196533, -0.05743550509214401, -0.30862170457839966, -0.4599819779396057, 0.31301239132881165, -0.07758311927318573, 0.38665276765823364, 0.4452838897705078, 0.10630017518997192, -0.09869588166475296, 0.2773113250732422, 0.38878676295280457, 0.1897796243429184, 0.07632067799568176, -0.1771172732114792, -0.27192893624305725, -0.3709234595298767, 0.2242303192615509, 0.07249318808317184, 0.2402772307395935, -0.30152639746665955, 0.07766258716583252, 0.12134397774934769, -0.041969846934080124, 0.3528978228569031, -0.08038831502199173, 0.6159146428108215, -0.23009923100471497, 0.20723988115787506, -0.22239992022514343, -0.1577439308166504, 0.018248967826366425, -0.14138400554656982, 0.18066120147705078, 0.42769601941108704, -0.5877941846847534, 0.010643154382705688, -0.11366251111030579, -0.22375993430614471, -0.3114534914493561, -0.09309904277324677, -0.2576058506965637, -0.4546360969543457, -0.4896072745323181, 0.2433195412158966, 0.15483447909355164, 0.2070293128490448, 0.06497624516487122, -0.03502659499645233, 0.2392854243516922, 0.21879687905311584, -0.03654744476079941, 0.08314250409603119, 0.1150156706571579, 0.04199819639325142, 0.34373027086257935, 0.24708743393421173, 0.35576382279396057, 0.17591428756713867, 0.6639750599861145, 0.5626799464225769, -0.23023271560668945, -0.004132851958274841, 0.11013324558734894, -0.1410987228155136, 0.5136085152626038, 0.06634394824504852, 0.07985988259315491, 0.7597638368606567, 0.2528665363788605, -0.27303627133369446, -0.0009984038770198822, 0.24077236652374268, 0.021897047758102417, -0.15266966819763184, -0.20899111032485962, 0.15896743535995483, -0.30649858713150024, -0.0991877019405365, 0.1785781979560852, 0.41934290528297424, -0.020169729366898537, 0.13495893776416779, -0.14134156703948975, 1.088686466217041, 0.18313196301460266, 0.07597368955612183, 0.43394532799720764, -0.4744122326374054, 0.1279040426015854, -0.29606425762176514, 0.12735615670681, -0.03822223097085953, 0.04905697703361511, -0.1331041008234024, 0.11969603598117828, -0.15400196611881256, 0.04075903072953224, 0.030552655458450317, 0.32588011026382446, -0.049212872982025146, -0.10816076397895813, 0.06379196792840958, 0.13781234622001648, -0.4747120440006256, -0.12143535166978836, -0.46357133984565735, 0.0783674418926239, -0.10965979099273682, 0.500636637210846, -0.06702069938182831, -0.30010393261909485, -0.1321365386247635, -0.2555209994316101, -0.4757479727268219, 0.33804982900619507, 0.11440251767635345, 0.07898944616317749, 0.006290385499596596, 0.26861438155174255, -0.11805227398872375, -0.02567213401198387, 0.00650421716272831, 0.15344960987567902, -0.5712547302246094, 0.23242150247097015, -0.05614802613854408, -0.022341551259160042, 0.12904220819473267, -0.010354474186897278, 0.3320024013519287, -0.16329237818717957, -0.5239814519882202, -0.045583754777908325, -0.07642288506031036, -0.238118514418602, -0.13334524631500244, -0.13985760509967804, 0.24257442355155945, -0.19030369818210602, 0.008708223700523376, 0.04715932905673981, 0.15088021755218506, -0.27965396642684937, 0.033075809478759766, 0.08567258715629578, -0.09919354319572449, -0.12250567972660065, 0.2510603964328766, -0.35412144660949707, -0.09665066003799438, 0.4360445737838745, -0.19344893097877502, 0.15730911493301392, 0.5104482173919678, -0.13162930309772491, -0.15768685936927795, -0.18840628862380981, 0.08744847774505615, 0.08802579343318939, -0.5327839851379395, -0.01592104695737362, -0.019625304266810417, 0.12189403176307678, -0.44926732778549194, 0.13791964948177338, 0.34159013628959656, -0.10507407784461975, -0.02286098152399063, -0.3368982672691345, -0.19848071038722992, 0.08595225214958191, -0.18657784163951874, -0.018307944759726524, -0.17759530246257782, 0.27689817547798157, 0.13040441274642944, -0.2580571174621582, -0.21253103017807007, -0.056031931191682816, -0.33336931467056274, -0.18998679518699646, 0.09729446470737457, 0.12167279422283173, 0.04756816476583481, -0.22524553537368774, -0.0017254799604415894, 0.18275964260101318, -0.2938920855522156, -0.022611288353800774, -0.16655048727989197, 0.1898839771747589, 0.20727184414863586, -0.33079540729522705, -0.00749211385846138, -0.20830203592777252, -0.008118461817502975, 0.07644879072904587, 0.2587353587150574, 0.5852013230323792, 0.23585088551044464, -0.33047541975975037, 0.24516189098358154, 0.2726234495639801, -0.6120889186859131, 0.2626725435256958, 0.04181499034166336, 0.1436551809310913, -0.10843217372894287, -0.003381699323654175, -0.1850132793188095, -0.006830446422100067, -0.17989085614681244, -0.03943152725696564, 0.24793866276741028, 0.14886154234409332, 0.5709382891654968, -0.15832167863845825, 0.02782561630010605, 0.30763840675354004, 0.2982943058013916, -0.08276478946208954, -0.06902879476547241, -0.151149183511734, 0.04427695646882057, 0.13644427061080933, -0.24473947286605835, 0.058691758662462234, -0.05417752265930176, -0.08150812983512878, -0.05168113484978676, 0.042843982577323914, -0.08732803910970688, 0.0553150475025177, 0.04024166241288185, 0.06351111829280853, 0.3052489757537842, 0.5167137980461121, -0.12145823985338211, 0.14543956518173218, -0.1954861283302307, 0.13444028794765472, 0.3726135790348053, -0.31480470299720764, 0.14707627892494202, 0.4698861539363861, -0.2542370855808258, 0.07036752253770828, -0.09700998663902283, 0.3371080458164215, 0.07004164159297943, -0.3350706100463867, -0.11779803782701492, -0.18883055448532104, -0.14840073883533478, -0.21958336234092712, -0.20054230093955994, -0.01589040830731392, -0.3773273825645447, -0.10256122052669525, -0.19541580975055695, 0.16841834783554077, -0.2253764569759369, 0.08470853418111801, 0.04699726402759552, -0.1484605371952057, -0.1611018031835556, 0.061966672539711, 0.12334234267473221, -0.3837183117866516, 0.03805183619260788, -0.09038043022155762, -0.1862923949956894, -0.11323622614145279, -0.22034811973571777, 0.3356418311595917, 0.3138921856880188, -0.19761323928833008, 0.14470286667346954, 0.2575016915798187, -0.28503191471099854, 0.43289992213249207, 0.5137104392051697, 0.5138193964958191, 0.10800740867853165, 0.29635822772979736, 0.2243003249168396, 0.21105533838272095, 0.13111716508865356, 0.0583655908703804, 0.29181793332099915, 0.09802210330963135, 0.3544723391532898, 0.14918723702430725, 0.07617860287427902, -0.09697318077087402, 0.025527266785502434, -0.1734696328639984, 0.05290228873491287, -0.04719433933496475, 0.6683246493339539, -0.2581630051136017, 0.12196756899356842, -0.22736915946006775, -0.04505845531821251, -0.26821231842041016, 0.1457405835390091, 0.21966210007667542, -0.17659544944763184, 0.20320840179920197, -0.42767977714538574, 0.02984946221113205, -0.21123027801513672, 0.24297645688056946, 0.4580625295639038, -0.10234716534614563, -0.22541381418704987, 0.08980494737625122, -0.6377158761024475, 0.3143046498298645, -0.09975434839725494, -0.1257753223180771, 0.04813544079661369, 0.17482727766036987, -0.1693086475133896, 0.06353728473186493, 0.12172649800777435, 0.12121793627738953, -0.25117307901382446, 0.1666630655527115, -0.05846887081861496, -0.03808272257447243, 0.058093827217817307, 0.15651103854179382, -0.11942866444587708, -0.35113853216171265, 0.5051125288009644, -0.17309993505477905, -0.05530908703804016, 0.3530036509037018, -0.061433855444192886, 0.041913725435733795, -0.08998547494411469, 0.31096351146698, 0.12650325894355774, 0.38722848892211914, 0.042109787464141846, -0.19389969110488892, -0.2732853293418884, -0.1568191647529602, -0.25461673736572266, 0.03473344445228577, -0.09978309273719788, 0.30633047223091125, 0.10739296674728394, -0.08423327654600143, -0.21500781178474426, 0.4758688509464264, 0.030121348798274994, -0.19139999151229858, -0.24043911695480347, 0.040482714772224426, -0.2555764317512512, -0.009742394089698792, -0.07693107426166534, -0.20573097467422485, 0.10219859331846237, 0.11405423283576965, -0.3285716772079468, -0.4315008819103241, 0.8132106065750122, -0.3085569739341736, -0.00665496289730072, -0.22305062413215637, 0.49516117572784424, 0.2379680871963501, -0.310775488615036, -0.301699697971344, 0.058478355407714844, 0.20364487171173096, -0.05379505082964897, -0.1569199562072754, -0.06840495765209198, -0.31260111927986145, -0.10619852691888809, -0.025066494941711426, 0.07611473649740219, -0.08417966961860657, -0.5427252650260925, 0.618014931678772, -0.11091821640729904 ]
https://github.com/huggingface/datasets/issues/5953
Ok I see: when you log out you no longer have access to the repository. Therefore the dataset script is loaded from cache: ``` WARNING:datasets.load:Using the latest cached version of the module from /root/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_13_0/22809012aac1fc9803eaffc44122e4149043748e93933935d5ea19898587e4d7 (last modified on Wed Jun 14 10:13:17 2023) since it couldn't be found locally at mozilla-foundation/common_voice_13_0., or remotely on the Hugging Face Hub. ``` and the script tries to download the n_shards.json but fails
Bad error message when trying to download gated dataset
### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
68
Bad error message when trying to download gated dataset ### Describe the bug When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.: E.g. ```sh Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0. Please make sure you specified the correct `repo_id` and `repo_type`. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.. Will try to load from local cache. ``` If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO: ```sh File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs) 427 except Exception as exc: 428 if policy == "get": 429 # If get failed, then raise a FileNotFoundError --> 430 raise FileNotFoundError(url) from exc 431 logger.debug(str(exc)) 433 return {"name": url, "size": None, **info, "type": "file"} FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json ``` ### Steps to reproduce the bug ``` huggingface-cli logout ``` and then: ```py from datasets import load_dataset, Audio # English stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) en_sample = next(iter(stream_data))["audio"]["array"] # Swahili stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True) stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000)) sw_sample = next(iter(stream_data))["audio"]["array"] ``` ### Expected behavior Better error message ### Environment info Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.12.0 - Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.0.dev0 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Ok I see: when you log out you no longer have access to the repository. Therefore the dataset script is loaded from cache: ``` WARNING:datasets.load:Using the latest cached version of the module from /root/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_13_0/22809012aac1fc9803eaffc44122e4149043748e93933935d5ea19898587e4d7 (last modified on Wed Jun 14 10:13:17 2023) since it couldn't be found locally at mozilla-foundation/common_voice_13_0., or remotely on the Hugging Face Hub. ``` and the script tries to download the n_shards.json but fails
[ -0.2910834550857544, -0.24233008921146393, 0.11376997828483582, 0.28113362193107605, 0.4399706721305847, 0.1367226243019104, 0.28315269947052, 0.18023063242435455, 0.02009575068950653, 0.15855589509010315, -0.41839614510536194, -0.16160747408866882, 0.03821331635117531, 0.06896946579217911, 0.09538041055202484, 0.032373957335948944, 0.1215248703956604, -0.07715115696191788, 0.03349883854389191, -0.086275115609169, -0.21023842692375183, 0.025769973173737526, -0.22894561290740967, 0.44970083236694336, -0.2746562659740448, -0.016474667936563492, -0.03204021602869034, 0.5527821183204651, -0.17026221752166748, -0.304437518119812, 0.365519642829895, 0.05719923600554466, 0.07487547397613525, 0.20205792784690857, -0.00011953379726037383, 0.11945769190788269, 0.4015398621559143, -0.06258092820644379, -0.23526766896247864, -0.2491738498210907, -0.4586632251739502, -0.10343196243047714, -0.32971614599227905, -0.14405594766139984, -0.002043098211288452, -0.2154848277568817, 0.07323388010263443, 0.10686725378036499, 0.3369942307472229, 0.23172785341739655, 0.11226662993431091, 0.2569122314453125, 0.35404354333877563, -0.15269123017787933, -0.09855003654956818, -0.008254468441009521, -0.06660322099924088, 0.5634390115737915, 0.11621896922588348, 0.16239574551582336, 0.15930400788784027, 0.136821910738945, -0.2523663341999054, -0.014546910300850868, 0.49576887488365173, -0.16906200349330902, -0.15808455646038055, -0.3775421380996704, -0.01068251021206379, 0.49602773785591125, -0.010123331099748611, -0.050585925579071045, -0.34111204743385315, -0.4358579218387604, -0.05281969532370567, -0.1613587588071823, 0.20850634574890137, 0.30007481575012207, -0.30883365869522095, 0.36778509616851807, -0.34516823291778564, -0.1699851006269455, -0.0753726214170456, 0.0853542909026146, -0.0656762421131134, 0.35800454020500183, 0.14319130778312683, 0.15003269910812378, -0.033011097460985184, -0.26985087990760803, -0.2466515302658081, -0.28598853945732117, -0.2851129174232483, 0.132000133395195, -0.16588057577610016, -0.15979713201522827, 0.24964916706085205, 0.37853139638900757, 0.24190999567508698, 0.2913118898868561, -0.5035306811332703, 0.060302212834358215, -0.21706324815750122, -0.04339517652988434, 0.28527599573135376, 0.05687978118658066, -0.023343820124864578, 0.16308987140655518, 0.4708404242992401, 0.4824879765510559, 0.19592466950416565, 0.037902697920799255, 0.022440072149038315, 0.04341788962483406, -0.02638472616672516, 0.05899864062666893, 0.3890644609928131, -0.4395676851272583, -0.3730820417404175, 0.024059727787971497, -0.1778060495853424, 0.10459442436695099, 0.12995727360248566, 0.5462892651557922, -0.11972609162330627, -0.14243149757385254, -0.10674985498189926, 0.1528814435005188, -0.21953406929969788, -0.4129561185836792, -0.13279828429222107, -0.17960548400878906, 0.027463369071483612, 0.15213629603385925, -0.03406207635998726, -0.1943729668855667, 0.19683171808719635, -0.2965853214263916, -0.14699605107307434, 0.009854838252067566, -0.37033611536026, -0.024973701685667038, -0.05517638102173805, 0.26649317145347595, 0.2125111222267151, 0.07207469642162323, 0.03295229375362396, -0.23411837220191956, -0.05721775442361832, -0.10119681060314178, -0.12842246890068054, -0.6543936133384705, 0.09142963588237762, 0.10127194225788116, -0.5258939266204834, -0.027124620974063873, -0.18084020912647247, 0.04340945929288864, -0.1741907149553299, -0.1758711338043213, -0.02401791885495186, 0.13013491034507751, -0.16595882177352905, -0.008232660591602325, 0.2092408984899521, 0.6641110181808472, 0.06569211930036545, -0.2337663620710373, -0.15413811802864075, -0.32532984018325806, 0.06073026359081268, 0.3088633418083191, -0.17285805940628052, 0.39849385619163513, -0.2845204174518585, 0.580757200717926, 0.000790327787399292, -0.46642976999282837, -0.7262557148933411, 0.34982091188430786, -0.08260530978441238, 0.27460479736328125, 0.10424058139324188, 0.04835512116551399, 0.2935149669647217, -0.04868682101368904, 0.211354598402977, 0.08484722673892975, 0.08597449958324432, -0.12034052610397339, -0.1358029842376709, -0.2515827715396881, -0.013664623722434044, 0.14004948735237122, 0.09743142873048782, 0.3722021281719208, 0.3517691493034363, 0.33165445923805237, 0.6285654902458191, 0.020645838230848312, -0.036972492933273315, 0.2745622396469116, 0.5249727964401245, -0.048632774502038956, -0.19210854172706604, -0.17666193842887878, -0.2890605330467224, 0.25386863946914673, -0.10740898549556732, 0.27406588196754456, -0.3012474775314331, -0.12781840562820435, -0.43559348583221436, 0.0668775886297226, -0.2966436743736267, 0.02236662060022354, 0.007067367434501648, -0.15515434741973877, 0.12587419152259827, 0.009479410946369171, 0.051061615347862244, 0.6214250326156616, -0.1856619417667389, 0.21813534200191498, -0.3008047938346863, 0.19291716814041138, -0.005668588448315859, -0.1607896089553833, 0.1599390208721161, 0.13451740145683289, 0.5338273048400879, -0.026586897671222687, -0.08566383272409439, 0.421622097492218, -0.17149555683135986, 0.09196744859218597, -0.3337697684764862, 0.23686867952346802, 0.345895379781723, -0.1611878126859665, -0.17515356838703156, 0.0986727774143219, 0.21438321471214294, 0.14856231212615967, -0.05771365761756897, 0.2181411236524582, 0.2656932473182678, 0.033175040036439896, -0.061979521065950394, 0.23261909186840057, 0.2944014072418213, 0.0027866140007972717, 0.0019441097974777222, 0.08097301423549652, 0.24295400083065033, 0.11289060860872269, -0.06539633870124817, -0.025341210886836052, 0.044316306710243225, 0.032838448882102966, 0.36926257610321045, -0.22003161907196045, 0.2944103181362152, 0.047858111560344696, -0.00827866792678833, -0.008479751646518707, 0.3803418278694153, 0.3283654451370239, 0.32564350962638855, 0.09218405932188034, -0.12036003917455673, 0.23958377540111542, -0.02513950690627098, -0.17344535887241364, 0.3853999972343445, -0.017228413373231888, -0.22051535546779633, 0.15953367948532104, -0.13404732942581177, -0.19883593916893005, -0.16763950884342194, -0.4307210445404053, -0.036258257925510406, 0.3685009479522705, -0.5825729966163635, -0.14441236853599548, -0.2938927710056305, -0.17056918144226074, 0.07233522832393646, -0.11394999921321869, -0.39726006984710693, -0.19774776697158813, 0.019625883549451828, 0.5626672506332397, -0.10103937238454819, 0.11861443519592285, -0.08043227344751358, 0.011486276984214783, -0.06237281486392021, 0.19467271864414215, -0.15936359763145447, 0.09921334683895111, -0.31962209939956665, -0.058280009776353836, 0.303349107503891, -0.12355727702379227, 0.04794790595769882, -0.24125832319259644, -0.18235813081264496, -0.4411284029483795, 0.16949936747550964, 0.1705792099237442, -0.17510250210762024, 0.409170001745224, 0.13404443860054016, 0.3379439413547516, 0.1903788447380066, 0.1096859946846962, 0.2887125611305237, 0.22408562898635864, -0.1570878028869629, -0.04427892714738846, -0.16566646099090576, -0.022582802921533585, -0.08744978159666061, -0.09199120104312897, -0.16295838356018066, -0.4005160927772522, 0.27000343799591064, -0.3703625500202179, 0.16847513616085052, 0.4286927878856659, 0.06198602914810181, 0.08471164107322693, -0.09086006879806519, -0.15867601335048676, -0.09859031438827515, -0.3248373866081238, 0.2998582720756531, 0.11364684998989105, -0.3338841497898102, -0.05695310980081558, 0.0859905555844307, 0.07909943908452988, -0.292316198348999, -0.43653300404548645, -0.1435989886522293, -0.21422120928764343, 0.2803303599357605, 0.0025293342769145966, -0.14266861975193024, 0.23180067539215088, -0.2732248604297638, 0.023146823048591614, 0.016965016722679138, -0.21566131711006165, 0.0670764371752739, 0.010476140305399895, 0.3478473424911499, -0.07651260495185852, 0.3513559401035309, 0.026130929589271545, 0.34979185461997986, 0.1984333097934723, 0.3158639073371887, 0.38522616028785706, -0.0537281408905983, 0.26139724254608154, 0.10157148540019989, -0.14808018505573273, 0.030921440571546555, 0.12697038054466248, -0.13834252953529358, 0.10881249606609344, 0.12465989589691162, 0.07097029685974121, -0.31702014803886414, -0.5742523670196533, -0.05743550509214401, -0.30862170457839966, -0.4599819779396057, 0.31301239132881165, -0.07758311927318573, 0.38665276765823364, 0.4452838897705078, 0.10630017518997192, -0.09869588166475296, 0.2773113250732422, 0.38878676295280457, 0.1897796243429184, 0.07632067799568176, -0.1771172732114792, -0.27192893624305725, -0.3709234595298767, 0.2242303192615509, 0.07249318808317184, 0.2402772307395935, -0.30152639746665955, 0.07766258716583252, 0.12134397774934769, -0.041969846934080124, 0.3528978228569031, -0.08038831502199173, 0.6159146428108215, -0.23009923100471497, 0.20723988115787506, -0.22239992022514343, -0.1577439308166504, 0.018248967826366425, -0.14138400554656982, 0.18066120147705078, 0.42769601941108704, -0.5877941846847534, 0.010643154382705688, -0.11366251111030579, -0.22375993430614471, -0.3114534914493561, -0.09309904277324677, -0.2576058506965637, -0.4546360969543457, -0.4896072745323181, 0.2433195412158966, 0.15483447909355164, 0.2070293128490448, 0.06497624516487122, -0.03502659499645233, 0.2392854243516922, 0.21879687905311584, -0.03654744476079941, 0.08314250409603119, 0.1150156706571579, 0.04199819639325142, 0.34373027086257935, 0.24708743393421173, 0.35576382279396057, 0.17591428756713867, 0.6639750599861145, 0.5626799464225769, -0.23023271560668945, -0.004132851958274841, 0.11013324558734894, -0.1410987228155136, 0.5136085152626038, 0.06634394824504852, 0.07985988259315491, 0.7597638368606567, 0.2528665363788605, -0.27303627133369446, -0.0009984038770198822, 0.24077236652374268, 0.021897047758102417, -0.15266966819763184, -0.20899111032485962, 0.15896743535995483, -0.30649858713150024, -0.0991877019405365, 0.1785781979560852, 0.41934290528297424, -0.020169729366898537, 0.13495893776416779, -0.14134156703948975, 1.088686466217041, 0.18313196301460266, 0.07597368955612183, 0.43394532799720764, -0.4744122326374054, 0.1279040426015854, -0.29606425762176514, 0.12735615670681, -0.03822223097085953, 0.04905697703361511, -0.1331041008234024, 0.11969603598117828, -0.15400196611881256, 0.04075903072953224, 0.030552655458450317, 0.32588011026382446, -0.049212872982025146, -0.10816076397895813, 0.06379196792840958, 0.13781234622001648, -0.4747120440006256, -0.12143535166978836, -0.46357133984565735, 0.0783674418926239, -0.10965979099273682, 0.500636637210846, -0.06702069938182831, -0.30010393261909485, -0.1321365386247635, -0.2555209994316101, -0.4757479727268219, 0.33804982900619507, 0.11440251767635345, 0.07898944616317749, 0.006290385499596596, 0.26861438155174255, -0.11805227398872375, -0.02567213401198387, 0.00650421716272831, 0.15344960987567902, -0.5712547302246094, 0.23242150247097015, -0.05614802613854408, -0.022341551259160042, 0.12904220819473267, -0.010354474186897278, 0.3320024013519287, -0.16329237818717957, -0.5239814519882202, -0.045583754777908325, -0.07642288506031036, -0.238118514418602, -0.13334524631500244, -0.13985760509967804, 0.24257442355155945, -0.19030369818210602, 0.008708223700523376, 0.04715932905673981, 0.15088021755218506, -0.27965396642684937, 0.033075809478759766, 0.08567258715629578, -0.09919354319572449, -0.12250567972660065, 0.2510603964328766, -0.35412144660949707, -0.09665066003799438, 0.4360445737838745, -0.19344893097877502, 0.15730911493301392, 0.5104482173919678, -0.13162930309772491, -0.15768685936927795, -0.18840628862380981, 0.08744847774505615, 0.08802579343318939, -0.5327839851379395, -0.01592104695737362, -0.019625304266810417, 0.12189403176307678, -0.44926732778549194, 0.13791964948177338, 0.34159013628959656, -0.10507407784461975, -0.02286098152399063, -0.3368982672691345, -0.19848071038722992, 0.08595225214958191, -0.18657784163951874, -0.018307944759726524, -0.17759530246257782, 0.27689817547798157, 0.13040441274642944, -0.2580571174621582, -0.21253103017807007, -0.056031931191682816, -0.33336931467056274, -0.18998679518699646, 0.09729446470737457, 0.12167279422283173, 0.04756816476583481, -0.22524553537368774, -0.0017254799604415894, 0.18275964260101318, -0.2938920855522156, -0.022611288353800774, -0.16655048727989197, 0.1898839771747589, 0.20727184414863586, -0.33079540729522705, -0.00749211385846138, -0.20830203592777252, -0.008118461817502975, 0.07644879072904587, 0.2587353587150574, 0.5852013230323792, 0.23585088551044464, -0.33047541975975037, 0.24516189098358154, 0.2726234495639801, -0.6120889186859131, 0.2626725435256958, 0.04181499034166336, 0.1436551809310913, -0.10843217372894287, -0.003381699323654175, -0.1850132793188095, -0.006830446422100067, -0.17989085614681244, -0.03943152725696564, 0.24793866276741028, 0.14886154234409332, 0.5709382891654968, -0.15832167863845825, 0.02782561630010605, 0.30763840675354004, 0.2982943058013916, -0.08276478946208954, -0.06902879476547241, -0.151149183511734, 0.04427695646882057, 0.13644427061080933, -0.24473947286605835, 0.058691758662462234, -0.05417752265930176, -0.08150812983512878, -0.05168113484978676, 0.042843982577323914, -0.08732803910970688, 0.0553150475025177, 0.04024166241288185, 0.06351111829280853, 0.3052489757537842, 0.5167137980461121, -0.12145823985338211, 0.14543956518173218, -0.1954861283302307, 0.13444028794765472, 0.3726135790348053, -0.31480470299720764, 0.14707627892494202, 0.4698861539363861, -0.2542370855808258, 0.07036752253770828, -0.09700998663902283, 0.3371080458164215, 0.07004164159297943, -0.3350706100463867, -0.11779803782701492, -0.18883055448532104, -0.14840073883533478, -0.21958336234092712, -0.20054230093955994, -0.01589040830731392, -0.3773273825645447, -0.10256122052669525, -0.19541580975055695, 0.16841834783554077, -0.2253764569759369, 0.08470853418111801, 0.04699726402759552, -0.1484605371952057, -0.1611018031835556, 0.061966672539711, 0.12334234267473221, -0.3837183117866516, 0.03805183619260788, -0.09038043022155762, -0.1862923949956894, -0.11323622614145279, -0.22034811973571777, 0.3356418311595917, 0.3138921856880188, -0.19761323928833008, 0.14470286667346954, 0.2575016915798187, -0.28503191471099854, 0.43289992213249207, 0.5137104392051697, 0.5138193964958191, 0.10800740867853165, 0.29635822772979736, 0.2243003249168396, 0.21105533838272095, 0.13111716508865356, 0.0583655908703804, 0.29181793332099915, 0.09802210330963135, 0.3544723391532898, 0.14918723702430725, 0.07617860287427902, -0.09697318077087402, 0.025527266785502434, -0.1734696328639984, 0.05290228873491287, -0.04719433933496475, 0.6683246493339539, -0.2581630051136017, 0.12196756899356842, -0.22736915946006775, -0.04505845531821251, -0.26821231842041016, 0.1457405835390091, 0.21966210007667542, -0.17659544944763184, 0.20320840179920197, -0.42767977714538574, 0.02984946221113205, -0.21123027801513672, 0.24297645688056946, 0.4580625295639038, -0.10234716534614563, -0.22541381418704987, 0.08980494737625122, -0.6377158761024475, 0.3143046498298645, -0.09975434839725494, -0.1257753223180771, 0.04813544079661369, 0.17482727766036987, -0.1693086475133896, 0.06353728473186493, 0.12172649800777435, 0.12121793627738953, -0.25117307901382446, 0.1666630655527115, -0.05846887081861496, -0.03808272257447243, 0.058093827217817307, 0.15651103854179382, -0.11942866444587708, -0.35113853216171265, 0.5051125288009644, -0.17309993505477905, -0.05530908703804016, 0.3530036509037018, -0.061433855444192886, 0.041913725435733795, -0.08998547494411469, 0.31096351146698, 0.12650325894355774, 0.38722848892211914, 0.042109787464141846, -0.19389969110488892, -0.2732853293418884, -0.1568191647529602, -0.25461673736572266, 0.03473344445228577, -0.09978309273719788, 0.30633047223091125, 0.10739296674728394, -0.08423327654600143, -0.21500781178474426, 0.4758688509464264, 0.030121348798274994, -0.19139999151229858, -0.24043911695480347, 0.040482714772224426, -0.2555764317512512, -0.009742394089698792, -0.07693107426166534, -0.20573097467422485, 0.10219859331846237, 0.11405423283576965, -0.3285716772079468, -0.4315008819103241, 0.8132106065750122, -0.3085569739341736, -0.00665496289730072, -0.22305062413215637, 0.49516117572784424, 0.2379680871963501, -0.310775488615036, -0.301699697971344, 0.058478355407714844, 0.20364487171173096, -0.05379505082964897, -0.1569199562072754, -0.06840495765209198, -0.31260111927986145, -0.10619852691888809, -0.025066494941711426, 0.07611473649740219, -0.08417966961860657, -0.5427252650260925, 0.618014931678772, -0.11091821640729904 ]
https://github.com/huggingface/datasets/issues/5950
Hi ! We use the Arrow columnar format under the hood, which doesn't support such dictionaries: each field must have a fixed type and exist in each sample. Instead you can restructure your data like ``` { "index": 0, "keys": ["2 * x + y >= 3"], "values": [["2 * x + y >= 3", "4 * x + 2 * y >= 6"]], } }, ... { "index": 9999, "keys": ["x >= 6"], "values": [["x >= 6", "x >= 0", "x >= -1"]], }, ... ```
Support for data with instance-wise dictionary as features
### Feature request I notice that when loading data instances with feature type of python dictionary, the dictionary keys would be broadcast so that every instance has the same set of keys. Please see an example in the Motivation section. It is possible to avoid this behavior, i.e., load dictionary features as it is and do not broadcast the keys among instances? Please note that these dictionaries would have to be processed dynamically at each training iteration into strings (and tokenized). ### Motivation I am trying to load a dataset from a json file. Each instance of the dataset has a feature that is a dictionary but its keys depend on the instance. Every two instances may have different keys. For example, imagine a dataset that contains a set of math expressions from a bunch of mutually redundant expressions: ``` { "index": 0, "feature": { "2 * x + y >= 3": ["2 * x + y >= 3", "4 * x + 2 * y >= 6"], ... } }, ... { "index": 9999, "feature": { "x >= 6": ["x >= 6", "x >= 0", "x >= -1"], ... } }, ... ``` When directly loading the dataset using `data = load_dataset("json", data_files=file_paths, split='train')`, each instance would have all the keys from other instances and None as values. That is, instance of index 0 becomes: ``` { "index": 0, "feature": { "2 * x + y >= 3": ["2 * x + y >= 3", "4 * x + 2 * y >= 6"], ... "x >= 6": None, # keys from other instances ... } }, ``` This is not desirable. Moreover, issue would be raised if I attempt to combine two such datasets using `data = concatenate_datasets(multi_datasets)`, perhaps because their dictionary features contain different keys. A solution I can think of is to store the dictionary features as a long string, and evaluate it later. Please kindly suggest any other solution using existing methods of datasets. ### Your contribution N/A
87
Support for data with instance-wise dictionary as features ### Feature request I notice that when loading data instances with feature type of python dictionary, the dictionary keys would be broadcast so that every instance has the same set of keys. Please see an example in the Motivation section. It is possible to avoid this behavior, i.e., load dictionary features as it is and do not broadcast the keys among instances? Please note that these dictionaries would have to be processed dynamically at each training iteration into strings (and tokenized). ### Motivation I am trying to load a dataset from a json file. Each instance of the dataset has a feature that is a dictionary but its keys depend on the instance. Every two instances may have different keys. For example, imagine a dataset that contains a set of math expressions from a bunch of mutually redundant expressions: ``` { "index": 0, "feature": { "2 * x + y >= 3": ["2 * x + y >= 3", "4 * x + 2 * y >= 6"], ... } }, ... { "index": 9999, "feature": { "x >= 6": ["x >= 6", "x >= 0", "x >= -1"], ... } }, ... ``` When directly loading the dataset using `data = load_dataset("json", data_files=file_paths, split='train')`, each instance would have all the keys from other instances and None as values. That is, instance of index 0 becomes: ``` { "index": 0, "feature": { "2 * x + y >= 3": ["2 * x + y >= 3", "4 * x + 2 * y >= 6"], ... "x >= 6": None, # keys from other instances ... } }, ``` This is not desirable. Moreover, issue would be raised if I attempt to combine two such datasets using `data = concatenate_datasets(multi_datasets)`, perhaps because their dictionary features contain different keys. A solution I can think of is to store the dictionary features as a long string, and evaluate it later. Please kindly suggest any other solution using existing methods of datasets. ### Your contribution N/A Hi ! We use the Arrow columnar format under the hood, which doesn't support such dictionaries: each field must have a fixed type and exist in each sample. Instead you can restructure your data like ``` { "index": 0, "keys": ["2 * x + y >= 3"], "values": [["2 * x + y >= 3", "4 * x + 2 * y >= 6"]], } }, ... { "index": 9999, "keys": ["x >= 6"], "values": [["x >= 6", "x >= 0", "x >= -1"]], }, ... ```
[ 0.19504207372665405, -0.34095388650894165, 0.002453260123729706, 0.29262271523475647, 0.2256864458322525, -0.06849919259548187, 0.2951243817806244, 0.02916017547249794, 0.14267361164093018, 0.2032242715358734, 0.21794208884239197, 0.4819650948047638, -0.3849047124385834, 0.7559517025947571, -0.33124324679374695, -0.02395009621977806, 0.08559965342283249, 0.28134486079216003, 0.009190717712044716, 0.08064870536327362, 0.08216628432273865, -0.022123266011476517, -0.24731853604316711, -0.2289149910211563, -0.4712603986263275, -0.10759326070547104, 0.031902559101581573, -0.32825183868408203, 0.12199701368808746, -0.49223002791404724, 0.07609573006629944, 0.32384878396987915, 0.036809615790843964, -0.014450296759605408, -0.00012031640653731301, 0.19504469633102417, 0.16323669254779816, -0.10036597400903702, -0.5113914608955383, -0.13245442509651184, -0.07439887523651123, -0.23112066090106964, 0.5121967196464539, -0.4822535812854767, -0.08607061952352524, -0.6584896445274353, -0.17855992913246155, -0.2424994707107544, 0.5478989481925964, -0.25706613063812256, 0.090561144053936, 0.0321362167596817, -0.12199258804321289, 0.3420044183731079, -0.0489145927131176, 0.3211229741573334, -0.084401935338974, 0.010377161204814911, -0.04300406202673912, -0.2195822298526764, -0.0793946161866188, 0.02215069904923439, -0.08536838740110397, -0.07243494689464569, 0.5299257040023804, -0.05799788236618042, -0.04441419616341591, -0.24787408113479614, -0.4991063177585602, 0.11617507040500641, 0.9154417514801025, -0.21015769243240356, -0.4176369905471802, -0.3030015826225281, -0.028188910335302353, 0.04850640147924423, 0.14001549780368805, -0.11837179213762283, -0.11141682416200638, 0.172478586435318, 0.010919533669948578, -0.08753690123558044, -0.178955540060997, 0.28018105030059814, -0.1956046223640442, 0.18006467819213867, 0.09441211819648743, -0.1137010008096695, -0.20661401748657227, -0.148342102766037, -0.16760437190532684, -0.0905580073595047, 0.11948879063129425, -0.041369952261447906, 0.02305411547422409, -0.280131995677948, -0.0854683518409729, -0.3360539674758911, 0.20263886451721191, -0.17510414123535156, 0.22227539122104645, 0.09907998144626617, -0.3824826180934906, 0.12759585678577423, 0.6394929885864258, -0.03672008216381073, 0.41301581263542175, -0.053195636719465256, 0.25141191482543945, 0.22914543747901917, -0.3011636734008789, 0.04754255712032318, -0.03710755705833435, 0.25228747725486755, 0.21507099270820618, -0.09083332866430283, 0.28643500804901123, 0.00303012877702713, -0.11551279574632645, 0.12418380379676819, -0.368033230304718, 0.01828516647219658, 0.03171372413635254, -0.013068493455648422, 0.05552859231829643, 0.4102659225463867, 0.12672699987888336, 0.1789330244064331, -0.16189248859882355, -0.011343531310558319, -0.053021010011434555, -0.18453893065452576, 0.08234131336212158, -0.09539727866649628, 0.11352522671222687, 0.14717251062393188, 0.3110518157482147, 0.24043497443199158, 0.28826072812080383, -0.0853632241487503, -0.15633830428123474, 0.20461347699165344, -0.19613948464393616, -0.10382923483848572, -0.23350369930267334, -0.013119228184223175, -0.028829772025346756, -0.3350864052772522, -0.23713520169258118, 0.10853812098503113, -0.04625513404607773, -0.08458863198757172, 0.04741630703210831, 0.07486613839864731, -0.3939552903175354, 0.017542973160743713, 0.06253885477781296, 0.4280836582183838, -0.106496661901474, -0.28280216455459595, 0.023169469088315964, -0.020219137892127037, -0.2078002393245697, -0.4009028375148773, 0.09267406910657883, 0.3336235582828522, -0.5214254856109619, -0.3838834762573242, 0.3892679512500763, -0.030333874747157097, -0.18461555242538452, 0.15467894077301025, -0.33925044536590576, 0.07071903347969055, 0.08960040658712387, -0.24770358204841614, 0.1287464201450348, -0.2829017639160156, -0.3603340685367584, 0.23527982831001282, 0.058247849345207214, 0.4909393787384033, 0.24832379817962646, 0.20244736969470978, 0.300787091255188, 0.05796949192881584, 0.16573379933834076, 0.48094719648361206, 0.17124822735786438, 0.11050421744585037, -0.22692637145519257, -0.2166568636894226, 0.30424439907073975, 0.06282500177621841, -0.4672168493270874, 0.02932281419634819, 0.10587102174758911, 0.254395455121994, 0.31612128019332886, -0.03537725284695625, -0.050672683864831924, -0.20575103163719177, 0.15558645129203796, 0.4992492198944092, 0.08851033449172974, 0.13204462826251984, -0.46945202350616455, 0.3865678012371063, 0.10635493695735931, -0.09959882497787476, -0.024783313274383545, -0.4622165560722351, 0.21900014579296112, -0.00494915246963501, -0.19908654689788818, 0.13470277190208435, 0.036759503185749054, -0.38139188289642334, -0.045475468039512634, 0.2913099229335785, -0.22695866227149963, -0.16756469011306763, -0.00917968899011612, -0.116556815803051, -0.04180530086159706, 0.260720431804657, 0.36513304710388184, 0.18795189261436462, -0.15899451076984406, 0.3507600724697113, -0.23570746183395386, 0.08629335463047028, 0.01186998188495636, 0.035992443561553955, 0.3770301342010498, 0.05307132005691528, -0.3458821177482605, 0.2778913378715515, 0.3984857499599457, 0.2282273769378662, 0.2951143682003021, 0.13154658675193787, 0.16436445713043213, -0.18697141110897064, -0.15870068967342377, 0.6895447373390198, 0.3571087419986725, 0.11063507199287415, -0.16515401005744934, 0.14613184332847595, 0.20431706309318542, 0.14292049407958984, -0.2908121347427368, -0.3829984962940216, -0.2561444342136383, -0.2485000193119049, -0.10919690877199173, 0.015696143731474876, -0.30258673429489136, -0.033668890595436096, -0.00013366900384426117, 0.09700162708759308, 0.32882028818130493, -0.2401992678642273, -0.15051530301570892, 0.12014579772949219, -0.15282610058784485, 0.0747818648815155, 0.2994564175605774, 0.1685398817062378, -0.05383908003568649, -0.05838504433631897, 0.2731921970844269, 0.012048989534378052, 0.23050051927566528, 0.08843132853507996, 0.2666779160499573, 0.27099278569221497, 0.10400491952896118, -0.05998937413096428, -0.09183992445468903, -0.05475405603647232, 0.12546469271183014, -0.22222945094108582, -0.21027402579784393, -0.04314345121383667, -0.5672405362129211, -0.2614382207393646, 0.005609095096588135, 0.1614299863576889, -0.13210062682628632, -0.017614930868148804, 0.1771870106458664, 0.26715612411499023, -0.06408341228961945, 0.08453187346458435, 0.04395551234483719, 0.530634880065918, -0.12578368186950684, -0.43136128783226013, 0.17315255105495453, -0.19974590837955475, 0.04526190087199211, 0.00491013377904892, 0.17961840331554413, 0.10450508445501328, 0.1649385392665863, 0.47101688385009766, -0.32894372940063477, -0.19692197442054749, -0.12616153061389923, -0.09766453504562378, -0.015093527734279633, 0.2602158784866333, 0.07393980771303177, -0.06632526218891144, -0.006017155945301056, -0.13474030792713165, 0.14955586194992065, 0.0494777113199234, -0.3680318295955658, 0.06225394457578659, 0.19461804628372192, 0.1884174644947052, 0.10314591228961945, -0.0496130995452404, -0.351491242647171, -0.286865234375, 0.38032764196395874, 0.28120994567871094, 0.19769087433815002, -0.02467935159802437, -0.07174882292747498, -0.3656928539276123, 0.20422184467315674, 0.14866220951080322, -0.16971391439437866, 0.057879768311977386, 0.23431476950645447, -0.21400795876979828, -0.014822399243712425, -0.2640555799007416, -0.1737028807401657, -0.13497984409332275, 0.3686164319515228, -0.4712331295013428, -0.14891962707042694, -0.04220668971538544, 0.36114513874053955, 0.08487948775291443, -0.060204990208148956, 0.11223182082176208, 0.3131100535392761, 0.06810177862644196, 0.07726643979549408, -0.00449303537607193, 0.30475783348083496, 0.2780486047267914, -0.08975274115800858, 0.3989418148994446, 0.3952912986278534, -0.1391414850950241, 0.6066802740097046, 0.15568038821220398, -0.06034345179796219, 0.30732786655426025, 0.029910391196608543, -0.09193826466798782, -0.03990252688527107, 0.11495205014944077, -0.32247334718704224, -0.24166639149188995, -0.2114989161491394, 0.20679233968257904, -0.10505160689353943, -0.061487793922424316, -0.34447282552719116, -0.1706368327140808, -0.20429064333438873, -0.36032670736312866, 0.10178398340940475, -0.4499366879463196, 0.24081724882125854, -0.2539713978767395, 0.09701772779226303, 0.0598810613155365, 0.017407983541488647, 0.005752209573984146, 0.09839671850204468, 0.12030350416898727, -0.06295543164014816, -0.5437440276145935, -0.1151304543018341, -0.15223833918571472, 0.03604106605052948, -0.09571224451065063, 0.2266828566789627, 0.1813148707151413, -0.2677296996116638, 0.050804879516363144, 0.1610719859600067, 0.5411651730537415, 0.08115942031145096, 0.09528610110282898, 0.03204791247844696, -0.29300156235694885, 0.08111429959535599, -0.36841028928756714, -0.21052482724189758, 0.4678686559200287, -0.5512009263038635, 0.40409260988235474, -0.2362387329339981, -0.28948745131492615, -0.1806923747062683, 0.16497768461704254, -0.3943527340888977, -0.22392764687538147, -0.09436805546283722, 0.24745513498783112, -0.2594015598297119, -0.18554319441318512, 0.07316507399082184, 0.1679764986038208, -0.21050889790058136, -0.2690366804599762, -0.4303811490535736, 0.11013692617416382, 0.345482736825943, 0.033123552799224854, 0.2155236154794693, 0.02860131487250328, 0.2964268922805786, 0.26676711440086365, 0.14042668044567108, -0.10807744413614273, 0.39434611797332764, 0.3458954989910126, -0.4370061159133911, -0.32466790080070496, 0.17852577567100525, 0.2307164967060089, 0.15919658541679382, 0.0025499314069747925, 0.29913270473480225, -0.15603388845920563, -0.1892995536327362, -0.4005785286426544, -0.4559047818183899, 0.3006739020347595, -0.10241394490003586, -0.10589837282896042, -0.5009308457374573, 0.498496949672699, 0.07233510911464691, -0.07441413402557373, 0.18918006122112274, 0.12697599828243256, -0.280043363571167, 0.7267439961433411, 0.12878531217575073, 0.47982102632522583, 0.16195541620254517, 0.31482306122779846, 0.321370393037796, 0.4093019664287567, 0.676234245300293, -0.13407380878925323, 0.20200535655021667, -0.2861340641975403, -0.15547676384449005, -0.11281730234622955, 0.033627480268478394, -0.09034733474254608, 0.37864017486572266, -0.09350299835205078, 0.020913202315568924, -0.5129884481430054, -0.16645698249340057, -0.17562955617904663, 0.07913491129875183, 0.13806548714637756, -0.04779127240180969, 0.0016749538481235504, -0.05799455940723419, 0.14556539058685303, 0.11462767422199249, -0.13397356867790222, -0.31191134452819824, 0.07308641076087952, -0.12177352607250214, -0.008681520819664001, -0.12359829246997833, -0.09323099255561829, 0.7209903597831726, 0.15573950111865997, 0.11606186628341675, 0.4081268012523651, 0.4849051833152771, -0.13194820284843445, 0.061233121901750565, 0.08405013382434845, -0.16013610363006592, 0.04025208577513695, 0.08431169390678406, -0.007363870739936829, 0.07898839563131332, 0.39686307311058044, 0.15007463097572327, -0.20568299293518066, 0.006552338600158691, 0.05465655401349068, -0.14077451825141907, -0.24147534370422363, -0.07927899062633514, -0.06092813238501549, -0.6023518443107605, -0.21911436319351196, 0.04337380453944206, -0.1605653464794159, 0.00005187094211578369, 0.002213024999946356, 0.030620284378528595, -0.09387215971946716, 0.4022146463394165, 0.09281720966100693, 0.029848307371139526, 0.15770931541919708, 0.27388063073158264, 0.3438607454299927, 0.14501172304153442, 0.43822118639945984, -0.09177814424037933, -0.14019504189491272, -0.06619174033403397, 0.25630447268486023, -0.23460610210895538, 0.1298060268163681, 0.3414362370967865, 0.256968230009079, -0.18289004266262054, -0.23164214193820953, 0.380238801240921, 0.03808857128024101, 0.35074982047080994, -0.04867204651236534, -0.3510756492614746, -0.15580888092517853, 0.5618454217910767, 0.027804691344499588, 0.2022179663181305, -0.21224507689476013, -0.06481458991765976, -0.2917429804801941, 0.15453866124153137, -0.1999782770872116, -0.08561848104000092, 0.16978445649147034, -0.06028024107217789, -0.008219454437494278, 0.012068032287061214, -0.20191560685634613, 0.1327512562274933, 0.13571639358997345, -0.15562289953231812, 0.06662002205848694, -0.08406564593315125, -0.06265715509653091, 0.23222699761390686, 0.1526874303817749, 0.41126856207847595, -0.048499904572963715, -0.2600751221179962, -0.08465051651000977, -0.08673210442066193, 0.2741091251373291, 0.25091683864593506, -0.03680586814880371, 0.46834564208984375, 0.17399315536022186, 0.43958356976509094, -0.18149375915527344, 0.41808122396469116, 0.12469206750392914, -0.06512236595153809, 0.2213422656059265, -0.15747720003128052, -0.013229575008153915, -0.046274468302726746, -0.4838774502277374, 0.14057990908622742, -0.31250473856925964, -0.012927066534757614, 0.0873488336801529, 0.08860842883586884, -0.060842279344797134, 0.2561119794845581, 0.1277119517326355, 0.499881386756897, -0.2665897607803345, 0.045853883028030396, 0.3515194058418274, 0.12582431733608246, -0.31625014543533325, -0.5146944522857666, 0.17385485768318176, 0.0639994740486145, 0.05149126797914505, 0.3151785135269165, 0.24245698750019073, -0.16735944151878357, -0.6000825762748718, -0.186192125082016, -0.5241001844406128, 0.04304269328713417, 0.34411510825157166, 0.5182865858078003, 0.3292686641216278, -0.31911036372184753, -0.07415379583835602, 0.318494588136673, 0.3283960819244385, 0.16321086883544922, -0.07763846218585968, 0.22248411178588867, 0.261601060628891, -0.13727787137031555, 0.19780054688453674, -0.31071460247039795, 0.3221534788608551, 0.0952279195189476, -0.1976824849843979, 0.17691577970981598, -0.058705300092697144, -0.02992473915219307, -0.0640597715973854, -0.13506099581718445, -0.27490898966789246, -0.20188754796981812, -0.14722542464733124, -0.04013888165354729, 0.20838728547096252, -0.27203691005706787, -0.3431166112422943, -0.054157182574272156, -0.33513230085372925, -0.1908435970544815, 0.12719033658504486, 0.020803293213248253, 0.17698460817337036, -0.335079163312912, 0.4430879056453705, 0.046454496681690216, 0.7053930163383484, -0.1980234980583191, -0.3051752746105194, 0.03171393275260925, 0.012675988487899303, 0.06153295561671257, 0.1112421378493309, -0.05149003118276596, 0.39182573556900024, -0.21963438391685486, 0.10802027583122253, -0.37001192569732666, -0.046558089554309845, 0.05395279824733734, 0.030514150857925415, 0.03617513179779053, -0.05957121402025223, 0.21988017857074738, -0.05943061411380768, 0.026539485901594162, -0.1823447048664093, 0.3823849558830261, -0.26638320088386536, -0.4233972728252411, 0.15389558672904968, 0.2512950599193573, 0.07711218297481537, 0.3239457905292511, 0.11976287513971329, -0.3507803678512573, -0.8069357872009277, 0.0973576009273529, 0.3467392921447754, 0.1290527582168579, 0.08094360679388046, 0.04394502937793732, -0.34728485345840454, 0.2632620632648468, -0.02449345588684082, 0.19056010246276855, 0.08528314530849457, 0.16956546902656555, -0.4481244683265686, 0.10615379363298416, 0.12879303097724915, -0.4516146779060364, 0.2100754827260971, 0.31808674335479736, 0.137416273355484, 0.2630634009838104, -0.4126821756362915, -0.03990555182099342, -0.1356629729270935, 0.14034083485603333, -0.2757951617240906, -0.05669616535305977, 0.05470849573612213, 0.15776507556438446, -0.0663909986615181, -0.21471521258354187, 0.08809950202703476, -0.0023032687604427338, -0.05746602267026901, 0.058404985815286636, 0.0038926824927330017, -0.021729014813899994, 0.01058039627969265, 0.2478789985179901, -0.07909677922725677, 0.11922676861286163, 0.0544954389333725, -0.01601438596844673, 0.039275653660297394, -0.06550557911396027, -0.19309383630752563, 0.30093473196029663, 0.10935819894075394, 0.16461801528930664, -0.276895672082901, 0.5004141926765442, 0.05143061280250549, -0.024577049538493156, -0.06518370658159256, -0.4126870632171631, -0.2527678906917572, 0.02393355965614319, 0.01739472895860672, 0.1584015190601349, 0.003232009708881378, 0.5869089365005493, -0.2595439553260803, -0.1126832664012909, 0.01479707658290863, -0.16577863693237305, 0.23382729291915894, -0.16162724792957306, 0.1637166142463684, -0.15150602161884308, 0.45319825410842896, 0.2531118094921112, -0.05119727551937103, -0.13383819162845612, -0.11182171106338501, 0.44137564301490784, -0.24958264827728271, 0.02602924406528473, 0.27567487955093384, -0.013861015439033508, -0.36011385917663574, -0.24066480994224548, -0.11496765166521072, -0.3306053876876831, 0.12174413353204727, 0.05865074694156647, -0.38554972410202026 ]
https://github.com/huggingface/datasets/issues/5947
Hi ! The audio data don't always exist as files on disk - the blobs are often stored in the Arrow files. For now I'd suggest disabling decoding with `.cast_column("audio", Audio(decode=False))` and apply your own decoding that handles corrupted files (maybe to filter them out ?) cc @sanchit-gandhi since it's related to our discussion about allowing users to make decoding return `None` and show a warning when there are corrupted files
Return the audio filename when decoding fails due to corrupt files
### Feature request Return the audio filename when the audio decoding fails. Although currently there are some checks for mp3 and opus formats with the library version there are still cases when the audio decoding could fail, eg. Corrupt file. ### Motivation When you try to load an object file dataset and the decoding fails you can't know which file is corrupt ``` raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f5ab7e38290>: Format not recognised. ``` ### Your contribution Make a PR to Add exceptions for LIbsndfileError to return the audio filename or path when soundfile decoding fails.
71
Return the audio filename when decoding fails due to corrupt files ### Feature request Return the audio filename when the audio decoding fails. Although currently there are some checks for mp3 and opus formats with the library version there are still cases when the audio decoding could fail, eg. Corrupt file. ### Motivation When you try to load an object file dataset and the decoding fails you can't know which file is corrupt ``` raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f5ab7e38290>: Format not recognised. ``` ### Your contribution Make a PR to Add exceptions for LIbsndfileError to return the audio filename or path when soundfile decoding fails. Hi ! The audio data don't always exist as files on disk - the blobs are often stored in the Arrow files. For now I'd suggest disabling decoding with `.cast_column("audio", Audio(decode=False))` and apply your own decoding that handles corrupted files (maybe to filter them out ?) cc @sanchit-gandhi since it's related to our discussion about allowing users to make decoding return `None` and show a warning when there are corrupted files
[ -0.32508015632629395, 0.2062225639820099, -0.10531511902809143, 0.2657145857810974, 0.12691596150398254, -0.3168007433414459, -0.04729864373803139, 0.3888251781463623, -0.3635145425796509, 0.6399989724159241, -0.183310866355896, 0.47412925958633423, -0.3171817362308502, -0.223241925239563, -0.2382436990737915, 0.1393584907054901, -0.2180480808019638, 0.43125396966934204, -0.030891790986061096, -0.10628948360681534, -0.31388330459594727, 0.41243281960487366, 0.06847627460956573, 0.36410605907440186, -0.048669587820768356, 0.2811165452003479, 0.33928877115249634, 0.2521469295024872, -0.4516151547431946, -0.4552576541900635, 0.0206470787525177, -0.1580996960401535, 0.09263487160205841, 0.20786860585212708, -0.0001093326136469841, -0.13732051849365234, 0.45912793278694153, -0.13992783427238464, -0.16751357913017273, -0.34792885184288025, -0.4038770794868469, -0.2797290086746216, -0.14817248284816742, -0.12173735350370407, 0.009620808064937592, -0.325485497713089, 0.1349567025899887, -0.24954356253147125, 0.05881073325872421, 0.2552431523799896, 0.21767349541187286, -0.038698043674230576, 0.2913389801979065, 0.3306029438972473, 0.6145099997520447, 0.06311649084091187, -0.040092311799526215, 0.28280386328697205, 0.2667754292488098, 0.2664187550544739, 0.03859694302082062, 0.3749730885028839, -0.24796637892723083, -0.06853732466697693, -0.050915081053972244, 0.033027298748493195, 0.15764471888542175, -0.06282785534858704, -0.03540872037410736, 0.41246286034584045, 0.6126586198806763, -0.299874871969223, -0.14856433868408203, 0.00861455500125885, 0.17799845337867737, -0.4395877718925476, 0.14193999767303467, -0.00831875391304493, -0.35558831691741943, 0.314262330532074, -0.17056068778038025, 0.12902520596981049, 0.02391575276851654, 0.04755226522684097, 0.026264578104019165, -0.1706165373325348, -0.12581732869148254, -0.012756865471601486, 0.4194488823413849, 0.007493231445550919, -0.25135108828544617, -0.15705466270446777, -0.2326488494873047, -0.0684814378619194, -0.09898651391267776, -0.2187395691871643, 0.06183933839201927, -0.19022364914417267, 0.12412121891975403, -0.1636631041765213, 0.14056532084941864, 0.14163139462471008, -0.2762150168418884, 0.27107101678848267, 0.04534592106938362, -0.07306765764951706, 0.1077217310667038, -0.2706797122955322, 0.514527440071106, 0.10383537411689758, -0.09491661190986633, -0.169898122549057, 0.0036687813699245453, 0.05027012899518013, 0.013773061335086823, 0.3995802402496338, 0.2405828833580017, -0.47950610518455505, -0.23267538845539093, 0.43208155035972595, -0.005292803049087524, -0.024878058582544327, 0.18971379101276398, 0.2676059901714325, 0.09850390255451202, 0.3487488031387329, 0.05797697603702545, -0.23945239186286926, 0.06379155069589615, -0.03660969436168671, 0.14134958386421204, 0.0007804129272699356, -0.2658153474330902, 0.17812739312648773, 0.25475016236305237, 0.11293550580739975, 0.15441644191741943, -0.3134773075580597, 0.26675593852996826, -0.26617300510406494, -0.003096573054790497, -0.17331187427043915, 0.3298490345478058, 0.15692931413650513, -0.2432449460029602, -0.032510906457901, -0.16559499502182007, -0.19235169887542725, -0.23473036289215088, 0.23202872276306152, -0.2539527714252472, -0.316636860370636, -0.3261193633079529, 0.26101154088974, -0.2163659632205963, 0.4524610936641693, 0.1161637157201767, 0.02536631003022194, -0.33287161588668823, -0.7487351298332214, 0.21116214990615845, -0.04317755252122879, -0.17824052274227142, -0.09050773084163666, 0.27557632327079773, 0.1310918927192688, -0.24365851283073425, 0.034648001194000244, -0.16047446429729462, -0.39181169867515564, -0.026694349944591522, -0.1962197721004486, -0.022259734570980072, -0.12388874590396881, -0.3756393492221832, -0.07307056337594986, 0.25161808729171753, -0.3289284110069275, -0.4606010913848877, -0.09481383860111237, -0.07200904190540314, 0.270475298166275, 0.1476079374551773, 0.14599794149398804, 0.14807453751564026, -0.18937358260154724, -0.1110515221953392, 0.20856906473636627, 0.036015585064888, 0.018760576844215393, -0.20982877910137177, -0.2013569325208664, -0.05475340783596039, 0.07896187901496887, -0.16790583729743958, 0.17103266716003418, 0.16454163193702698, 0.11658449470996857, 0.339180052280426, -0.004334325902163982, -0.23860743641853333, -0.2466350644826889, 0.5858115553855896, -0.3402021825313568, 0.08289846777915955, -0.46818336844444275, 0.17790104448795319, 0.05325023829936981, -0.09473290294408798, -0.10862850397825241, -0.17907141149044037, -0.18698570132255554, 0.14729827642440796, -0.07652899622917175, -0.23091013729572296, 0.15600770711898804, 0.2474094033241272, 0.5074435472488403, -0.33731555938720703, 0.17593896389007568, -0.36388131976127625, -0.30367523431777954, -0.28612279891967773, -0.1380336433649063, -0.050290901213884354, 0.08256848156452179, 0.16346119344234467, -0.05952144414186478, -0.15272685885429382, 0.35000747442245483, 0.0017114561051130295, 0.054063260555267334, -0.057059332728385925, 0.38598376512527466, 0.03516487777233124, 0.1569664031267166, -0.34264856576919556, 0.2912014126777649, 0.011971591040492058, -0.3384343385696411, -0.0867651104927063, 0.24150294065475464, 0.11306028068065643, 0.0026589781045913696, 0.13832597434520721, 0.2576158046722412, 0.20742669701576233, 0.09651114791631699, 0.15820886194705963, -0.31431445479393005, 0.04690646380186081, -0.05426037311553955, -0.45471447706222534, -0.12885400652885437, 0.06878888607025146, -0.30822324752807617, 0.04496072232723236, 0.01195535622537136, -0.24120546877384186, -0.49759453535079956, 0.6720687747001648, -0.15274108946323395, -0.002894001081585884, 0.4048967659473419, 0.13096725940704346, 0.07972876727581024, 0.18314816057682037, 0.30503156781196594, 0.3485877811908722, 0.14507611095905304, 0.1090390533208847, -0.20415982604026794, -0.07691358774900436, -0.025401245802640915, 0.18483541905879974, 0.01746743731200695, 0.12014780938625336, 0.69068443775177, -0.026677483692765236, -0.12685781717300415, -0.27674800157546997, -0.49591925740242004, -0.17030474543571472, -0.13460707664489746, 0.015295974910259247, -0.27146846055984497, -0.2354232668876648, -0.24552367627620697, -0.40860989689826965, -0.24520540237426758, 0.06244233623147011, 0.0439547598361969, 0.16710099577903748, 0.20424672961235046, -0.27925270795822144, 0.16982583701610565, 0.01378922164440155, 0.20194648206233978, -0.3976106643676758, 0.08337121456861496, -0.08743923902511597, 0.18952840566635132, 0.005786838009953499, 0.11858373880386353, 0.044642046093940735, -0.20260150730609894, 0.1435202658176422, -0.08283732831478119, 0.16127222776412964, -0.10085093975067139, 0.014462754130363464, 0.24734196066856384, 0.44933947920799255, -0.09926597774028778, 0.309516966342926, 0.10470598191022873, 0.33706045150756836, -0.8988009095191956, 0.24807405471801758, 0.08603549003601074, 0.16549518704414368, 0.1609509438276291, 0.2789776921272278, 0.08205853402614594, -0.36604687571525574, -0.00779864564538002, -0.12413099408149719, -0.32228538393974304, 0.10158219933509827, -0.4329143166542053, 0.18062050640583038, 0.07000770419836044, -0.08791223168373108, 0.5499693155288696, -0.013141471892595291, 0.49277788400650024, 0.06685453653335571, -0.3381246030330658, 0.0980428010225296, -0.03208738937973976, 0.232169970870018, -0.1964375078678131, 0.018082350492477417, -0.049975957721471786, 0.1292932629585266, -0.40760016441345215, -0.3454474210739136, 0.25507837533950806, -0.2361166924238205, 0.07648720592260361, -0.2677551805973053, 0.07624980062246323, 0.41044291853904724, -0.20316706597805023, -0.17386314272880554, -0.13004153966903687, -0.31304723024368286, 0.10689039528369904, 0.5635881423950195, 0.04054567962884903, 0.22496308386325836, 0.1262819766998291, 0.06712528318166733, -0.10446194559335709, -0.2815691828727722, 0.15687987208366394, 0.2857248783111572, 0.43694305419921875, -0.04032786935567856, 0.07184477150440216, -0.12776470184326172, 0.02005074918270111, -0.4079093337059021, 0.28873908519744873, 0.08600986003875732, -0.2587403953075409, -0.22872701287269592, 0.1953759342432022, -0.16989490389823914, -0.29899173974990845, -0.06914149969816208, 0.047742411494255066, -0.08015861362218857, 0.012492217123508453, 0.27383553981781006, 0.48053741455078125, -0.023589760065078735, 0.37148815393447876, 0.5627350807189941, 0.43715330958366394, -0.18020790815353394, -0.15051478147506714, -0.739224374294281, 0.1009613424539566, 0.004502676427364349, 0.1941504180431366, 0.42233598232269287, -0.2611846625804901, 0.06098507344722748, -0.13373732566833496, -0.12818284332752228, 0.32023724913597107, 0.042097583413124084, -0.017761973664164543, -0.0867113247513771, 0.3045455813407898, 0.662429928779602, -0.10676457732915878, 0.001619584858417511, 0.014628823846578598, -0.13259917497634888, 0.33485519886016846, -0.023459352552890778, 0.05389214679598808, 0.11731718480587006, 0.43444204330444336, 0.018103420734405518, 0.013942260295152664, -0.07760173827409744, -0.1304260492324829, -0.17732137441635132, -0.05863315239548683, -0.1874029040336609, 0.09521953761577606, -0.23083531856536865, -0.40283533930778503, 0.1568775475025177, 0.1262069046497345, 0.36501431465148926, 0.009030066430568695, 0.41723498702049255, 0.06615039706230164, 0.06227424740791321, -0.14650219678878784, 0.16743695735931396, 0.12210103869438171, 0.13575150072574615, -0.0615600161254406, -0.09098201990127563, 0.0659264326095581, -0.14084197580814362, 0.04733973369002342, 0.27386975288391113, -0.044960133731365204, -0.09398692101240158, -0.026381447911262512, 0.02131400816142559, -0.11328577995300293, 0.09263341873884201, 0.36089378595352173, -0.06682448089122772, -0.2625303864479065, -0.09591993689537048, 0.4282999634742737, -0.2741878926753998, -0.21582239866256714, 0.4100764989852905, 0.3044290244579315, -0.1629439890384674, 0.32843080163002014, -0.04132527485489845, 0.9973598718643188, 0.10041864216327667, -0.11474005877971649, -0.12150587141513824, -0.3106033504009247, 0.2007708102464676, -0.3910782039165497, 0.10651138424873352, 0.07307358086109161, -0.2791579067707062, -0.18934378027915955, 0.050915300846099854, 0.0804801881313324, 0.2466225028038025, -0.1938014030456543, 0.2211541384458542, 0.364908903837204, 0.0038659414276480675, 0.02464783564209938, 0.2958449721336365, 0.02686169557273388, -0.12075766175985336, 0.004989806562662125, 0.08158111572265625, -0.08320567011833191, 0.08740320801734924, -0.08677159994840622, -0.056185074150562286, 0.5456064343452454, -0.06377719342708588, -0.4143947958946228, -0.04926522821187973, 0.024740617722272873, -0.10614021122455597, -0.1795196831226349, -0.47020137310028076, -0.1699017435312271, 0.2526400685310364, -0.38610225915908813, 0.4463457465171814, -0.0065121278166770935, 0.18606828153133392, -0.10591147094964981, 0.6259039044380188, 0.028884902596473694, -0.07147134095430374, 0.14579904079437256, -0.04389691352844238, -0.06747422367334366, 0.3246365487575531, -0.08722622692584991, -0.14358651638031006, 0.4814703166484833, -0.04849069193005562, 0.12762568891048431, 0.21404743194580078, -0.11297599971294403, 0.06099735200405121, -0.23002344369888306, -0.10508270561695099, 0.19094692170619965, 0.0856415331363678, -0.4746286869049072, 0.187052384018898, 0.01765335723757744, -0.2259872853755951, 0.07165151834487915, 0.0040963441133499146, -0.20901945233345032, -0.05471741408109665, 0.03927982598543167, -0.12521347403526306, -0.04647611454129219, -0.05072590708732605, -0.07347919791936874, -0.20018529891967773, -0.21134167909622192, -0.014570267871022224, 0.07134195417165756, -0.11812029033899307, -0.10499809682369232, -0.297635018825531, -0.010631909593939781, 0.03887178748846054, -0.34653282165527344, -0.39057764410972595, -0.10020014643669128, 0.30782628059387207, 0.07625333964824677, 0.5631839632987976, -0.11810652911663055, 0.0746864378452301, -0.2433689385652542, -0.4577327072620392, -0.32010334730148315, 0.09574884921312332, -0.42208677530288696, 0.23434892296791077, -0.26214876770973206, 0.4330833852291107, -0.12236255407333374, -0.08450967073440552, 0.11340472847223282, 0.38034433126449585, 0.08468057215213776, -0.07787496596574783, -0.06010672450065613, 0.18513883650302887, 0.15043681859970093, 0.24838700890541077, -0.06199438497424126, -0.14142325520515442, 0.11899763345718384, -0.20118406414985657, -0.05624465271830559, 0.12871728837490082, -0.1116710901260376, 0.3319871425628662, -0.22505824267864227, 0.16310466825962067, 0.0702061802148819, 0.10349539667367935, -0.020308729261159897, 0.42212340235710144, 0.08942555636167526, 0.2877756655216217, -0.17851226031780243, -0.07935091108083725, 0.027309108525514603, 0.1916559338569641, -0.10701069235801697, -0.07100224494934082, 0.38183337450027466, 0.42656806111335754, -0.0932394415140152, 0.16083025932312012, 0.38119596242904663, 0.1429877132177353, -0.22076261043548584, -0.1940661370754242, 0.3221955895423889, 0.22922489047050476, 0.09677658975124359, -0.1265948861837387, -0.2832084000110626, -0.32191240787506104, 0.052078284323215485, -0.05103375017642975, -0.21425719559192657, -0.17910730838775635, 0.41984468698501587, -0.042131368070840836, 0.2609708309173584, -0.06648144125938416, 0.06412491202354431, 0.24673067033290863, -0.20751795172691345, 0.1010732352733612, -0.15857641398906708, -0.16828107833862305, 0.27206310629844666, 0.31610405445098877, -0.2915097177028656, 0.18220052123069763, 0.1966753900051117, 0.1256178468465805, -0.008305162191390991, -0.05644158273935318, -0.042028848081827164, 0.23570357263088226, 0.022017981857061386, 0.3640439510345459, 0.41025346517562866, -0.007172439247369766, -0.4408740997314453, 0.24378660321235657, -0.09977457672357559, -0.3109505772590637, -0.03740329295396805, 0.10017798840999603, 0.06346309185028076, -0.1073141023516655, -0.04963100701570511, 0.12351305782794952, 0.09150265157222748, 0.29720214009284973, -0.11384624242782593, 0.014166786335408688, 0.10130257904529572, 0.26390340924263, -0.11333741247653961, 0.04610913246870041, 0.27577558159828186, -0.3303135633468628, -0.03778047487139702, 0.6085142493247986, 0.20697855949401855, 0.48972928524017334, -0.06732025742530823, -0.08703533560037613, 0.2071569263935089, 0.016647860407829285, 0.023950494825839996, -0.3113970458507538, -0.02186056599020958, -0.14176905155181885, 0.3456096947193146, 0.1363428831100464, 0.07882151752710342, 0.3812263011932373, 0.22636637091636658, -0.1308279037475586, -0.013132071122527122, 0.05384131148457527, -0.015311239287257195, -0.4158235788345337, 0.16599124670028687, 0.07020331919193268, -0.12518881261348724, -0.04404185712337494, -0.08964414894580841, -0.22996081411838531, -0.24570225179195404, 0.13282710313796997, 0.08417627215385437, -0.12648309767246246, 0.2464054375886917, 0.0901145190000534, -0.1289519965648651, -0.22505608201026917, 0.2803530991077423, 0.042174119502305984, -0.08706013113260269, -0.21031001210212708, -0.6019954085350037, 0.12427230179309845, 0.3114733397960663, -0.018122248351573944, -0.014012126252055168, -0.2555787265300751, 0.159247487783432, 0.07860671728849411, -0.2857900857925415, -0.08433911204338074, 0.04823645204305649, 0.16656926274299622, -0.22005562484264374, -0.4779347777366638, -0.06750156730413437, -0.002125399187207222, -0.20410817861557007, -0.3632134795188904, 0.051028259098529816, 0.05991123616695404, 0.11306200176477432, -0.0664990022778511, 0.007196590304374695, -0.40739908814430237, -0.15897725522518158, 0.4003160297870636, 0.18182148039340973, 0.23581546545028687, -0.3979760706424713, -0.16993793845176697, 0.291674941778183, 0.06490480899810791, 0.13532277941703796, -0.27180081605911255, -0.18129026889801025, 0.5219830870628357, 0.22347374260425568, 0.46957260370254517, -0.35451605916023254, 0.29461926221847534, -0.06790744513273239, 0.2128656804561615, -0.4669027328491211, -0.02093733474612236, -0.15024293959140778, -0.03563955798745155, -0.04311211779713631, 0.16733109951019287, 0.2183285504579544, 0.10529465973377228, -0.2948700785636902, -0.12535890936851501, 0.6542758941650391, 0.021282799541950226, 0.017211243510246277, -0.0024316497147083282, 0.5045783519744873, -0.03073742240667343, 0.08774376660585403, -0.7740522623062134, -0.10694138705730438, 0.11625508219003677, 0.02286309376358986, -0.3005867302417755, -0.12153011560440063, -0.0931219533085823, 0.012186475098133087, -0.046167291700839996, 0.0921776294708252, 0.3207930028438568, -0.29542067646980286, 0.15304283797740936, -0.24363864958286285 ]
https://github.com/huggingface/datasets/issues/5947
Thanks @lhoestq, I wasn't aware of the decode flag. It makes more sense as you say to show a warning when there are corrupted files together with some metadata of the file that allows to filter them from the dataset. My workaround was to catch the LibsndfileError and generate a dummy audio with an unsual sample rate to filter it later. However returning `None` seems better. `try: array, sampling_rate = sf.read(file) except sf.LibsndfileError: print("bad file") array = np.array([0.0]) sampling_rate = 99.000`
Return the audio filename when decoding fails due to corrupt files
### Feature request Return the audio filename when the audio decoding fails. Although currently there are some checks for mp3 and opus formats with the library version there are still cases when the audio decoding could fail, eg. Corrupt file. ### Motivation When you try to load an object file dataset and the decoding fails you can't know which file is corrupt ``` raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f5ab7e38290>: Format not recognised. ``` ### Your contribution Make a PR to Add exceptions for LIbsndfileError to return the audio filename or path when soundfile decoding fails.
81
Return the audio filename when decoding fails due to corrupt files ### Feature request Return the audio filename when the audio decoding fails. Although currently there are some checks for mp3 and opus formats with the library version there are still cases when the audio decoding could fail, eg. Corrupt file. ### Motivation When you try to load an object file dataset and the decoding fails you can't know which file is corrupt ``` raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f5ab7e38290>: Format not recognised. ``` ### Your contribution Make a PR to Add exceptions for LIbsndfileError to return the audio filename or path when soundfile decoding fails. Thanks @lhoestq, I wasn't aware of the decode flag. It makes more sense as you say to show a warning when there are corrupted files together with some metadata of the file that allows to filter them from the dataset. My workaround was to catch the LibsndfileError and generate a dummy audio with an unsual sample rate to filter it later. However returning `None` seems better. `try: array, sampling_rate = sf.read(file) except sf.LibsndfileError: print("bad file") array = np.array([0.0]) sampling_rate = 99.000`
[ -0.2349940538406372, 0.25069093704223633, -0.08755676448345184, 0.023980338126420975, 0.0556185282766819, -0.2654074430465698, -0.08733473718166351, 0.4549439549446106, -0.26085078716278076, 0.6982671022415161, -0.07927210628986359, 0.5527421236038208, -0.3463272452354431, -0.06029112637042999, -0.3464602828025818, 0.06985870003700256, -0.19057726860046387, 0.4925197958946228, 0.21568572521209717, -0.16335830092430115, -0.3416992425918579, 0.383323073387146, 0.056041136384010315, 0.40374377369880676, -0.06591272354125977, 0.1730017066001892, 0.3914804458618164, 0.2880672514438629, -0.4241199791431427, -0.6054303646087646, 0.04185397922992706, -0.07319453358650208, 0.14009085297584534, 0.19376008212566376, -0.00011647619976429269, -0.0640188604593277, 0.51307213306427, -0.13276070356369019, -0.09934540838003159, -0.3230856657028198, -0.2152009755373001, -0.3558836281299591, -0.22007858753204346, -0.1500421017408371, -0.0807393416762352, -0.4076058268547058, 0.2660640776157379, -0.28954076766967773, 0.10880838334560394, 0.26887017488479614, 0.13317660987377167, 0.04562252014875412, 0.21263454854488373, 0.36013519763946533, 0.49177464842796326, 0.19587960839271545, -0.10013614594936371, 0.3587964177131653, 0.3638913631439209, 0.08340591937303543, -0.026359252631664276, 0.4324643015861511, -0.13258862495422363, 0.05631204694509506, -0.012152742594480515, 0.05773437023162842, 0.19499360024929047, -0.14494016766548157, -0.15689030289649963, 0.6113987565040588, 0.39189091324806213, -0.2256879210472107, -0.19239838421344757, -0.20142146944999695, 0.1003980040550232, -0.4426317512989044, 0.06967383623123169, -0.03660152852535248, -0.42585402727127075, 0.276193231344223, 0.001214500516653061, 0.123202383518219, -0.10323790460824966, 0.05506846681237221, 0.15327845513820648, -0.17384441196918488, -0.07933412492275238, 0.06676735728979111, 0.49666592478752136, 0.05619864910840988, -0.2141263782978058, -0.1414952576160431, -0.01454137172549963, -0.07072999328374863, -0.07731236517429352, -0.3029257357120514, 0.12933368980884552, -0.33442822098731995, 0.12206435203552246, -0.09940554201602936, -0.10168977081775665, 0.03480806201696396, -0.25056397914886475, 0.2580147683620453, 0.05642329901456833, -0.21323665976524353, 0.09338599443435669, -0.1530708372592926, 0.33427363634109497, 0.16703900694847107, -0.05704652890563011, -0.15435993671417236, 0.13487876951694489, 0.07513932883739471, -0.05166613683104515, 0.38266170024871826, 0.35465508699417114, -0.49296629428863525, -0.332502543926239, 0.35427403450012207, -0.23375873267650604, -0.03291454166173935, 0.09967786818742752, 0.32885438203811646, 0.08414815366268158, 0.3501630425453186, 0.04607532173395157, -0.21872662007808685, 0.027828358113765717, -0.11077791452407837, 0.15118366479873657, 0.10913856327533722, -0.46313440799713135, 0.08903905004262924, 0.1737009584903717, 0.03867488354444504, 0.20814168453216553, -0.34032586216926575, 0.2884170711040497, -0.2867625057697296, 0.16593751311302185, -0.14872750639915466, 0.3728882372379303, 0.1953125, -0.19874872267246246, -0.06087484210729599, 0.0007523773238062859, -0.20637550950050354, -0.2784423232078552, 0.23553253710269928, -0.13226883113384247, -0.21304938197135925, -0.242486372590065, 0.1702917069196701, -0.2684937119483948, 0.36535385251045227, 0.21629993617534637, 0.18011325597763062, -0.31390056014060974, -0.6880708932876587, 0.2766191363334656, -0.10109037905931473, -0.27292269468307495, -0.0749329924583435, 0.11815928667783737, 0.29793477058410645, -0.17591619491577148, -0.06666833162307739, -0.3140406608581543, -0.47908154129981995, 0.20267927646636963, -0.19817529618740082, 0.09099011868238449, -0.14733581244945526, -0.41967546939849854, 0.0018929243087768555, 0.3087177872657776, -0.36220693588256836, -0.3003627061843872, 0.128582164645195, -0.1336767077445984, 0.30440130829811096, 0.26749923825263977, 0.15836584568023682, 0.0016573555767536163, -0.26215291023254395, -0.16490502655506134, 0.13036313652992249, -0.11612866818904877, -0.0452730618417263, -0.21276769042015076, -0.23712322115898132, 0.06262370944023132, 0.11093467473983765, 0.030763529241085052, 0.1385156810283661, 0.1959131360054016, 0.041195258498191833, 0.5318981409072876, 0.06032957136631012, -0.22134406864643097, -0.2750293016433716, 0.6655052304267883, -0.16881583631038666, -0.027753690257668495, -0.45813602209091187, 0.43881288170814514, 0.008572064340114594, -0.33642932772636414, -0.0374930165708065, -0.06668722629547119, -0.24211978912353516, -0.025535214692354202, -0.08312031626701355, -0.15898647904396057, 0.09485849738121033, 0.16128239035606384, 0.49805232882499695, -0.26983797550201416, 0.2591665983200073, -0.3203544616699219, -0.303505539894104, -0.4694038927555084, -0.07674986869096756, 0.021227795630693436, 0.07227712124586105, 0.15468503534793854, -0.08706803619861603, -0.011537276208400726, 0.3232249617576599, 0.1352503001689911, 0.024970632046461105, -0.049906935542821884, 0.3447694480419159, 0.03374190255999565, 0.10653281211853027, -0.27618467807769775, 0.21356597542762756, -0.050430528819561005, -0.4176715612411499, 0.007287994027137756, 0.4966205060482025, 0.0010460726916790009, 0.09480012953281403, 0.03734942153096199, 0.3570552170276642, 0.04475712031126022, 0.08758572489023209, -0.01997661590576172, -0.15390878915786743, -0.07693115621805191, -0.18822965025901794, -0.5299695134162903, -0.08835337311029434, 0.1509704440832138, -0.3901371657848358, 0.011999934911727905, -0.0146841611713171, -0.32424086332321167, -0.4586597681045532, 0.6255924105644226, -0.18411678075790405, -0.1702365279197693, 0.394986093044281, 0.2663080096244812, 0.061112575232982635, 0.26141971349716187, 0.23231953382492065, 0.40519437193870544, 0.17943641543388367, -0.06342577934265137, -0.15269720554351807, -0.20107921957969666, -0.0482499897480011, 0.1303376853466034, 0.10038507729768753, 0.07592979073524475, 0.5913273096084595, -0.11160075664520264, -0.1472204625606537, -0.35209935903549194, -0.5800234079360962, -0.22091633081436157, -0.13202868402004242, 0.011958539485931396, -0.1586238443851471, -0.03607456013560295, -0.4584789574146271, -0.4842115342617035, -0.31983688473701477, 0.1496216356754303, -0.012668237090110779, 0.16838350892066956, 0.10197903215885162, -0.2569260001182556, 0.20092026889324188, -0.04367415979504585, 0.1761663258075714, -0.2957085967063904, 0.0075613632798194885, -0.01763235032558441, 0.2858240604400635, -0.023172985762357712, 0.08360280841588974, 0.02489406242966652, 0.0628594309091568, 0.26243045926094055, -0.09051378071308136, 0.07008713483810425, -0.10504255443811417, -0.06359677016735077, 0.19306907057762146, 0.3083178400993347, 0.01483837328851223, 0.3978444039821625, 0.11563348025083542, 0.3360450863838196, -0.7889326810836792, 0.11243248730897903, -0.11441588401794434, 0.14168527722358704, -0.03358624130487442, 0.2756274342536926, 0.15235242247581482, -0.270524263381958, -0.18633396923542023, -0.1957804262638092, -0.3435955047607422, 0.05497319996356964, -0.39029020071029663, 0.16770200431346893, 0.33577191829681396, -0.03478945791721344, 0.5747390985488892, 0.09466797113418579, 0.3036632239818573, -0.017520060762763023, -0.2837789058685303, -0.021054018288850784, 0.0668538510799408, 0.2547142803668976, -0.08945656567811966, -0.06321229040622711, -0.2563278377056122, 0.018658995628356934, -0.30877166986465454, -0.5318345427513123, 0.21317285299301147, -0.18450188636779785, 0.02214311808347702, -0.20206451416015625, -0.026432305574417114, 0.3349008858203888, -0.14513933658599854, -0.08428259938955307, -0.050223395228385925, -0.1737259477376938, 0.03368392959237099, 0.6399440765380859, 0.13458602130413055, 0.20210805535316467, 0.09581806510686874, 0.08138900995254517, 0.17313691973686218, -0.27839240431785583, 0.26287853717803955, 0.3188628852367401, 0.5251577496528625, 0.2722179889678955, 0.13225626945495605, 0.0032928846776485443, 0.1752910017967224, -0.4417846202850342, 0.19167560338974, 0.0172702856361866, -0.19361695647239685, -0.06240730732679367, 0.15098166465759277, -0.16425342857837677, -0.26972824335098267, -0.10966543853282928, 0.10843328386545181, 0.0030544428154826164, -0.0996846854686737, 0.22508494555950165, 0.43032780289649963, -0.008899979293346405, 0.2635728716850281, 0.7091494798660278, 0.6030256748199463, -0.03255379945039749, -0.3609010577201843, -0.702461838722229, 0.03321518376469612, -0.1432083398103714, 0.24894951283931732, 0.4139467775821686, -0.3110952377319336, 0.11181344091892242, 0.00117463618516922, -0.012142904102802277, 0.46543213725090027, -0.05398035794496536, -0.09241737425327301, -0.13214145600795746, 0.32196518778800964, 0.5886154174804688, -0.20154762268066406, -0.11262024939060211, 0.14466556906700134, -0.11915276199579239, 0.22860124707221985, -0.08546426892280579, -0.00713367760181427, 0.167036771774292, 0.44475340843200684, 0.08526927977800369, 0.013368282467126846, -0.08778894692659378, -0.27143925428390503, -0.22719648480415344, 0.149583637714386, -0.05144043639302254, 0.08501464128494263, -0.23526421189308167, -0.3160477876663208, 0.19992630183696747, 0.2738637626171112, 0.48014959692955017, 0.06878134608268738, 0.38970595598220825, 0.19631215929985046, -0.0775735080242157, -0.12362483888864517, 0.13433250784873962, 0.20059439539909363, 0.12664738297462463, -0.14161145687103271, -0.09359817206859589, 0.02326173707842827, -0.11549659073352814, 0.07915107905864716, 0.45428669452667236, 0.0024093687534332275, 0.009477689862251282, 0.02432415634393692, 0.15623122453689575, -0.11303358525037766, 0.22871820628643036, 0.21971051394939423, 0.02650996297597885, -0.32049697637557983, -0.23147282004356384, 0.5157606601715088, -0.21551679074764252, -0.2785199284553528, 0.33943459391593933, 0.27934741973876953, -0.11077116429805756, 0.4350988268852234, 0.009422264993190765, 1.0160164833068848, 0.007906020618975163, -0.14214494824409485, 0.014553632587194443, -0.2464393973350525, 0.38533154129981995, -0.45066067576408386, 0.0840313732624054, 0.0547717809677124, -0.4080020785331726, -0.1900932788848877, 0.050906792283058167, 0.16996927559375763, 0.1694214642047882, -0.2756408452987671, 0.3194509744644165, 0.41316139698028564, -0.15838655829429626, 0.19714441895484924, 0.3730190694332123, -0.08929147571325302, -0.0189816914498806, -0.05116696655750275, 0.014586806297302246, -0.10142207145690918, 0.2355382740497589, 0.012908965349197388, -0.22948120534420013, 0.38322070240974426, -0.0011493861675262451, -0.45499545335769653, -0.12977544963359833, 0.08535383641719818, -0.13016922771930695, 0.030478671193122864, -0.43308335542678833, -0.02115931361913681, 0.24029210209846497, -0.18876871466636658, 0.4036577045917511, -0.027951885014772415, 0.15526215732097626, -0.023883700370788574, 0.3422277867794037, -0.11024720221757889, -0.12983055412769318, 0.34008511900901794, -0.056531861424446106, -0.19723765552043915, 0.450239896774292, -0.1415170282125473, -0.2163536250591278, 0.3240487575531006, -0.048770271241664886, -0.015344144776463509, 0.1629502922296524, -0.19850413501262665, -0.018856078386306763, -0.27232345938682556, -0.024097435176372528, 0.11843402683734894, 0.12600556015968323, -0.4977615773677826, 0.252913236618042, 0.18827785551548004, -0.21120195090770721, 0.04301969334483147, -0.13922694325447083, -0.10649937391281128, 0.009084157645702362, 0.0331285335123539, -0.15648189187049866, 0.05845534801483154, 0.014891065657138824, -0.175399512052536, -0.2775362432003021, -0.011693738400936127, 0.012336771935224533, 0.19194158911705017, -0.07815489172935486, -0.03105340152978897, -0.23025640845298767, 0.1256098747253418, 0.22011302411556244, -0.34201157093048096, -0.4277034401893616, -0.14969363808631897, 0.17805346846580505, 0.042107850313186646, 0.5871779322624207, -0.13026881217956543, 0.2774691581726074, -0.2223295122385025, -0.498261421918869, -0.27165845036506653, 0.06272934377193451, -0.4991620182991028, 0.15814782679080963, -0.1354953944683075, 0.40789178013801575, -0.11135531961917877, -0.18724337220191956, 0.005728505551815033, 0.37412670254707336, -0.04591776058077812, 0.028760075569152832, -0.10846348106861115, 0.20035308599472046, 0.18206846714019775, 0.09792282432317734, 0.0086408331990242, -0.11019663512706757, 0.195137619972229, -0.12206420302391052, -0.2183552384376526, 0.21420231461524963, -0.13572198152542114, 0.36314135789871216, -0.33950138092041016, 0.0006812494248151779, 0.06759850680828094, 0.10831709206104279, -0.1435132473707199, 0.252180278301239, 0.11688496917486191, 0.2977902293205261, -0.018567319959402084, -0.056913137435913086, -0.031865090131759644, 0.21865274012088776, -0.07651352137327194, -0.13435304164886475, 0.29080313444137573, 0.5389506816864014, -0.206587016582489, 0.18580956757068634, 0.2677815556526184, 0.22845879197120667, -0.21246600151062012, -0.10657815635204315, 0.2418062537908554, 0.17307916283607483, -0.07366775721311569, -0.0198503527790308, -0.3177269697189331, -0.28372615575790405, 0.13020992279052734, 0.14074143767356873, -0.12190793454647064, -0.20041784644126892, 0.4262309968471527, 0.07589879631996155, 0.24708262085914612, 0.1617603898048401, 0.11189451813697815, 0.3006933629512787, -0.15133139491081238, 0.06813718378543854, -0.06020481884479523, -0.24899300932884216, 0.25072771310806274, 0.17502513527870178, -0.20349320769309998, 0.29276740550994873, 0.03512846678495407, 0.08030127733945847, -0.3376142382621765, 0.00048122555017471313, 0.02614947408437729, 0.46819227933883667, -0.10829228162765503, 0.3335973620414734, 0.4713781774044037, 0.11914964020252228, -0.5242167115211487, 0.17242494225502014, -0.07707013189792633, -0.30312177538871765, 0.02008434385061264, 0.040146999061107635, 0.025628603994846344, -0.03491877019405365, -0.1839854121208191, 0.07305650413036346, 0.2846345901489258, 0.22204118967056274, -0.2127629965543747, -0.013790350407361984, 0.023492615669965744, 0.3108745515346527, -0.06899315118789673, 0.1640576422214508, 0.3368084132671356, -0.29678961634635925, -0.2553693652153015, 0.4107518196105957, 0.13527071475982666, 0.5711637139320374, -0.13228602707386017, 0.03977907821536064, 0.10387682169675827, 0.03550587594509125, -0.08698315918445587, -0.21764101088047028, 0.011975809931755066, -0.06099056452512741, 0.23916564881801605, 0.11144834011793137, 0.048145897686481476, 0.36672312021255493, 0.13839948177337646, -0.11180293560028076, 0.032275449484586716, -0.05544935539364815, -0.10059600323438644, -0.4952578842639923, 0.29746630787849426, 0.08666203916072845, 0.016067415475845337, -0.09052024781703949, -0.03430391103029251, -0.22049221396446228, -0.19293388724327087, 0.08742903172969818, -0.0006774291396141052, -0.13735897839069366, 0.24565505981445312, 0.05281665921211243, -0.20081055164337158, -0.43682336807250977, 0.348019003868103, 0.0652833953499794, -0.22491052746772766, -0.15838418900966644, -0.5565829277038574, 0.037698894739151, 0.19313755631446838, -0.07425998896360397, 0.01016322523355484, -0.3441931903362274, -0.01853441819548607, 0.10628031194210052, -0.27611011266708374, 0.08879697322845459, -0.012869719415903091, 0.19917720556259155, -0.15815407037734985, -0.4397052824497223, -0.09203064441680908, 0.0158389825373888, -0.10788445174694061, -0.3536161184310913, -0.06852146238088608, 0.06084240972995758, 0.05006405711174011, -0.12474359571933746, 0.007314600050449371, -0.3840763568878174, -0.10894826054573059, 0.3595135509967804, 0.20480576157569885, 0.3648488521575928, -0.4073481261730194, -0.296787828207016, 0.33366507291793823, 0.11193136870861053, -0.09624183923006058, -0.27035558223724365, -0.20021970570087433, 0.6860790252685547, 0.1343565285205841, 0.4167638421058655, -0.32786551117897034, 0.4401322305202484, 0.019212663173675537, 0.17998217046260834, -0.39980897307395935, 0.015527047216892242, -0.36309701204299927, -0.008783947676420212, -0.06619943678379059, 0.1354040950536728, 0.2675005793571472, 0.1895921677350998, -0.3330323100090027, -0.10853631794452667, 0.6840760707855225, -0.04505031555891037, 0.07843447476625443, -0.03642216697335243, 0.4120871424674988, -0.11753611266613007, 0.10095352679491043, -0.7125016450881958, -0.149277463555336, 0.10284611582756042, 0.12093204259872437, -0.2878015339374542, -0.09865981340408325, -0.1391424536705017, -0.0494074746966362, 0.10003790259361267, -0.0030256547033786774, 0.253846675157547, -0.32206058502197266, 0.2660307288169861, -0.3077782392501831 ]
https://github.com/huggingface/datasets/issues/5946
> Looks related to https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0/14298/4?u=lhoestq The problem has not been solved, I have tried this before, but the problem is the same
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ??
### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0"
22
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ?? ### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" > Looks related to https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0/14298/4?u=lhoestq The problem has not been solved, I have tried this before, but the problem is the same
[ -0.18714331090450287, -0.29146265983581543, -0.20474481582641602, 0.2455594688653946, 0.14909164607524872, -0.0931643545627594, 0.32553473114967346, 0.5325318574905396, -0.18145307898521423, 0.26250627636909485, -0.03803275153040886, 0.2623401880264282, -0.2751728594303131, 0.08463205397129059, -0.13702046871185303, -0.14146819710731506, -0.11572933942079544, 0.22831565141677856, 0.01234460063278675, 0.1618497520685196, -0.22200682759284973, 0.11598178744316101, -0.25564903020858765, 0.18379512429237366, -0.17824098467826843, -0.13444936275482178, 0.011586017906665802, 0.04897971823811531, -0.1831437647342682, -0.4281555414199829, 0.23486600816249847, -0.42233142256736755, 0.17519617080688477, 0.7575787901878357, -0.00010833810665644705, 0.20821212232112885, 0.20941326022148132, -0.06108137220144272, -0.2739967703819275, -0.03218670189380646, 0.27400076389312744, -0.08183359354734421, -0.06049394607543945, -0.34036943316459656, -0.10887662321329117, -0.11809585243463516, -0.0911247506737709, 0.08609162271022797, 0.2919216454029083, 0.3951643705368042, 0.29977086186408997, 0.5734037160873413, 0.15735918283462524, -0.004583436995744705, 0.39597979187965393, -0.2986234128475189, -0.17237254977226257, 0.12629334628582, 0.2306351363658905, -0.10930247604846954, -0.34403860569000244, 0.3305622339248657, 0.113364078104496, -0.026948245242238045, -0.05634961277246475, -0.06686915457248688, 0.29530757665634155, -0.3012382984161377, -0.06857754290103912, 0.06763102114200592, 0.10988913476467133, -0.12438379228115082, -0.2887357473373413, -0.22405362129211426, -0.033861640840768814, -0.1980648636817932, 0.12846577167510986, -0.04351477324962616, -0.18561270833015442, 0.07850733399391174, 0.13473287224769592, 0.258441686630249, -0.20382758975028992, -0.0875319093465805, -0.25535905361175537, 0.6709121465682983, 0.020246043801307678, -0.05585077032446861, 0.33799058198928833, -0.0599864199757576, 0.5446838140487671, 0.18543905019760132, 0.09796632826328278, 0.11614929884672165, -0.24770121276378632, -0.29859358072280884, 0.2011989802122116, -0.2829151749610901, -0.08492304384708405, 0.09727305173873901, 0.07094467431306839, -0.06162435933947563, 0.3650719225406647, -0.0523645281791687, -0.014383130706846714, 0.4467044770717621, -0.15327726304531097, 0.506234347820282, 0.19824658334255219, 0.17897865176200867, -0.16833123564720154, -0.020264683291316032, -0.12865227460861206, -0.3499355912208557, 0.1499241143465042, 0.2346365600824356, 0.021753132343292236, 0.19096127152442932, -0.244333416223526, 0.1944049596786499, -0.07797762751579285, 0.043599989265203476, 0.3095036447048187, 0.4014035165309906, -0.037451617419719696, 0.09660618007183075, 0.06738579273223877, 0.023932654410600662, -0.28069260716438293, 0.06229696050286293, -0.30563247203826904, 0.19659925997257233, -0.16432800889015198, -0.3963042199611664, -0.024581748992204666, -0.2687665522098541, 0.2929766774177551, -0.1146552786231041, 0.15901954472064972, -0.014126695692539215, -0.091307133436203, -0.335003137588501, 0.14612260460853577, 0.24083715677261353, -0.1698623150587082, -0.10555237531661987, 0.23871324956417084, -0.025853127241134644, 0.04862929880619049, 0.23754030466079712, -0.29686620831489563, -0.34185129404067993, -0.00634907279163599, 0.3435903787612915, -0.06685323268175125, 0.12879934906959534, 0.11334541440010071, -0.19896140694618225, 0.29832035303115845, -0.1463731974363327, 0.10354991257190704, -0.39129573106765747, -0.01817212998867035, -0.29448723793029785, 0.23657581210136414, 0.163224995136261, -0.13177569210529327, 0.05617843568325043, 0.1417313516139984, 0.12213108688592911, 0.03886840119957924, 0.34022316336631775, -0.22736932337284088, 0.5167085528373718, -0.3468838930130005, 0.2756420969963074, 0.4128980040550232, -0.3304154574871063, -0.6089489459991455, 0.10945812612771988, -0.3541502058506012, -0.045711450278759, 0.05311039090156555, 0.024542521685361862, 0.15998347103595734, 0.02223941683769226, 0.32933682203292847, 0.13692450523376465, -0.1580452024936676, 0.1062549278140068, -0.29543015360832214, -0.01646074280142784, 0.02970290556550026, 0.07080309838056564, 0.5823972821235657, -0.15623264014720917, -0.16840219497680664, -0.07712603360414505, 0.1492239236831665, -0.00448809377849102, -0.06784477829933167, 0.15214784443378448, 0.12577654421329498, -0.06109263747930527, 0.18609240651130676, -0.1555328369140625, -0.09390145540237427, 0.1716909110546112, -0.3512204587459564, 0.002417988143861294, -0.16034553945064545, 0.06807974725961685, -0.33194005489349365, 0.0954226702451706, -0.3371700048446655, -0.2167247235774994, 0.30126696825027466, -0.03416420891880989, 0.12392188608646393, -0.08956091850996017, -0.22292593121528625, -0.18096573650836945, -0.14711710810661316, 0.020262569189071655, -0.142985001206398, 0.22384554147720337, -0.3654307723045349, -0.22020545601844788, -0.22680118680000305, 0.20460793375968933, 0.12361204624176025, -0.1933479607105255, -0.13438083231449127, 0.23267260193824768, -0.030541451647877693, -0.0674993246793747, -0.1253315508365631, -0.13171660900115967, -0.028443684801459312, -0.02999831736087799, -0.11272288113832474, 0.2550378143787384, 0.25631001591682434, -0.034822992980480194, 0.15667101740837097, 0.6024567484855652, -0.009607108309864998, 0.226262629032135, 0.02361007034778595, -0.24804788827896118, 0.020301111042499542, -0.14201052486896515, -0.021308619529008865, 0.1892644464969635, 0.28536537289619446, -0.15169867873191833, 0.2449483722448349, -0.1666671633720398, -0.22648656368255615, -0.18846532702445984, 0.12421953678131104, 0.04751471430063248, 0.09632259607315063, 0.12619182467460632, -0.09768874198198318, 0.13039204478263855, -0.24088972806930542, 0.09318014979362488, 0.2619120478630066, 0.24852275848388672, 0.009734801948070526, -0.039467476308345795, 0.1331195831298828, -0.1296388804912567, 0.20925463736057281, 0.08470810949802399, 0.22975347936153412, 0.5835295915603638, 0.1117188036441803, 0.050227295607328415, -0.17743556201457977, -0.3453409671783447, -0.09198607504367828, 0.4372389614582062, -0.2200707197189331, 0.26018938422203064, 0.09873183071613312, -0.06213631108403206, -0.15764570236206055, -0.3469374179840088, 0.036286864429712296, -0.33737462759017944, 0.1877148598432541, 0.26313766837120056, -0.18410715460777283, 0.12827470898628235, -0.12180623412132263, -0.005366384983062744, 0.33376380801200867, 0.039512358605861664, 0.06327292323112488, -0.11102388799190521, -0.15119428932666779, 0.21353989839553833, 0.20900671184062958, -0.31790101528167725, 0.16440895199775696, -0.12646758556365967, -0.0031477324664592743, 0.010358544066548347, -0.28369346261024475, 0.09914648532867432, -0.21208059787750244, 0.1090606153011322, 0.23379631340503693, 0.23148255050182343, -0.3687379062175751, -0.22416111826896667, 0.26331084966659546, -0.39922770857810974, -0.23665425181388855, 0.03492456674575806, 0.11430932581424713, 0.1967194378376007, -0.08643320947885513, -0.32991844415664673, -0.17720425128936768, -0.4696308672428131, 0.0665300041437149, -0.0898861438035965, 0.20996686816215515, 0.44876575469970703, 0.1825293004512787, 0.26394128799438477, 0.3643955588340759, -0.07129055261611938, 0.029016796499490738, -0.17786315083503723, 0.44092199206352234, -0.06147412955760956, -0.29233264923095703, -0.2630084455013275, -0.33668991923332214, 0.13084948062896729, -0.13686849176883698, -0.42681482434272766, 0.09110455960035324, -0.09786339104175568, -0.10907962918281555, -0.23417916893959045, 0.12735487520694733, 0.28372931480407715, -0.03251553326845169, -0.24296091496944427, -0.004171483218669891, 0.05569159984588623, -0.08118841797113419, 0.00720101036131382, 0.09598381817340851, -0.10182004421949387, 0.2820274233818054, 0.1422477513551712, 0.8831393122673035, -0.011805180460214615, -0.029587071388959885, 0.11560548841953278, -0.016876118257641792, 0.0556812509894371, -0.1177445501089096, -0.32656580209732056, -0.09618157148361206, 0.12953205406665802, -0.2556508183479309, 0.25731590390205383, -0.11746006458997726, -0.14738643169403076, -0.060156360268592834, -0.09893816709518433, -0.20951619744300842, -0.1885664016008377, 0.45065003633499146, -0.15046261250972748, 0.07783351838588715, -0.24638919532299042, 0.16143357753753662, -0.15593387186527252, 0.04750998690724373, -0.10225281864404678, -0.03212523087859154, -0.01638999953866005, -0.20645251870155334, -0.11927060037851334, -0.472229540348053, -0.3778599202632904, 0.14187195897102356, 0.28576764464378357, 0.3630947172641754, 0.19948314130306244, -0.415499210357666, 0.09981940686702728, -0.21379271149635315, 0.666243314743042, 0.12274567037820816, 0.038978222757577896, 0.2078012079000473, -0.1599317193031311, -0.29537177085876465, -0.3196379542350769, -0.19805388152599335, 0.13109701871871948, 0.2329121232032776, 0.38940858840942383, 0.023314788937568665, 0.05415693670511246, 0.09992591291666031, -0.040596820414066315, -0.14357154071331024, -0.30296024680137634, -0.2946266531944275, -0.23793759942054749, -0.1678246259689331, 0.5118195414543152, 0.2747534513473511, 0.2459683120250702, 0.018930606544017792, 0.015946000814437866, -0.09958024322986603, -0.17068292200565338, 0.055654577910900116, 0.2304246574640274, 0.27136221528053284, -0.06519955396652222, 0.020599447190761566, 0.06490421295166016, -0.03565489500761032, 0.36086350679397583, 0.3157641887664795, 0.00235946848988533, 0.19555538892745972, 0.1418066769838333, -0.0032748132944107056, 0.0757872462272644, 0.28622928261756897, -0.034636009484529495, 0.08881551027297974, -0.12125827372074127, 0.42126786708831787, 0.07182858884334564, -0.19191700220108032, 0.20607945322990417, -0.03995459899306297, -0.3647061884403229, -0.13239175081253052, 0.1673251986503601, -0.022570841014385223, 0.13155169785022736, 0.06652894616127014, -0.16018979251384735, -0.0907805860042572, 0.435218870639801, -0.03782861679792404, 0.750572919845581, 0.002665516920387745, 0.12184323370456696, 0.32202446460723877, 0.15643860399723053, 0.03759900853037834, -0.1322861760854721, 0.37961211800575256, -0.4147924780845642, -0.43460988998413086, -0.020577307790517807, -0.13396871089935303, -0.06169723719358444, -0.18919546902179718, -0.30671432614326477, 0.19026072323322296, -0.23619802296161652, 0.22307060658931732, -0.19963914155960083, -0.019519075751304626, 0.0292044784873724, 0.10150822252035141, -0.2837762236595154, 0.1464490294456482, 0.02716236561536789, 0.28136947751045227, -0.16729110479354858, -0.13503330945968628, -0.25014644861221313, -0.39118871092796326, -0.07939910888671875, -0.00005319714546203613, -0.2696834206581116, 0.2585657238960266, 0.06546051055192947, -0.40915754437446594, -0.1082453578710556, 0.16721278429031372, 0.04544372484087944, -0.05655256658792496, 0.09099706262350082, 0.05985771492123604, 0.46382081508636475, 0.022112291306257248, 0.023043964058160782, -0.0142366923391819, 0.3068968653678894, -0.06330551207065582, -0.18013830482959747, 0.19583606719970703, -0.025432534515857697, -0.40804368257522583, 0.259747713804245, 0.3259831368923187, 0.1480417549610138, -0.3486434817314148, 0.033640313893556595, -0.21178068220615387, -0.2333102524280548, -0.3319840431213379, 0.1945706307888031, -0.1014290601015091, -0.23963935673236847, 0.17380934953689575, 0.1895713061094284, -0.3431287407875061, -0.018169637769460678, 0.4550856649875641, 0.3530327081680298, 0.24877581000328064, 0.5828472971916199, 0.17447702586650848, -0.240425705909729, -0.3317686915397644, 0.20237571001052856, 0.22538308799266815, -0.28108716011047363, 0.22382852435112, -0.18262280523777008, -0.0780431255698204, 0.19019950926303864, 0.28673794865608215, 0.4288100302219391, 0.16487696766853333, -0.38295137882232666, -0.1927754282951355, -0.5515056848526001, 0.1767914593219757, 0.05273662507534027, 0.25628286600112915, -0.0471598245203495, 0.2084764689207077, 0.015022233128547668, -0.009165475144982338, -0.4387006163597107, 0.1255325973033905, -0.44689875841140747, 0.16329047083854675, -0.22194193303585052, -0.1644820272922516, 0.1744241714477539, 0.1510310173034668, 0.20039336383342743, 0.27586865425109863, -0.25964081287384033, -0.3683633506298065, -0.0015313737094402313, 0.08447340130805969, -0.105507031083107, -0.005641397088766098, -0.11010916531085968, 0.02930975705385208, -0.05018967017531395, -0.052080586552619934, -0.07920756191015244, 0.10054193437099457, 0.22559449076652527, 0.14840656518936157, 0.2355828732252121, 0.0756879672408104, 0.1608458310365677, 0.11984798312187195, -0.17027731239795685, 0.10041037946939468, 0.07497851550579071, 0.22816261649131775, -0.00568939745426178, -0.060822565108537674, -0.2377864420413971, 0.019549760967493057, -0.09706185013055801, 0.14464221894741058, 0.07090356200933456, -0.3821961283683777, -0.1715385615825653, 0.15149599313735962, 0.1430443525314331, 0.3885208070278168, -0.2838470935821533, -0.055461134761571884, 0.13709193468093872, 0.33206039667129517, -0.2296697348356247, -0.03430277854204178, -0.10635741055011749, -0.02651098743081093, 0.14678800106048584, 0.41650503873825073, 0.019543685019016266, -0.15862834453582764, 0.02800910547375679, 0.3485162854194641, 0.09560343623161316, 0.00783703662455082, 0.11774992942810059, 0.5754203796386719, -0.07555517554283142, -0.1917707324028015, 0.3972451984882355, -0.09475332498550415, 0.2671717405319214, 0.050782062113285065, -0.007247697561979294, 0.1873447149991989, -0.12844783067703247, -0.02497178316116333, -0.1402812898159027, -0.16238102316856384, -0.060746822506189346, 0.1946754902601242, 0.04704783111810684, -0.037952590733766556, 0.21071764826774597, 0.3304322063922882, -0.08316243439912796, 0.00037356093525886536, -0.05340861529111862, 0.13212555646896362, -0.45642489194869995, 0.016735520213842392, -0.008952990174293518, -0.2271054983139038, -0.09093842655420303, -0.11531142890453339, 0.08003592491149902, 0.1734863817691803, 0.022632267326116562, 0.022577155381441116, -0.24242284893989563, 0.16926974058151245, -0.1182447075843811, 0.33154597878456116, 0.1152731329202652, -0.563507080078125, 0.08830351382493973, 0.1676919162273407, 0.081056609749794, -0.006335585843771696, 0.377760112285614, 0.5824563503265381, 0.2747218608856201, -0.38578763604164124, 0.008333712816238403, -0.03207528963685036, -0.22991275787353516, -0.17170900106430054, -0.012660710141062737, -0.010799985378980637, 0.06621807813644409, 0.3786311447620392, 0.2713031768798828, -0.3373678922653198, 0.2552127540111542, 0.02715703845024109, 0.08883006125688553, 0.0769801214337349, 0.18662551045417786, 0.13229849934577942, -0.15754398703575134, -0.0551406629383564, -0.06993857026100159, -0.46008068323135376, 0.195163294672966, -0.048500943928956985, -0.22267454862594604, 0.2587851583957672, 0.12191882729530334, 0.1307075023651123, -0.029983794316649437, 0.377668559551239, 0.49100664258003235, -0.22767964005470276, -0.39059433341026306, -0.016805753111839294, -0.22629320621490479, 0.18092340230941772, -0.29212281107902527, -0.019002843648195267, 0.15530748665332794, 0.2821318805217743, -0.15646570920944214, 0.021088916808366776, 0.40155288577079773, -0.2273561954498291, -0.12542594969272614, 0.4207771122455597, -0.33863145112991333, 0.007845819927752018, -0.046816855669021606, -0.09722752124071121, 0.1461050659418106, -0.30365437269210815, -0.051894187927246094, -0.17777425050735474, 0.28736287355422974, -0.08383966982364655, -0.09058155119419098, 0.0023012161254882812, -0.10330798476934433, 0.3932238817214966, -0.1766413003206253, 0.23845618963241577, -0.15767671167850494, 0.13547590374946594, -0.06067715212702751, -0.1391061246395111, -0.17651520669460297, 0.01753212697803974, 0.45500820875167847, 0.3983963131904602, -0.10920003056526184, -0.399114727973938, -0.2596054673194885, 0.10744142532348633, 0.10040870308876038, 0.05985569953918457, -0.026543699204921722, 0.21656523644924164, -0.025183863937854767, 0.0028533935546875, -0.10969759523868561, 0.16308721899986267, 0.07563930749893188, 0.0006554387509822845, -0.36350512504577637, -0.6706463694572449, 0.4356437623500824, -0.28560519218444824, -0.2860698401927948, 0.0027960166335105896, -0.03061443567276001, 0.19766999781131744, 0.2935629189014435, -0.423115074634552, 0.11055055260658264, 0.24616198241710663, 0.09027818590402603, -0.3666905164718628, 0.0903906300663948, -0.11812605708837509, 0.09522339701652527, 0.017917677760124207, 0.16952702403068542, 0.045545194298028946, -0.16833734512329102, -0.2362016886472702, -0.32438918948173523 ]
https://github.com/huggingface/datasets/issues/5946
data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) # change this line to - data["train"] = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) After doing this change you code should run fine.
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ??
### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0"
27
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ?? ### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) # change this line to - data["train"] = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) After doing this change you code should run fine.
[ -0.18714331090450287, -0.29146265983581543, -0.20474481582641602, 0.2455594688653946, 0.14909164607524872, -0.0931643545627594, 0.32553473114967346, 0.5325318574905396, -0.18145307898521423, 0.26250627636909485, -0.03803275153040886, 0.2623401880264282, -0.2751728594303131, 0.08463205397129059, -0.13702046871185303, -0.14146819710731506, -0.11572933942079544, 0.22831565141677856, 0.01234460063278675, 0.1618497520685196, -0.22200682759284973, 0.11598178744316101, -0.25564903020858765, 0.18379512429237366, -0.17824098467826843, -0.13444936275482178, 0.011586017906665802, 0.04897971823811531, -0.1831437647342682, -0.4281555414199829, 0.23486600816249847, -0.42233142256736755, 0.17519617080688477, 0.7575787901878357, -0.00010833810665644705, 0.20821212232112885, 0.20941326022148132, -0.06108137220144272, -0.2739967703819275, -0.03218670189380646, 0.27400076389312744, -0.08183359354734421, -0.06049394607543945, -0.34036943316459656, -0.10887662321329117, -0.11809585243463516, -0.0911247506737709, 0.08609162271022797, 0.2919216454029083, 0.3951643705368042, 0.29977086186408997, 0.5734037160873413, 0.15735918283462524, -0.004583436995744705, 0.39597979187965393, -0.2986234128475189, -0.17237254977226257, 0.12629334628582, 0.2306351363658905, -0.10930247604846954, -0.34403860569000244, 0.3305622339248657, 0.113364078104496, -0.026948245242238045, -0.05634961277246475, -0.06686915457248688, 0.29530757665634155, -0.3012382984161377, -0.06857754290103912, 0.06763102114200592, 0.10988913476467133, -0.12438379228115082, -0.2887357473373413, -0.22405362129211426, -0.033861640840768814, -0.1980648636817932, 0.12846577167510986, -0.04351477324962616, -0.18561270833015442, 0.07850733399391174, 0.13473287224769592, 0.258441686630249, -0.20382758975028992, -0.0875319093465805, -0.25535905361175537, 0.6709121465682983, 0.020246043801307678, -0.05585077032446861, 0.33799058198928833, -0.0599864199757576, 0.5446838140487671, 0.18543905019760132, 0.09796632826328278, 0.11614929884672165, -0.24770121276378632, -0.29859358072280884, 0.2011989802122116, -0.2829151749610901, -0.08492304384708405, 0.09727305173873901, 0.07094467431306839, -0.06162435933947563, 0.3650719225406647, -0.0523645281791687, -0.014383130706846714, 0.4467044770717621, -0.15327726304531097, 0.506234347820282, 0.19824658334255219, 0.17897865176200867, -0.16833123564720154, -0.020264683291316032, -0.12865227460861206, -0.3499355912208557, 0.1499241143465042, 0.2346365600824356, 0.021753132343292236, 0.19096127152442932, -0.244333416223526, 0.1944049596786499, -0.07797762751579285, 0.043599989265203476, 0.3095036447048187, 0.4014035165309906, -0.037451617419719696, 0.09660618007183075, 0.06738579273223877, 0.023932654410600662, -0.28069260716438293, 0.06229696050286293, -0.30563247203826904, 0.19659925997257233, -0.16432800889015198, -0.3963042199611664, -0.024581748992204666, -0.2687665522098541, 0.2929766774177551, -0.1146552786231041, 0.15901954472064972, -0.014126695692539215, -0.091307133436203, -0.335003137588501, 0.14612260460853577, 0.24083715677261353, -0.1698623150587082, -0.10555237531661987, 0.23871324956417084, -0.025853127241134644, 0.04862929880619049, 0.23754030466079712, -0.29686620831489563, -0.34185129404067993, -0.00634907279163599, 0.3435903787612915, -0.06685323268175125, 0.12879934906959534, 0.11334541440010071, -0.19896140694618225, 0.29832035303115845, -0.1463731974363327, 0.10354991257190704, -0.39129573106765747, -0.01817212998867035, -0.29448723793029785, 0.23657581210136414, 0.163224995136261, -0.13177569210529327, 0.05617843568325043, 0.1417313516139984, 0.12213108688592911, 0.03886840119957924, 0.34022316336631775, -0.22736932337284088, 0.5167085528373718, -0.3468838930130005, 0.2756420969963074, 0.4128980040550232, -0.3304154574871063, -0.6089489459991455, 0.10945812612771988, -0.3541502058506012, -0.045711450278759, 0.05311039090156555, 0.024542521685361862, 0.15998347103595734, 0.02223941683769226, 0.32933682203292847, 0.13692450523376465, -0.1580452024936676, 0.1062549278140068, -0.29543015360832214, -0.01646074280142784, 0.02970290556550026, 0.07080309838056564, 0.5823972821235657, -0.15623264014720917, -0.16840219497680664, -0.07712603360414505, 0.1492239236831665, -0.00448809377849102, -0.06784477829933167, 0.15214784443378448, 0.12577654421329498, -0.06109263747930527, 0.18609240651130676, -0.1555328369140625, -0.09390145540237427, 0.1716909110546112, -0.3512204587459564, 0.002417988143861294, -0.16034553945064545, 0.06807974725961685, -0.33194005489349365, 0.0954226702451706, -0.3371700048446655, -0.2167247235774994, 0.30126696825027466, -0.03416420891880989, 0.12392188608646393, -0.08956091850996017, -0.22292593121528625, -0.18096573650836945, -0.14711710810661316, 0.020262569189071655, -0.142985001206398, 0.22384554147720337, -0.3654307723045349, -0.22020545601844788, -0.22680118680000305, 0.20460793375968933, 0.12361204624176025, -0.1933479607105255, -0.13438083231449127, 0.23267260193824768, -0.030541451647877693, -0.0674993246793747, -0.1253315508365631, -0.13171660900115967, -0.028443684801459312, -0.02999831736087799, -0.11272288113832474, 0.2550378143787384, 0.25631001591682434, -0.034822992980480194, 0.15667101740837097, 0.6024567484855652, -0.009607108309864998, 0.226262629032135, 0.02361007034778595, -0.24804788827896118, 0.020301111042499542, -0.14201052486896515, -0.021308619529008865, 0.1892644464969635, 0.28536537289619446, -0.15169867873191833, 0.2449483722448349, -0.1666671633720398, -0.22648656368255615, -0.18846532702445984, 0.12421953678131104, 0.04751471430063248, 0.09632259607315063, 0.12619182467460632, -0.09768874198198318, 0.13039204478263855, -0.24088972806930542, 0.09318014979362488, 0.2619120478630066, 0.24852275848388672, 0.009734801948070526, -0.039467476308345795, 0.1331195831298828, -0.1296388804912567, 0.20925463736057281, 0.08470810949802399, 0.22975347936153412, 0.5835295915603638, 0.1117188036441803, 0.050227295607328415, -0.17743556201457977, -0.3453409671783447, -0.09198607504367828, 0.4372389614582062, -0.2200707197189331, 0.26018938422203064, 0.09873183071613312, -0.06213631108403206, -0.15764570236206055, -0.3469374179840088, 0.036286864429712296, -0.33737462759017944, 0.1877148598432541, 0.26313766837120056, -0.18410715460777283, 0.12827470898628235, -0.12180623412132263, -0.005366384983062744, 0.33376380801200867, 0.039512358605861664, 0.06327292323112488, -0.11102388799190521, -0.15119428932666779, 0.21353989839553833, 0.20900671184062958, -0.31790101528167725, 0.16440895199775696, -0.12646758556365967, -0.0031477324664592743, 0.010358544066548347, -0.28369346261024475, 0.09914648532867432, -0.21208059787750244, 0.1090606153011322, 0.23379631340503693, 0.23148255050182343, -0.3687379062175751, -0.22416111826896667, 0.26331084966659546, -0.39922770857810974, -0.23665425181388855, 0.03492456674575806, 0.11430932581424713, 0.1967194378376007, -0.08643320947885513, -0.32991844415664673, -0.17720425128936768, -0.4696308672428131, 0.0665300041437149, -0.0898861438035965, 0.20996686816215515, 0.44876575469970703, 0.1825293004512787, 0.26394128799438477, 0.3643955588340759, -0.07129055261611938, 0.029016796499490738, -0.17786315083503723, 0.44092199206352234, -0.06147412955760956, -0.29233264923095703, -0.2630084455013275, -0.33668991923332214, 0.13084948062896729, -0.13686849176883698, -0.42681482434272766, 0.09110455960035324, -0.09786339104175568, -0.10907962918281555, -0.23417916893959045, 0.12735487520694733, 0.28372931480407715, -0.03251553326845169, -0.24296091496944427, -0.004171483218669891, 0.05569159984588623, -0.08118841797113419, 0.00720101036131382, 0.09598381817340851, -0.10182004421949387, 0.2820274233818054, 0.1422477513551712, 0.8831393122673035, -0.011805180460214615, -0.029587071388959885, 0.11560548841953278, -0.016876118257641792, 0.0556812509894371, -0.1177445501089096, -0.32656580209732056, -0.09618157148361206, 0.12953205406665802, -0.2556508183479309, 0.25731590390205383, -0.11746006458997726, -0.14738643169403076, -0.060156360268592834, -0.09893816709518433, -0.20951619744300842, -0.1885664016008377, 0.45065003633499146, -0.15046261250972748, 0.07783351838588715, -0.24638919532299042, 0.16143357753753662, -0.15593387186527252, 0.04750998690724373, -0.10225281864404678, -0.03212523087859154, -0.01638999953866005, -0.20645251870155334, -0.11927060037851334, -0.472229540348053, -0.3778599202632904, 0.14187195897102356, 0.28576764464378357, 0.3630947172641754, 0.19948314130306244, -0.415499210357666, 0.09981940686702728, -0.21379271149635315, 0.666243314743042, 0.12274567037820816, 0.038978222757577896, 0.2078012079000473, -0.1599317193031311, -0.29537177085876465, -0.3196379542350769, -0.19805388152599335, 0.13109701871871948, 0.2329121232032776, 0.38940858840942383, 0.023314788937568665, 0.05415693670511246, 0.09992591291666031, -0.040596820414066315, -0.14357154071331024, -0.30296024680137634, -0.2946266531944275, -0.23793759942054749, -0.1678246259689331, 0.5118195414543152, 0.2747534513473511, 0.2459683120250702, 0.018930606544017792, 0.015946000814437866, -0.09958024322986603, -0.17068292200565338, 0.055654577910900116, 0.2304246574640274, 0.27136221528053284, -0.06519955396652222, 0.020599447190761566, 0.06490421295166016, -0.03565489500761032, 0.36086350679397583, 0.3157641887664795, 0.00235946848988533, 0.19555538892745972, 0.1418066769838333, -0.0032748132944107056, 0.0757872462272644, 0.28622928261756897, -0.034636009484529495, 0.08881551027297974, -0.12125827372074127, 0.42126786708831787, 0.07182858884334564, -0.19191700220108032, 0.20607945322990417, -0.03995459899306297, -0.3647061884403229, -0.13239175081253052, 0.1673251986503601, -0.022570841014385223, 0.13155169785022736, 0.06652894616127014, -0.16018979251384735, -0.0907805860042572, 0.435218870639801, -0.03782861679792404, 0.750572919845581, 0.002665516920387745, 0.12184323370456696, 0.32202446460723877, 0.15643860399723053, 0.03759900853037834, -0.1322861760854721, 0.37961211800575256, -0.4147924780845642, -0.43460988998413086, -0.020577307790517807, -0.13396871089935303, -0.06169723719358444, -0.18919546902179718, -0.30671432614326477, 0.19026072323322296, -0.23619802296161652, 0.22307060658931732, -0.19963914155960083, -0.019519075751304626, 0.0292044784873724, 0.10150822252035141, -0.2837762236595154, 0.1464490294456482, 0.02716236561536789, 0.28136947751045227, -0.16729110479354858, -0.13503330945968628, -0.25014644861221313, -0.39118871092796326, -0.07939910888671875, -0.00005319714546203613, -0.2696834206581116, 0.2585657238960266, 0.06546051055192947, -0.40915754437446594, -0.1082453578710556, 0.16721278429031372, 0.04544372484087944, -0.05655256658792496, 0.09099706262350082, 0.05985771492123604, 0.46382081508636475, 0.022112291306257248, 0.023043964058160782, -0.0142366923391819, 0.3068968653678894, -0.06330551207065582, -0.18013830482959747, 0.19583606719970703, -0.025432534515857697, -0.40804368257522583, 0.259747713804245, 0.3259831368923187, 0.1480417549610138, -0.3486434817314148, 0.033640313893556595, -0.21178068220615387, -0.2333102524280548, -0.3319840431213379, 0.1945706307888031, -0.1014290601015091, -0.23963935673236847, 0.17380934953689575, 0.1895713061094284, -0.3431287407875061, -0.018169637769460678, 0.4550856649875641, 0.3530327081680298, 0.24877581000328064, 0.5828472971916199, 0.17447702586650848, -0.240425705909729, -0.3317686915397644, 0.20237571001052856, 0.22538308799266815, -0.28108716011047363, 0.22382852435112, -0.18262280523777008, -0.0780431255698204, 0.19019950926303864, 0.28673794865608215, 0.4288100302219391, 0.16487696766853333, -0.38295137882232666, -0.1927754282951355, -0.5515056848526001, 0.1767914593219757, 0.05273662507534027, 0.25628286600112915, -0.0471598245203495, 0.2084764689207077, 0.015022233128547668, -0.009165475144982338, -0.4387006163597107, 0.1255325973033905, -0.44689875841140747, 0.16329047083854675, -0.22194193303585052, -0.1644820272922516, 0.1744241714477539, 0.1510310173034668, 0.20039336383342743, 0.27586865425109863, -0.25964081287384033, -0.3683633506298065, -0.0015313737094402313, 0.08447340130805969, -0.105507031083107, -0.005641397088766098, -0.11010916531085968, 0.02930975705385208, -0.05018967017531395, -0.052080586552619934, -0.07920756191015244, 0.10054193437099457, 0.22559449076652527, 0.14840656518936157, 0.2355828732252121, 0.0756879672408104, 0.1608458310365677, 0.11984798312187195, -0.17027731239795685, 0.10041037946939468, 0.07497851550579071, 0.22816261649131775, -0.00568939745426178, -0.060822565108537674, -0.2377864420413971, 0.019549760967493057, -0.09706185013055801, 0.14464221894741058, 0.07090356200933456, -0.3821961283683777, -0.1715385615825653, 0.15149599313735962, 0.1430443525314331, 0.3885208070278168, -0.2838470935821533, -0.055461134761571884, 0.13709193468093872, 0.33206039667129517, -0.2296697348356247, -0.03430277854204178, -0.10635741055011749, -0.02651098743081093, 0.14678800106048584, 0.41650503873825073, 0.019543685019016266, -0.15862834453582764, 0.02800910547375679, 0.3485162854194641, 0.09560343623161316, 0.00783703662455082, 0.11774992942810059, 0.5754203796386719, -0.07555517554283142, -0.1917707324028015, 0.3972451984882355, -0.09475332498550415, 0.2671717405319214, 0.050782062113285065, -0.007247697561979294, 0.1873447149991989, -0.12844783067703247, -0.02497178316116333, -0.1402812898159027, -0.16238102316856384, -0.060746822506189346, 0.1946754902601242, 0.04704783111810684, -0.037952590733766556, 0.21071764826774597, 0.3304322063922882, -0.08316243439912796, 0.00037356093525886536, -0.05340861529111862, 0.13212555646896362, -0.45642489194869995, 0.016735520213842392, -0.008952990174293518, -0.2271054983139038, -0.09093842655420303, -0.11531142890453339, 0.08003592491149902, 0.1734863817691803, 0.022632267326116562, 0.022577155381441116, -0.24242284893989563, 0.16926974058151245, -0.1182447075843811, 0.33154597878456116, 0.1152731329202652, -0.563507080078125, 0.08830351382493973, 0.1676919162273407, 0.081056609749794, -0.006335585843771696, 0.377760112285614, 0.5824563503265381, 0.2747218608856201, -0.38578763604164124, 0.008333712816238403, -0.03207528963685036, -0.22991275787353516, -0.17170900106430054, -0.012660710141062737, -0.010799985378980637, 0.06621807813644409, 0.3786311447620392, 0.2713031768798828, -0.3373678922653198, 0.2552127540111542, 0.02715703845024109, 0.08883006125688553, 0.0769801214337349, 0.18662551045417786, 0.13229849934577942, -0.15754398703575134, -0.0551406629383564, -0.06993857026100159, -0.46008068323135376, 0.195163294672966, -0.048500943928956985, -0.22267454862594604, 0.2587851583957672, 0.12191882729530334, 0.1307075023651123, -0.029983794316649437, 0.377668559551239, 0.49100664258003235, -0.22767964005470276, -0.39059433341026306, -0.016805753111839294, -0.22629320621490479, 0.18092340230941772, -0.29212281107902527, -0.019002843648195267, 0.15530748665332794, 0.2821318805217743, -0.15646570920944214, 0.021088916808366776, 0.40155288577079773, -0.2273561954498291, -0.12542594969272614, 0.4207771122455597, -0.33863145112991333, 0.007845819927752018, -0.046816855669021606, -0.09722752124071121, 0.1461050659418106, -0.30365437269210815, -0.051894187927246094, -0.17777425050735474, 0.28736287355422974, -0.08383966982364655, -0.09058155119419098, 0.0023012161254882812, -0.10330798476934433, 0.3932238817214966, -0.1766413003206253, 0.23845618963241577, -0.15767671167850494, 0.13547590374946594, -0.06067715212702751, -0.1391061246395111, -0.17651520669460297, 0.01753212697803974, 0.45500820875167847, 0.3983963131904602, -0.10920003056526184, -0.399114727973938, -0.2596054673194885, 0.10744142532348633, 0.10040870308876038, 0.05985569953918457, -0.026543699204921722, 0.21656523644924164, -0.025183863937854767, 0.0028533935546875, -0.10969759523868561, 0.16308721899986267, 0.07563930749893188, 0.0006554387509822845, -0.36350512504577637, -0.6706463694572449, 0.4356437623500824, -0.28560519218444824, -0.2860698401927948, 0.0027960166335105896, -0.03061443567276001, 0.19766999781131744, 0.2935629189014435, -0.423115074634552, 0.11055055260658264, 0.24616198241710663, 0.09027818590402603, -0.3666905164718628, 0.0903906300663948, -0.11812605708837509, 0.09522339701652527, 0.017917677760124207, 0.16952702403068542, 0.045545194298028946, -0.16833734512329102, -0.2362016886472702, -0.32438918948173523 ]
https://github.com/huggingface/datasets/issues/5946
> > > > @syngokhan did u solve it? I am desperate refer to my earlier comment. you will find the solution.
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ??
### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0"
22
IndexError Not Solving -> IndexError: Invalid key: ?? is out of bounds for size 0 or ?? ### Describe the bug in <cell line: 1>:1 │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1537 in train │ │ │ │ 1534 │ │ inner_training_loop = find_executable_batch_size( │ │ 1535 │ │ │ self._inner_training_loop, self._train_batch_size, args.auto_find_batch_size │ │ 1536 │ │ ) │ │ ❱ 1537 │ │ return inner_training_loop( │ │ 1538 │ │ │ args=args, │ │ 1539 │ │ │ resume_from_checkpoint=resume_from_checkpoint, │ │ 1540 │ │ │ trial=trial, │ │ │ │ /usr/local/lib/python3.10/dist-packages/transformers/trainer.py:1789 in _inner_training_loop │ │ │ │ 1786 │ │ │ │ rng_to_sync = True │ │ 1787 │ │ │ │ │ 1788 │ │ │ step = -1 │ │ ❱ 1789 │ │ │ for step, inputs in enumerate(epoch_iterator): │ │ 1790 │ │ │ │ total_batched_samples += 1 │ │ 1791 │ │ │ │ if rng_to_sync: │ │ 1792 │ │ │ │ │ self._load_rng_state(resume_from_checkpoint) │ │ │ │ /usr/local/lib/python3.10/dist-packages/accelerate/data_loader.py:377 in __iter__ │ │ │ │ 374 │ │ dataloader_iter = super().__iter__() │ │ 375 │ │ # We iterate one batch ahead to check when we are at the end │ │ 376 │ │ try: │ │ ❱ 377 │ │ │ current_batch = next(dataloader_iter) │ │ 378 │ │ except StopIteration: │ │ 379 │ │ │ yield │ │ 380 │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:633 in __next__ │ │ │ │ 630 │ │ │ if self._sampler_iter is None: │ │ 631 │ │ │ │ # TODO(https://github.com/pytorch/pytorch/issues/76750) │ │ 632 │ │ │ │ self._reset() # type: ignore[call-arg] │ │ ❱ 633 │ │ │ data = self._next_data() │ │ 634 │ │ │ self._num_yielded += 1 │ │ 635 │ │ │ if self._dataset_kind == _DatasetKind.Iterable and \ │ │ 636 │ │ │ │ │ self._IterableDataset_len_called is not None and \ │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:677 in _next_data │ │ │ │ 674 │ │ │ 675 │ def _next_data(self): │ │ 676 │ │ index = self._next_index() # may raise StopIteration │ │ ❱ 677 │ │ data = self._dataset_fetcher.fetch(index) # may raise StopIteration │ │ 678 │ │ if self._pin_memory: │ │ 679 │ │ │ data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) │ │ 680 │ │ return data │ │ │ │ /usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py:49 in fetch │ │ │ │ 46 │ def 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] │ │ 52 │ │ else: │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2782 in __getitems__ │ │ │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ ❱ 2782 │ │ batch = self.__getitem__(keys) │ │ 2783 │ │ n_examples = len(batch[next(iter(batch))]) │ │ 2784 │ │ return [{col: array[i] for col, array in batch.items()} for i in range(n_example │ │ 2785 │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2778 in __getitem__ │ │ │ │ 2775 │ │ │ 2776 │ def __getitem__(self, key): # noqa: F811 │ │ 2777 │ │ """Can be used to index columns (by string names) or rows (by integer index or i │ │ ❱ 2778 │ │ return self._getitem(key) │ │ 2779 │ │ │ 2780 │ def __getitems__(self, keys: List) -> List: │ │ 2781 │ │ """Can be used to get a batch using a list of integers indices.""" │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py:2762 in _getitem │ │ │ │ 2759 │ │ format_kwargs = kwargs["format_kwargs"] if "format_kwargs" in kwargs else self._ │ │ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │ │ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │ │ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │ │ 2763 │ │ formatted_output = format_table( │ │ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │ │ 2765 │ │ ) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:578 in query_table │ │ │ │ 575 │ │ _check_valid_column_key(key, table.column_names) │ │ 576 │ else: │ │ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │ │ ❱ 578 │ │ _check_valid_index_key(key, size) │ │ 579 │ # Query the main table │ │ 580 │ if indices is None: │ │ 581 │ │ pa_subtable = _query_table(table, key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:531 in │ │ _check_valid_index_key │ │ │ │ 528 │ │ │ _check_valid_index_key(min(key), size=size) │ │ 529 │ elif isinstance(key, Iterable): │ │ 530 │ │ if len(key) > 0: │ │ ❱ 531 │ │ │ _check_valid_index_key(int(max(key)), size=size) │ │ 532 │ │ │ _check_valid_index_key(int(min(key)), size=size) │ │ 533 │ else: │ │ 534 │ │ _raise_bad_key_type(key) │ │ │ │ /usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py:521 in │ │ _check_valid_index_key │ │ │ │ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │ │ 519 │ if isinstance(key, int): │ │ 520 │ │ if (key < 0 and key + size < 0) or (key >= size): │ │ ❱ 521 │ │ │ raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") │ │ 522 │ │ return │ │ 523 │ elif isinstance(key, slice): │ │ 524 │ │ pass ### Steps to reproduce the bug `` import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" 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}" ) MODEL_NAME = "tiiuae/falcon-7b" bnb_config = BitsAndBytesConfig( load_in_4bit = True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16, ) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, device_map = "auto", trust_remote_code = True, quantization_config = bnb_config ) tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) tokenizer.pad_token = tokenizer.eos_token model.gradient_checkpointing_enable() model = prepare_model_for_kbit_training(model) config = LoraConfig( r = 16, lora_alpha = 32, target_modules = ["query_key_value"], lora_dropout = 0.05, bias = "none", task_type = "CASUAL_LM" ) model = get_peft_model(model,config) print_trainable_parameters(model) def generate_prompt(data_point): return f""" <human>: {data_point["question"]} <assistant>: {data_point["answer"]} """.strip() def generate_and_tokenize_prompt(data_point): full_prompt = generate_prompt(data_point) tokenized_full_prompt = tokenizer(full_prompt, padding = True, truncation = True,return_tensors = None) return dict({ "input_ids" : tokenized_full_prompt["input_ids"], "attention_mask" : tokenized_full_prompt["attention_mask"] }) data = data["train"].shuffle().map(generate_and_tokenize_prompt, batched = False) OUTPUT_DIR = "experiments" trainings_args = transformers.TrainingArguments( per_device_train_batch_size = 1, gradient_accumulation_steps = 4, num_train_epochs = 1, learning_rate = 2e-4, fp16 = True, save_total_limit = 3, logging_steps = 1, output_dir = OUTPUT_DIR, max_steps = 80, optim = "paged_adamw_8bit", lr_scheduler_type = "cosine", warmup_ratio = 0.05, #remove_unused_columns=True ) trainer = transformers.Trainer( model = model, train_dataset = data, args = trainings_args, data_collator = transformers.DataCollatorForLanguageModeling(tokenizer, mlm=False), ) model.config.use_cache = False trainer.train() IndexError: Invalid key: 32 is out of bounds for size 0 DataSet Format is like : [{"question": "How can I create an account?", "answer": "To create an account, click on the 'Sign Up' button on the top right corner of our website and follow the instructions to complete the registration process."}, .... ] ### Expected behavior - ### Environment info !pip install -q pip !pip install -q bitsandbytes==0.39.0 !pip install -q torch==2.0.1 !pip install -q git+https://github.com/huggingface/transformers.git !pip install -q git+https://github.com/huggingface/peft.git !pip install -q git+https://github.com/huggingface/accelerate.git !pip install -q datasets !pip install -q loralib==0.1.1 !pip install -q einops==0.6.1 import json import os from pprint import pprint import bitsandbytes as bnb import pandas as pd import torch import torch.nn as nn import transformers from datasets import Dataset,load_dataset from peft import ( LoraConfig, PeftConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training ) from transformers import ( AutoConfig, AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, ) os.environ["CUDA_VISIBLE_DEVICES"] = "0" > > > > @syngokhan did u solve it? I am desperate refer to my earlier comment. you will find the solution.
[ -0.18714331090450287, -0.29146265983581543, -0.20474481582641602, 0.2455594688653946, 0.14909164607524872, -0.0931643545627594, 0.32553473114967346, 0.5325318574905396, -0.18145307898521423, 0.26250627636909485, -0.03803275153040886, 0.2623401880264282, -0.2751728594303131, 0.08463205397129059, -0.13702046871185303, -0.14146819710731506, -0.11572933942079544, 0.22831565141677856, 0.01234460063278675, 0.1618497520685196, -0.22200682759284973, 0.11598178744316101, -0.25564903020858765, 0.18379512429237366, -0.17824098467826843, -0.13444936275482178, 0.011586017906665802, 0.04897971823811531, -0.1831437647342682, -0.4281555414199829, 0.23486600816249847, -0.42233142256736755, 0.17519617080688477, 0.7575787901878357, -0.00010833810665644705, 0.20821212232112885, 0.20941326022148132, -0.06108137220144272, -0.2739967703819275, -0.03218670189380646, 0.27400076389312744, -0.08183359354734421, -0.06049394607543945, -0.34036943316459656, -0.10887662321329117, -0.11809585243463516, -0.0911247506737709, 0.08609162271022797, 0.2919216454029083, 0.3951643705368042, 0.29977086186408997, 0.5734037160873413, 0.15735918283462524, -0.004583436995744705, 0.39597979187965393, -0.2986234128475189, -0.17237254977226257, 0.12629334628582, 0.2306351363658905, -0.10930247604846954, -0.34403860569000244, 0.3305622339248657, 0.113364078104496, -0.026948245242238045, -0.05634961277246475, -0.06686915457248688, 0.29530757665634155, -0.3012382984161377, -0.06857754290103912, 0.06763102114200592, 0.10988913476467133, -0.12438379228115082, -0.2887357473373413, -0.22405362129211426, -0.033861640840768814, -0.1980648636817932, 0.12846577167510986, -0.04351477324962616, -0.18561270833015442, 0.07850733399391174, 0.13473287224769592, 0.258441686630249, -0.20382758975028992, -0.0875319093465805, -0.25535905361175537, 0.6709121465682983, 0.020246043801307678, -0.05585077032446861, 0.33799058198928833, -0.0599864199757576, 0.5446838140487671, 0.18543905019760132, 0.09796632826328278, 0.11614929884672165, -0.24770121276378632, -0.29859358072280884, 0.2011989802122116, -0.2829151749610901, -0.08492304384708405, 0.09727305173873901, 0.07094467431306839, -0.06162435933947563, 0.3650719225406647, -0.0523645281791687, -0.014383130706846714, 0.4467044770717621, -0.15327726304531097, 0.506234347820282, 0.19824658334255219, 0.17897865176200867, -0.16833123564720154, -0.020264683291316032, -0.12865227460861206, -0.3499355912208557, 0.1499241143465042, 0.2346365600824356, 0.021753132343292236, 0.19096127152442932, -0.244333416223526, 0.1944049596786499, -0.07797762751579285, 0.043599989265203476, 0.3095036447048187, 0.4014035165309906, -0.037451617419719696, 0.09660618007183075, 0.06738579273223877, 0.023932654410600662, -0.28069260716438293, 0.06229696050286293, -0.30563247203826904, 0.19659925997257233, -0.16432800889015198, -0.3963042199611664, -0.024581748992204666, -0.2687665522098541, 0.2929766774177551, -0.1146552786231041, 0.15901954472064972, -0.014126695692539215, -0.091307133436203, -0.335003137588501, 0.14612260460853577, 0.24083715677261353, -0.1698623150587082, -0.10555237531661987, 0.23871324956417084, -0.025853127241134644, 0.04862929880619049, 0.23754030466079712, -0.29686620831489563, -0.34185129404067993, -0.00634907279163599, 0.3435903787612915, -0.06685323268175125, 0.12879934906959534, 0.11334541440010071, -0.19896140694618225, 0.29832035303115845, -0.1463731974363327, 0.10354991257190704, -0.39129573106765747, -0.01817212998867035, -0.29448723793029785, 0.23657581210136414, 0.163224995136261, -0.13177569210529327, 0.05617843568325043, 0.1417313516139984, 0.12213108688592911, 0.03886840119957924, 0.34022316336631775, -0.22736932337284088, 0.5167085528373718, -0.3468838930130005, 0.2756420969963074, 0.4128980040550232, -0.3304154574871063, -0.6089489459991455, 0.10945812612771988, -0.3541502058506012, -0.045711450278759, 0.05311039090156555, 0.024542521685361862, 0.15998347103595734, 0.02223941683769226, 0.32933682203292847, 0.13692450523376465, -0.1580452024936676, 0.1062549278140068, -0.29543015360832214, -0.01646074280142784, 0.02970290556550026, 0.07080309838056564, 0.5823972821235657, -0.15623264014720917, -0.16840219497680664, -0.07712603360414505, 0.1492239236831665, -0.00448809377849102, -0.06784477829933167, 0.15214784443378448, 0.12577654421329498, -0.06109263747930527, 0.18609240651130676, -0.1555328369140625, -0.09390145540237427, 0.1716909110546112, -0.3512204587459564, 0.002417988143861294, -0.16034553945064545, 0.06807974725961685, -0.33194005489349365, 0.0954226702451706, -0.3371700048446655, -0.2167247235774994, 0.30126696825027466, -0.03416420891880989, 0.12392188608646393, -0.08956091850996017, -0.22292593121528625, -0.18096573650836945, -0.14711710810661316, 0.020262569189071655, -0.142985001206398, 0.22384554147720337, -0.3654307723045349, -0.22020545601844788, -0.22680118680000305, 0.20460793375968933, 0.12361204624176025, -0.1933479607105255, -0.13438083231449127, 0.23267260193824768, -0.030541451647877693, -0.0674993246793747, -0.1253315508365631, -0.13171660900115967, -0.028443684801459312, -0.02999831736087799, -0.11272288113832474, 0.2550378143787384, 0.25631001591682434, -0.034822992980480194, 0.15667101740837097, 0.6024567484855652, -0.009607108309864998, 0.226262629032135, 0.02361007034778595, -0.24804788827896118, 0.020301111042499542, -0.14201052486896515, -0.021308619529008865, 0.1892644464969635, 0.28536537289619446, -0.15169867873191833, 0.2449483722448349, -0.1666671633720398, -0.22648656368255615, -0.18846532702445984, 0.12421953678131104, 0.04751471430063248, 0.09632259607315063, 0.12619182467460632, -0.09768874198198318, 0.13039204478263855, -0.24088972806930542, 0.09318014979362488, 0.2619120478630066, 0.24852275848388672, 0.009734801948070526, -0.039467476308345795, 0.1331195831298828, -0.1296388804912567, 0.20925463736057281, 0.08470810949802399, 0.22975347936153412, 0.5835295915603638, 0.1117188036441803, 0.050227295607328415, -0.17743556201457977, -0.3453409671783447, -0.09198607504367828, 0.4372389614582062, -0.2200707197189331, 0.26018938422203064, 0.09873183071613312, -0.06213631108403206, -0.15764570236206055, -0.3469374179840088, 0.036286864429712296, -0.33737462759017944, 0.1877148598432541, 0.26313766837120056, -0.18410715460777283, 0.12827470898628235, -0.12180623412132263, -0.005366384983062744, 0.33376380801200867, 0.039512358605861664, 0.06327292323112488, -0.11102388799190521, -0.15119428932666779, 0.21353989839553833, 0.20900671184062958, -0.31790101528167725, 0.16440895199775696, -0.12646758556365967, -0.0031477324664592743, 0.010358544066548347, -0.28369346261024475, 0.09914648532867432, -0.21208059787750244, 0.1090606153011322, 0.23379631340503693, 0.23148255050182343, -0.3687379062175751, -0.22416111826896667, 0.26331084966659546, -0.39922770857810974, -0.23665425181388855, 0.03492456674575806, 0.11430932581424713, 0.1967194378376007, -0.08643320947885513, -0.32991844415664673, -0.17720425128936768, -0.4696308672428131, 0.0665300041437149, -0.0898861438035965, 0.20996686816215515, 0.44876575469970703, 0.1825293004512787, 0.26394128799438477, 0.3643955588340759, -0.07129055261611938, 0.029016796499490738, -0.17786315083503723, 0.44092199206352234, -0.06147412955760956, -0.29233264923095703, -0.2630084455013275, -0.33668991923332214, 0.13084948062896729, -0.13686849176883698, -0.42681482434272766, 0.09110455960035324, -0.09786339104175568, -0.10907962918281555, -0.23417916893959045, 0.12735487520694733, 0.28372931480407715, -0.03251553326845169, -0.24296091496944427, -0.004171483218669891, 0.05569159984588623, -0.08118841797113419, 0.00720101036131382, 0.09598381817340851, -0.10182004421949387, 0.2820274233818054, 0.1422477513551712, 0.8831393122673035, -0.011805180460214615, -0.029587071388959885, 0.11560548841953278, -0.016876118257641792, 0.0556812509894371, -0.1177445501089096, -0.32656580209732056, -0.09618157148361206, 0.12953205406665802, -0.2556508183479309, 0.25731590390205383, -0.11746006458997726, -0.14738643169403076, -0.060156360268592834, -0.09893816709518433, -0.20951619744300842, -0.1885664016008377, 0.45065003633499146, -0.15046261250972748, 0.07783351838588715, -0.24638919532299042, 0.16143357753753662, -0.15593387186527252, 0.04750998690724373, -0.10225281864404678, -0.03212523087859154, -0.01638999953866005, -0.20645251870155334, -0.11927060037851334, -0.472229540348053, -0.3778599202632904, 0.14187195897102356, 0.28576764464378357, 0.3630947172641754, 0.19948314130306244, -0.415499210357666, 0.09981940686702728, -0.21379271149635315, 0.666243314743042, 0.12274567037820816, 0.038978222757577896, 0.2078012079000473, -0.1599317193031311, -0.29537177085876465, -0.3196379542350769, -0.19805388152599335, 0.13109701871871948, 0.2329121232032776, 0.38940858840942383, 0.023314788937568665, 0.05415693670511246, 0.09992591291666031, -0.040596820414066315, -0.14357154071331024, -0.30296024680137634, -0.2946266531944275, -0.23793759942054749, -0.1678246259689331, 0.5118195414543152, 0.2747534513473511, 0.2459683120250702, 0.018930606544017792, 0.015946000814437866, -0.09958024322986603, -0.17068292200565338, 0.055654577910900116, 0.2304246574640274, 0.27136221528053284, -0.06519955396652222, 0.020599447190761566, 0.06490421295166016, -0.03565489500761032, 0.36086350679397583, 0.3157641887664795, 0.00235946848988533, 0.19555538892745972, 0.1418066769838333, -0.0032748132944107056, 0.0757872462272644, 0.28622928261756897, -0.034636009484529495, 0.08881551027297974, -0.12125827372074127, 0.42126786708831787, 0.07182858884334564, -0.19191700220108032, 0.20607945322990417, -0.03995459899306297, -0.3647061884403229, -0.13239175081253052, 0.1673251986503601, -0.022570841014385223, 0.13155169785022736, 0.06652894616127014, -0.16018979251384735, -0.0907805860042572, 0.435218870639801, -0.03782861679792404, 0.750572919845581, 0.002665516920387745, 0.12184323370456696, 0.32202446460723877, 0.15643860399723053, 0.03759900853037834, -0.1322861760854721, 0.37961211800575256, -0.4147924780845642, -0.43460988998413086, -0.020577307790517807, -0.13396871089935303, -0.06169723719358444, -0.18919546902179718, -0.30671432614326477, 0.19026072323322296, -0.23619802296161652, 0.22307060658931732, -0.19963914155960083, -0.019519075751304626, 0.0292044784873724, 0.10150822252035141, -0.2837762236595154, 0.1464490294456482, 0.02716236561536789, 0.28136947751045227, -0.16729110479354858, -0.13503330945968628, -0.25014644861221313, -0.39118871092796326, -0.07939910888671875, -0.00005319714546203613, -0.2696834206581116, 0.2585657238960266, 0.06546051055192947, -0.40915754437446594, -0.1082453578710556, 0.16721278429031372, 0.04544372484087944, -0.05655256658792496, 0.09099706262350082, 0.05985771492123604, 0.46382081508636475, 0.022112291306257248, 0.023043964058160782, -0.0142366923391819, 0.3068968653678894, -0.06330551207065582, -0.18013830482959747, 0.19583606719970703, -0.025432534515857697, -0.40804368257522583, 0.259747713804245, 0.3259831368923187, 0.1480417549610138, -0.3486434817314148, 0.033640313893556595, -0.21178068220615387, -0.2333102524280548, -0.3319840431213379, 0.1945706307888031, -0.1014290601015091, -0.23963935673236847, 0.17380934953689575, 0.1895713061094284, -0.3431287407875061, -0.018169637769460678, 0.4550856649875641, 0.3530327081680298, 0.24877581000328064, 0.5828472971916199, 0.17447702586650848, -0.240425705909729, -0.3317686915397644, 0.20237571001052856, 0.22538308799266815, -0.28108716011047363, 0.22382852435112, -0.18262280523777008, -0.0780431255698204, 0.19019950926303864, 0.28673794865608215, 0.4288100302219391, 0.16487696766853333, -0.38295137882232666, -0.1927754282951355, -0.5515056848526001, 0.1767914593219757, 0.05273662507534027, 0.25628286600112915, -0.0471598245203495, 0.2084764689207077, 0.015022233128547668, -0.009165475144982338, -0.4387006163597107, 0.1255325973033905, -0.44689875841140747, 0.16329047083854675, -0.22194193303585052, -0.1644820272922516, 0.1744241714477539, 0.1510310173034668, 0.20039336383342743, 0.27586865425109863, -0.25964081287384033, -0.3683633506298065, -0.0015313737094402313, 0.08447340130805969, -0.105507031083107, -0.005641397088766098, -0.11010916531085968, 0.02930975705385208, -0.05018967017531395, -0.052080586552619934, -0.07920756191015244, 0.10054193437099457, 0.22559449076652527, 0.14840656518936157, 0.2355828732252121, 0.0756879672408104, 0.1608458310365677, 0.11984798312187195, -0.17027731239795685, 0.10041037946939468, 0.07497851550579071, 0.22816261649131775, -0.00568939745426178, -0.060822565108537674, -0.2377864420413971, 0.019549760967493057, -0.09706185013055801, 0.14464221894741058, 0.07090356200933456, -0.3821961283683777, -0.1715385615825653, 0.15149599313735962, 0.1430443525314331, 0.3885208070278168, -0.2838470935821533, -0.055461134761571884, 0.13709193468093872, 0.33206039667129517, -0.2296697348356247, -0.03430277854204178, -0.10635741055011749, -0.02651098743081093, 0.14678800106048584, 0.41650503873825073, 0.019543685019016266, -0.15862834453582764, 0.02800910547375679, 0.3485162854194641, 0.09560343623161316, 0.00783703662455082, 0.11774992942810059, 0.5754203796386719, -0.07555517554283142, -0.1917707324028015, 0.3972451984882355, -0.09475332498550415, 0.2671717405319214, 0.050782062113285065, -0.007247697561979294, 0.1873447149991989, -0.12844783067703247, -0.02497178316116333, -0.1402812898159027, -0.16238102316856384, -0.060746822506189346, 0.1946754902601242, 0.04704783111810684, -0.037952590733766556, 0.21071764826774597, 0.3304322063922882, -0.08316243439912796, 0.00037356093525886536, -0.05340861529111862, 0.13212555646896362, -0.45642489194869995, 0.016735520213842392, -0.008952990174293518, -0.2271054983139038, -0.09093842655420303, -0.11531142890453339, 0.08003592491149902, 0.1734863817691803, 0.022632267326116562, 0.022577155381441116, -0.24242284893989563, 0.16926974058151245, -0.1182447075843811, 0.33154597878456116, 0.1152731329202652, -0.563507080078125, 0.08830351382493973, 0.1676919162273407, 0.081056609749794, -0.006335585843771696, 0.377760112285614, 0.5824563503265381, 0.2747218608856201, -0.38578763604164124, 0.008333712816238403, -0.03207528963685036, -0.22991275787353516, -0.17170900106430054, -0.012660710141062737, -0.010799985378980637, 0.06621807813644409, 0.3786311447620392, 0.2713031768798828, -0.3373678922653198, 0.2552127540111542, 0.02715703845024109, 0.08883006125688553, 0.0769801214337349, 0.18662551045417786, 0.13229849934577942, -0.15754398703575134, -0.0551406629383564, -0.06993857026100159, -0.46008068323135376, 0.195163294672966, -0.048500943928956985, -0.22267454862594604, 0.2587851583957672, 0.12191882729530334, 0.1307075023651123, -0.029983794316649437, 0.377668559551239, 0.49100664258003235, -0.22767964005470276, -0.39059433341026306, -0.016805753111839294, -0.22629320621490479, 0.18092340230941772, -0.29212281107902527, -0.019002843648195267, 0.15530748665332794, 0.2821318805217743, -0.15646570920944214, 0.021088916808366776, 0.40155288577079773, -0.2273561954498291, -0.12542594969272614, 0.4207771122455597, -0.33863145112991333, 0.007845819927752018, -0.046816855669021606, -0.09722752124071121, 0.1461050659418106, -0.30365437269210815, -0.051894187927246094, -0.17777425050735474, 0.28736287355422974, -0.08383966982364655, -0.09058155119419098, 0.0023012161254882812, -0.10330798476934433, 0.3932238817214966, -0.1766413003206253, 0.23845618963241577, -0.15767671167850494, 0.13547590374946594, -0.06067715212702751, -0.1391061246395111, -0.17651520669460297, 0.01753212697803974, 0.45500820875167847, 0.3983963131904602, -0.10920003056526184, -0.399114727973938, -0.2596054673194885, 0.10744142532348633, 0.10040870308876038, 0.05985569953918457, -0.026543699204921722, 0.21656523644924164, -0.025183863937854767, 0.0028533935546875, -0.10969759523868561, 0.16308721899986267, 0.07563930749893188, 0.0006554387509822845, -0.36350512504577637, -0.6706463694572449, 0.4356437623500824, -0.28560519218444824, -0.2860698401927948, 0.0027960166335105896, -0.03061443567276001, 0.19766999781131744, 0.2935629189014435, -0.423115074634552, 0.11055055260658264, 0.24616198241710663, 0.09027818590402603, -0.3666905164718628, 0.0903906300663948, -0.11812605708837509, 0.09522339701652527, 0.017917677760124207, 0.16952702403068542, 0.045545194298028946, -0.16833734512329102, -0.2362016886472702, -0.32438918948173523 ]
https://github.com/huggingface/datasets/issues/5945
Hi ! Feel free to re-run your code later, it will resume automatically where you left
Failing to upload dataset to the hub
### Describe the bug Trying to upload a dataset of hundreds of thousands of audio samples (the total volume is not very large, 60 gb) to the hub with push_to_hub, it doesn't work. From time to time one piece of the data (parquet) gets pushed and then I get RemoteDisconnected even though my internet is stable. Please help. I'm trying to upload the dataset for almost a week. Thanks ### Steps to reproduce the bug not relevant ### Expected behavior Be able to upload thedataset ### Environment info python: 3.9
16
Failing to upload dataset to the hub ### Describe the bug Trying to upload a dataset of hundreds of thousands of audio samples (the total volume is not very large, 60 gb) to the hub with push_to_hub, it doesn't work. From time to time one piece of the data (parquet) gets pushed and then I get RemoteDisconnected even though my internet is stable. Please help. I'm trying to upload the dataset for almost a week. Thanks ### Steps to reproduce the bug not relevant ### Expected behavior Be able to upload thedataset ### Environment info python: 3.9 Hi ! Feel free to re-run your code later, it will resume automatically where you left
[ -0.3492951989173889, -0.43613675236701965, 0.011495642364025116, 0.13727526366710663, 0.14236441254615784, -0.1314420849084854, 0.1631830632686615, 0.24041369557380676, -0.09034931659698486, 0.07815927267074585, 0.15260639786720276, 0.2544565498828888, -0.19957593083381653, 0.12632617354393005, 0.20030830800533295, 0.08879995346069336, 0.42616650462150574, -0.03783382102847099, 0.26855775713920593, -0.2679549753665924, -0.30228304862976074, -0.06311776489019394, -0.16321030259132385, -0.27663397789001465, -0.41008827090263367, -0.18497271835803986, -0.03467981517314911, 0.306924045085907, -0.15620487928390503, -0.21452869474887848, 0.037379905581474304, 0.05414402112364769, 0.01577237993478775, 0.6562038064002991, -0.00011800123320426792, -0.1345149129629135, 0.5221816301345825, -0.16618667542934418, -0.2994537055492401, -0.1862908899784088, -0.4774814248085022, -0.2521989047527313, -0.17596672475337982, 0.04649052023887634, 0.1194247156381607, 0.254970908164978, -0.0304789450019598, 0.043025702238082886, 0.36904335021972656, 0.4134593605995178, 0.16768664121627808, 0.22176028788089752, 0.41344547271728516, -0.08793139457702637, 0.3026972711086273, 0.282089501619339, -0.10510101169347763, 0.26140260696411133, 0.6497215032577515, 0.17680612206459045, 0.056910190731287, -0.24270792305469513, 0.06993062049150467, -0.1673993468284607, 0.06944982707500458, -0.1106252670288086, -0.3575269281864166, -0.32986974716186523, 0.11408160626888275, -0.0013098111376166344, 0.4589937925338745, -0.2029801458120346, -0.4296274483203888, -0.10606973618268967, -0.0759880542755127, -0.22369715571403503, 0.3558027744293213, 0.23314616084098816, -0.23947972059249878, -0.07717138528823853, -0.08560586720705032, -0.2056451141834259, -0.17851993441581726, 0.23823609948158264, 0.0758943185210228, 0.198052778840065, -0.025820273905992508, 0.04426056519150734, -0.04099864140152931, -0.3707570731639862, 0.3923777937889099, -0.18161754310131073, 0.09088873863220215, -0.02384059503674507, -0.557597279548645, -0.0703461766242981, 0.04954942688345909, 0.12601983547210693, 0.008591867983341217, 0.1646665632724762, -0.268892377614975, 0.05164780467748642, -0.09015869349241257, 0.06765769422054291, 0.6570222973823547, -0.007972758263349533, -0.09273647516965866, 0.08477801084518433, 0.28219038248062134, 0.3447200357913971, 0.04608859121799469, 0.059286314994096756, -0.07030414044857025, -0.13733699917793274, 0.23053167760372162, -0.05284084752202034, 0.3855370879173279, -0.24851252138614655, -0.30897217988967896, 0.18954253196716309, 0.03627007454633713, 0.2590285539627075, -0.0628102645277977, 0.04974823445081711, 0.0001739412546157837, 0.031828973442316055, -0.22554901242256165, 0.3628074824810028, -0.00697195902466774, -0.020495858043432236, -0.1553630828857422, 0.2221677005290985, 0.13310688734054565, -0.10216031223535538, 0.32365989685058594, -0.3200376629829407, 0.018471479415893555, 0.3209845721721649, 0.30673786997795105, -0.17318806052207947, -0.35768628120422363, -0.18980759382247925, -0.1060694009065628, 0.22609348595142365, 0.11589816212654114, 0.4400774836540222, -0.06226244568824768, -0.100137859582901, -0.20096588134765625, 0.19094136357307434, -0.38731589913368225, -0.2194405496120453, 0.0631246492266655, 0.1256946474313736, -0.22079099714756012, -0.09027406573295593, -0.510746955871582, -0.011281578801572323, -0.19146780669689178, -0.11390478909015656, -0.0941629409790039, -0.002220563590526581, 0.1587524265050888, -0.04262440279126167, 0.166352778673172, 0.3246026337146759, -0.3231167793273926, 0.37317055463790894, 0.050239983946084976, 0.27882590889930725, 0.12830379605293274, 0.2330392599105835, 0.14370137453079224, 0.2367834448814392, -0.13197866082191467, 0.16092371940612793, 0.11538934707641602, -0.6976608633995056, -0.5956615209579468, -0.08996708691120148, -0.26885873079299927, -0.04654010012745857, -0.12122811377048492, 0.013136271387338638, 0.41896936297416687, -0.06395291537046432, 0.6082583069801331, 0.36584392189979553, -0.05745033919811249, 0.23935887217521667, -0.4626855254173279, -0.09861817955970764, -0.024740006774663925, 0.41786542534828186, 0.013092427514493465, -0.03209415450692177, 0.24400730431079865, 0.23001515865325928, 0.13240545988082886, 0.24974629282951355, 0.29144543409347534, 0.3356257975101471, 0.6454249620437622, -0.28164318203926086, 0.014875579625368118, -0.1982003152370453, -0.27220332622528076, 0.11580035090446472, 0.27189475297927856, 0.12000656127929688, -0.2071133255958557, 0.08669740706682205, -0.39044857025146484, 0.04360473155975342, -0.3297949731349945, 0.2863490581512451, 0.07187531888484955, -0.19154466688632965, -0.21201081573963165, 0.17992278933525085, -0.282068133354187, 0.3757929503917694, 0.03134309500455856, 0.0379069522023201, -0.4400331676006317, 0.5336698293685913, -0.08037672191858292, -0.5043725371360779, 0.30835363268852234, 0.07764607667922974, 0.27382490038871765, -0.10360950231552124, -0.19562631845474243, 0.13393540680408478, 0.23417922854423523, 0.1369236409664154, -0.005254951771348715, 0.016759388148784637, 0.2642606496810913, -0.23406767845153809, -0.08080362528562546, 0.196403369307518, 0.11857881397008896, -0.19520263373851776, -0.15197990834712982, -0.12112271040678024, -0.08569400757551193, 0.07925884425640106, -0.1256413757801056, 0.11554986238479614, 0.1391271948814392, 0.004252992570400238, 0.08277152478694916, 0.404147207736969, 0.1722850650548935, 0.053286973387002945, 0.11878708750009537, -0.3269270956516266, -0.08498482406139374, 0.12876741588115692, 0.211687833070755, 0.006035350263118744, 0.12721070647239685, 0.18153126537799835, -0.1450739949941635, -0.26977330446243286, 0.1996835172176361, 0.06134630739688873, 0.2771124541759491, -0.04880169779062271, -0.1443280279636383, 0.04651369899511337, 0.061448924243450165, -0.13448023796081543, -0.08032070100307465, 0.11340603232383728, -0.20449689030647278, 0.3303464353084564, 0.36666789650917053, -0.00252661295235157, -0.35256603360176086, -0.02780986949801445, 0.1365959644317627, 0.4154609739780426, -0.21256029605865479, -0.18020619451999664, -0.005541570484638214, 0.3292797803878784, 0.019810859113931656, -0.31200674176216125, -0.5459038019180298, -0.24179980158805847, 0.08343355357646942, 0.3957824409008026, -0.02572448179125786, 0.06432151794433594, 0.5462645888328552, 0.44909319281578064, 0.003459535539150238, -0.13645967841148376, -0.06479641050100327, -0.02553212083876133, -0.1358608901500702, 0.015444859862327576, 0.2740727365016937, 0.25092175602912903, 0.252235472202301, 0.031634315848350525, 0.1390088051557541, -0.28588950634002686, 0.23932400345802307, -0.03271240368485451, 0.052603282034397125, 0.30905893445014954, -0.22846519947052002, 0.18137603998184204, 0.024338729679584503, -0.3481771945953369, 0.12542526423931122, -0.1159154623746872, -0.12664802372455597, 0.1761000007390976, 0.004895787686109543, -0.1652158796787262, 0.2892642021179199, -0.09116285294294357, -0.310152530670166, -0.487762987613678, 0.2864499092102051, -0.024641945958137512, -0.08898366242647171, -0.044065043330192566, -0.02594059333205223, -0.09175018966197968, 0.034019242972135544, -0.337057501077652, -0.064105324447155, -0.38354092836380005, 0.21679365634918213, -0.013579927384853363, -0.38935327529907227, 0.17538902163505554, 0.18963128328323364, 0.014565801247954369, 0.2475610375404358, -0.24308297038078308, -0.2901410460472107, -0.1112120971083641, 0.13822484016418457, -0.03057592362165451, 0.1707124412059784, 0.2604474127292633, -0.16916103661060333, 0.06027412414550781, -0.013425193727016449, -0.23689819872379303, 0.03553563728928566, 0.8220511674880981, 0.17307263612747192, -0.09706519544124603, 0.1257636845111847, -0.18842190504074097, 0.35933369398117065, 0.3795758783817291, -0.11079448461532593, 0.4151037931442261, 0.13085712492465973, 0.11090424656867981, -0.24566388130187988, -0.3352759778499603, 0.14867784082889557, -0.008397355675697327, -0.27943557500839233, 0.08779267221689224, 0.04351234808564186, -0.09110559523105621, -0.2861451208591461, -0.35176020860671997, -0.22860215604305267, -0.205681711435318, -0.07041069865226746, 0.04081634804606438, 0.011568587273359299, -0.004458531737327576, -0.2118443101644516, -0.047341130673885345, -0.3382229804992676, 0.08951559662818909, 0.003341361880302429, 0.008695490658283234, 0.0017415247857570648, -0.285200297832489, -0.1822548508644104, -0.4141737222671509, -0.021958187222480774, 0.006387118250131607, 0.8863236308097839, -0.25526925921440125, 0.24128177762031555, 0.19523635506629944, -0.10444864630699158, 0.5441074967384338, -0.6170205473899841, 0.32581090927124023, 0.027084827423095703, 0.21043136715888977, -0.41909196972846985, -0.10576767474412918, -0.22201323509216309, 0.30511409044265747, 0.0025525912642478943, 0.5505914688110352, -0.10229729861021042, 0.24162918329238892, -0.17923110723495483, 0.28375548124313354, -0.013364814221858978, -0.17816685140132904, -0.20076680183410645, -0.25654953718185425, -0.3139322102069855, 0.11920595169067383, 0.4683302640914917, 0.22337239980697632, 0.07240341603755951, -0.2409459799528122, 0.20167575776576996, 0.17321400344371796, 0.04276931285858154, -0.22142662107944489, 0.2714420258998871, 0.012327611446380615, 0.328159362077713, -0.05750925466418266, 0.049688663333654404, 0.28863459825515747, 0.49709033966064453, 0.2534206807613373, -0.22272874414920807, 0.04272899404168129, -0.17279411852359772, 0.17156235873699188, 0.5290817022323608, 0.24829167127609253, 0.21888020634651184, -0.39999327063560486, 0.18477006256580353, -0.42457523941993713, 0.08066737651824951, 0.31661462783813477, -0.14892619848251343, -0.3551413118839264, 0.12167198956012726, 0.430514931678772, -0.29095298051834106, 0.011726483702659607, 0.3689834475517273, 0.4231272339820862, -0.041814301162958145, 0.4148247241973877, -0.12910617887973785, 1.0012288093566895, 0.055683113634586334, 0.07278837263584137, -0.10736297816038132, -0.18545076251029968, 0.24373950064182281, -0.5012351274490356, 0.08372709900140762, -0.24323385953903198, -0.08784306049346924, 0.06420233100652695, 0.024306155741214752, -0.297624796628952, 0.12218795716762543, -0.24903251230716705, 0.26681584119796753, -0.21588680148124695, 0.43318554759025574, -0.18785855174064636, 0.05964735895395279, -0.16331198811531067, -0.1572713702917099, -0.15318486094474792, 0.18400564789772034, -0.11165666580200195, 0.05922114476561546, -0.07594797015190125, -0.09560253471136093, -0.18000850081443787, -0.22014132142066956, -0.6703555583953857, 0.08365738391876221, 0.2908637523651123, 0.14062544703483582, -0.030187733471393585, -0.1689809262752533, 0.16054698824882507, -0.2126539647579193, 0.3410275876522064, 0.12576106190681458, -0.2980591952800751, 0.15533316135406494, -0.21216222643852234, -0.07313332706689835, 0.04806436970829964, 0.10135851055383682, 0.072629913687706, -0.18286091089248657, -0.36323586106300354, 0.04086947441101074, -0.010870348662137985, -0.1576520949602127, -0.14411483705043793, 0.1538524478673935, -0.12481912970542908, -0.1743336170911789, -0.17916171252727509, 0.1396297812461853, 0.08563408255577087, -0.1753736287355423, 0.10020090639591217, 0.1193079948425293, -0.0264575257897377, 0.406080037355423, 0.14914129674434662, 0.08674606680870056, 0.009718602523207664, 0.49989214539527893, -0.209512859582901, -0.3742219805717468, 0.1785062849521637, 0.0390956774353981, -0.14798828959465027, -0.17028915882110596, 0.3537331819534302, 0.04627341404557228, -0.4286983609199524, 0.10794373601675034, -0.31054574251174927, 0.19543085992336273, -0.17189374566078186, -0.04248599708080292, 0.16965293884277344, -0.14431527256965637, -0.0984644666314125, -0.19388048350811005, -0.24961215257644653, 0.062310125678777695, 0.26164111495018005, 0.09904293715953827, -0.3472757339477539, -0.40580350160598755, 0.3666714131832123, 0.11776431649923325, -0.23637467622756958, 0.17210301756858826, -0.38790202140808105, 0.1276453733444214, -0.18881608545780182, -0.15860602259635925, -0.11957421898841858, -0.37154245376586914, -0.03264550492167473, -0.11330462247133255, -0.11159709841012955, -0.1479760706424713, -0.03420434519648552, 0.20342427492141724, 0.39668944478034973, 0.054166220128536224, -0.16744868457317352, -0.342815101146698, -0.18649983406066895, 0.03196824714541435, 0.11076851934194565, 0.2853951156139374, -0.10839991271495819, -0.35994139313697815, 0.6716683506965637, 0.01662369631230831, -0.0606718510389328, 0.22314274311065674, 0.2657369375228882, 0.11737614870071411, -0.16171543300151825, -0.0678015798330307, 0.3601458966732025, -0.05806857347488403, -0.23250514268875122, 0.269396036863327, 0.0924004465341568, -0.07867929339408875, 0.2039506435394287, -0.3890523612499237, 0.04972019046545029, -0.007912613451480865, 0.29862427711486816, 0.45920538902282715, -0.2593842148780823, -0.08706441521644592, 0.313318133354187, 0.20421797037124634, -0.09568082541227341, -0.4288555085659027, 0.3156796395778656, 0.12250491231679916, -0.1403832733631134, -0.0769018828868866, 0.3860655426979065, -0.29857879877090454, -0.20763060450553894, 0.09285245090723038, 0.6073062419891357, -0.13727876543998718, 0.010762684047222137, 0.15328067541122437, -0.029634229838848114, 0.005834943149238825, -0.056457050144672394, -0.014482349157333374, -0.03314603492617607, 0.5955263376235962, -0.07861059904098511, 0.4189433753490448, 0.24421976506710052, -0.27228695154190063, 0.16689392924308777, -0.2219700813293457, -0.15205076336860657, -0.06886699050664902, 0.10173232108354568, 0.05091549828648567, 0.21451878547668457, 0.18224909901618958, -0.38108155131340027, -0.10389772057533264, -0.45485180616378784, -0.2329655885696411, -0.13655626773834229, 0.36794644594192505, 0.2575972080230713, -0.1300080567598343, -0.4309273362159729, 0.008898057043552399, -0.11966217309236526, 0.024403681978583336, 0.159403994679451, 0.21546266973018646, 0.08644571900367737, 0.0873129665851593, -0.14713887870311737, 0.13702921569347382, 0.22545088827610016, -0.15746495127677917, 0.1335025131702423, 0.2332594394683838, -0.13710209727287292, 0.011298667639493942, 0.24979443848133087, 0.43892860412597656, 0.31318598985671997, -0.2357981652021408, 0.4851301908493042, 0.10731005668640137, 0.10159173607826233, 0.17821618914604187, 0.2923118472099304, -0.04726901650428772, 0.3247360587120056, 0.08716578036546707, 0.11554001271724701, -0.05062893033027649, 0.16670364141464233, 0.05076738819479942, -0.03789868950843811, 0.0318988561630249, 0.23045508563518524, -0.1940968781709671, -0.2115631252527237, -0.2177949994802475, -0.18205799162387848, -0.29935407638549805, -0.023040490224957466, 0.24717330932617188, -0.17080387473106384, 0.08572705090045929, -0.2662501037120819, 0.04090554267168045, -0.3130161762237549, 0.5930440425872803, 0.389030784368515, 0.0023584947921335697, -0.160495325922966, -0.3578152656555176, -0.41337478160858154, 0.1267397701740265, -0.23777619004249573, 0.11473770439624786, 0.11883749067783356, -0.042985714972019196, -0.08900250494480133, 0.18870040774345398, -0.07848840951919556, 0.2825824022293091, -0.5187277793884277, 0.2694213092327118, -0.4352057874202728, 0.036590326577425, 0.2760508954524994, 0.08294588327407837, -0.09849777817726135, -0.19894307851791382, 0.48787641525268555, 0.013577155768871307, -0.05395083874464035, 0.05839812383055687, -0.10580205917358398, -0.16740824282169342, -0.1861925572156906, 0.1634974628686905, -0.11809590458869934, 0.6178478598594666, -0.14967229962348938, 0.05167330056428909, -0.3492118716239929, -0.3158996105194092, -0.1184079572558403, -0.1623172163963318, -0.10321725159883499, 0.3223228454589844, 0.12333863973617554, -0.1279449611902237, -0.02904626540839672, -0.01518266275525093, -0.286013126373291, 0.26150640845298767, -0.1489187479019165, -0.15978728234767914, 0.09680072218179703, 0.32782694697380066, 0.3838779032230377, -0.1937730610370636, -0.10213299840688705, 0.06278886646032333, -0.3685513138771057, -0.4102262556552887, 0.3732341527938843, 0.09502820670604706, -0.44624489545822144, -0.3701784610748291, 0.4784134030342102, 0.013665581122040749, -0.001310771331191063, -0.15733692049980164, -0.045230887830257416, 0.18297751247882843, -0.04619935154914856, -0.21604783833026886, 0.31806978583335876, -0.21852077543735504, -0.21397094428539276, 0.10767873376607895, 0.07505528628826141, 0.1601274013519287, -0.050676122307777405, 0.4270554184913635, -0.15898507833480835 ]
https://github.com/huggingface/datasets/issues/5945
Alternatively you can save your dataset in parquet files locally and upload them to the hub manually ```python from tqdm import tqdm num_shards = 60 for index in tqdm(range(num_shards)): ds.shard(num_shards=num_shards, index=index, contiguous=True).to_parquet(f"{index:05d}.parquet") ````
Failing to upload dataset to the hub
### Describe the bug Trying to upload a dataset of hundreds of thousands of audio samples (the total volume is not very large, 60 gb) to the hub with push_to_hub, it doesn't work. From time to time one piece of the data (parquet) gets pushed and then I get RemoteDisconnected even though my internet is stable. Please help. I'm trying to upload the dataset for almost a week. Thanks ### Steps to reproduce the bug not relevant ### Expected behavior Be able to upload thedataset ### Environment info python: 3.9
33
Failing to upload dataset to the hub ### Describe the bug Trying to upload a dataset of hundreds of thousands of audio samples (the total volume is not very large, 60 gb) to the hub with push_to_hub, it doesn't work. From time to time one piece of the data (parquet) gets pushed and then I get RemoteDisconnected even though my internet is stable. Please help. I'm trying to upload the dataset for almost a week. Thanks ### Steps to reproduce the bug not relevant ### Expected behavior Be able to upload thedataset ### Environment info python: 3.9 Alternatively you can save your dataset in parquet files locally and upload them to the hub manually ```python from tqdm import tqdm num_shards = 60 for index in tqdm(range(num_shards)): ds.shard(num_shards=num_shards, index=index, contiguous=True).to_parquet(f"{index:05d}.parquet") ````
[ -0.3584897518157959, -0.4968307316303253, 0.041109416633844376, 0.15697543323040009, 0.1653338372707367, -0.17984625697135925, 0.18572813272476196, 0.24879494309425354, -0.26125916838645935, 0.13924777507781982, 0.08525009453296661, 0.33221179246902466, -0.21793578565120697, 0.12285216152667999, 0.2292075902223587, 0.11279509961605072, 0.3155214488506317, -0.0877489298582077, 0.03963019698858261, -0.2807522118091583, -0.26258787512779236, -0.04364095628261566, -0.19931262731552124, -0.260964572429657, -0.4630940854549408, -0.11774668097496033, -0.026113703846931458, 0.3506706953048706, -0.09501339495182037, -0.2196757197380066, 0.001414380967617035, 0.01693921536207199, -0.05672592669725418, 0.655236542224884, -0.0001243097649421543, -0.0503065288066864, 0.4856889247894287, -0.1903245449066162, -0.13253992795944214, -0.04952661693096161, -0.41446590423583984, -0.31050294637680054, -0.16067224740982056, 0.05164186656475067, 0.11366292089223862, 0.31077301502227783, -0.1174422949552536, 0.08590023219585419, 0.3172716498374939, 0.3529435992240906, 0.09158588945865631, 0.30988645553588867, 0.35220006108283997, -0.03231538087129593, 0.2960554361343384, 0.09659947454929352, -0.149794340133667, 0.15975835919380188, 0.775406539440155, 0.27715232968330383, 0.026264268904924393, -0.13040262460708618, 0.06234543025493622, -0.08580055832862854, 0.003980889450758696, -0.03817293420433998, -0.1904035210609436, -0.3854210376739502, 0.17428526282310486, 0.11979353427886963, 0.45005887746810913, -0.22492852807044983, -0.4148176312446594, -0.08375668525695801, -0.08975562453269958, -0.24253399670124054, 0.39425820112228394, 0.1295327991247177, -0.20718206465244293, -0.02453683316707611, -0.1683029979467392, -0.18572968244552612, -0.14056263864040375, 0.19163194298744202, -0.02501339465379715, 0.1485651135444641, -0.004162739962339401, 0.04118628799915314, -0.11234524846076965, -0.4055260419845581, 0.48768091201782227, -0.15798905491828918, 0.06371154636144638, 0.011609215289354324, -0.6087539196014404, -0.13912749290466309, -0.010091744363307953, 0.060145650058984756, 0.043652988970279694, 0.11066725105047226, -0.308656245470047, 0.13049183785915375, -0.06821440905332565, 0.10952078551054001, 0.5534743070602417, -0.1281716525554657, -0.14167693257331848, -0.0342949815094471, 0.21541732549667358, 0.2539985775947571, -0.0010158494114875793, 0.050218287855386734, 0.04926712438464165, -0.20682752132415771, 0.22309927642345428, -0.1010008454322815, 0.37394624948501587, -0.2052927315235138, -0.26131731271743774, 0.2301083654165268, 0.18940377235412598, 0.38193121552467346, -0.05320724844932556, 0.09922832250595093, 0.053251270204782486, 0.047686610370874405, -0.319680392742157, 0.452496737241745, 0.0384843572974205, -0.27311715483665466, -0.15181854367256165, 0.13421863317489624, 0.24984589219093323, -0.06887969374656677, 0.2194284051656723, -0.2422504425048828, -0.041314199566841125, 0.3452549874782562, 0.40781474113464355, -0.1291109174489975, -0.33098921179771423, -0.17443501949310303, -0.037728242576122284, 0.3172209858894348, 0.11392813175916672, 0.4157697260379791, 0.01745370589196682, -0.12636491656303406, -0.19965632259845734, 0.1445407122373581, -0.46382489800453186, -0.2635003924369812, 0.10165717452764511, 0.07229257375001907, -0.14287161827087402, -0.10942225158214569, -0.5495976209640503, 0.02542825974524021, -0.1908697485923767, -0.005568563938140869, -0.12223857641220093, -0.030749507248401642, 0.12725165486335754, -0.03553486987948418, 0.16557753086090088, 0.29908287525177, -0.28043922781944275, 0.34096431732177734, -0.08627180755138397, 0.3626617193222046, 0.1431822031736374, 0.29794174432754517, 0.06809750199317932, 0.3050532937049866, -0.1173904687166214, 0.15327906608581543, 0.30243438482284546, -0.6667038798332214, -0.6684147715568542, -0.03419250622391701, -0.2704826295375824, -0.0818692222237587, -0.09112352132797241, 0.0023261718451976776, 0.5311719179153442, 0.030212465673685074, 0.635185182094574, 0.277146577835083, -0.08454982191324234, 0.2821480333805084, -0.4925002455711365, -0.11217950284481049, 0.0018845591694116592, 0.33881115913391113, 0.11490514129400253, -0.06592482328414917, 0.2722848355770111, 0.12751466035842896, 0.0825003981590271, 0.23781757056713104, 0.29629841446876526, 0.3864126205444336, 0.5514681935310364, -0.3444737493991852, -0.0214705690741539, -0.28149229288101196, -0.2863464653491974, 0.1541513353586197, 0.20411500334739685, 0.12722918391227722, -0.17730338871479034, 0.11688287556171417, -0.41389185190200806, 0.05859851837158203, -0.3338682949542999, 0.2731982171535492, 0.024513013660907745, -0.260184645652771, -0.26173028349876404, 0.14503063261508942, -0.33089837431907654, 0.3328547477722168, 0.10967973619699478, 0.06266351789236069, -0.27600011229515076, 0.5119192004203796, -0.01529877632856369, -0.5032342076301575, 0.2872210144996643, 0.1071418970823288, 0.2976396381855011, -0.18855296075344086, -0.1136993020772934, 0.23881904780864716, 0.26392558217048645, 0.14679288864135742, 0.14181363582611084, 0.008065976202487946, 0.2633478045463562, -0.34248530864715576, -0.1534329652786255, 0.1756826937198639, 0.08307350426912308, -0.1684151589870453, -0.08628101646900177, -0.03956905007362366, -0.09057046473026276, 0.07546092569828033, -0.23675593733787537, 0.1857404112815857, 0.12423063069581985, 0.024762161076068878, 0.07210589945316315, 0.3713480830192566, 0.11027301847934723, 0.11283848434686661, -0.009993292391300201, -0.33467477560043335, -0.14718008041381836, 0.2225254625082016, 0.14736796915531158, 0.07136151939630508, 0.19746872782707214, 0.08296845853328705, -0.09927070140838623, -0.15611962974071503, 0.1327950358390808, 0.02528516948223114, 0.29262545704841614, -0.060240402817726135, -0.12750723958015442, 0.05862431228160858, 0.0050359927117824554, -0.04715731367468834, -0.07869446277618408, 0.17837412655353546, -0.292647123336792, 0.38429245352745056, 0.37375175952911377, 0.047740641981363297, -0.37815994024276733, 0.08204875886440277, 0.26617273688316345, 0.3806934356689453, -0.22448650002479553, -0.1854267120361328, -0.10102302581071854, 0.4483546018600464, 0.005709894001483917, -0.32230496406555176, -0.6079059839248657, -0.2831595242023468, 0.15129627287387848, 0.3026616871356964, -0.08219233900308609, 0.11074835062026978, 0.5271103978157043, 0.36647409200668335, -0.011641986668109894, -0.16998638212680817, -0.02943751960992813, -0.0042460039258003235, -0.13959568738937378, -0.030307205393910408, 0.30191555619239807, 0.29948851466178894, 0.19819113612174988, -0.006908789277076721, 0.11935601383447647, -0.41286665201187134, 0.19163021445274353, -0.0631817951798439, 0.05191977322101593, 0.41584956645965576, -0.20786219835281372, 0.13586029410362244, -0.08994587510824203, -0.27600422501564026, 0.15759141743183136, -0.07386802136898041, -0.08498996496200562, 0.2140311449766159, -0.026864228770136833, -0.20852620899677277, 0.3448074460029602, -0.07170622050762177, -0.21871036291122437, -0.41800370812416077, 0.1432407945394516, -0.08907333016395569, -0.03719116747379303, -0.19277143478393555, -0.13582280278205872, -0.15382002294063568, -0.03062322363257408, -0.3082426190376282, -0.02940819226205349, -0.47381556034088135, 0.2926235496997833, -0.035881735384464264, -0.4650340676307678, 0.25481051206588745, 0.14880460500717163, 0.11914832890033722, 0.2552441656589508, -0.24550840258598328, -0.26669201254844666, -0.014671449549496174, 0.14888450503349304, 0.0013828659430146217, 0.129984050989151, 0.2515253722667694, -0.21974793076515198, 0.11099494248628616, 0.023764759302139282, -0.16477017104625702, -0.05680709332227707, 0.8588624000549316, 0.18224962055683136, -0.17431317269802094, 0.15488968789577484, -0.13346169888973236, 0.4587964713573456, 0.30513250827789307, 0.05404967442154884, 0.38540658354759216, 0.04345904290676117, 0.0897517204284668, -0.24788880348205566, -0.30575743317604065, 0.11826790869235992, 0.026716060936450958, -0.26270923018455505, 0.14241735637187958, 0.021065156906843185, 0.1110100969672203, -0.19065327942371368, -0.26682597398757935, -0.25159752368927, -0.2798655331134796, -0.099854476749897, 0.0661453902721405, 0.11518267542123795, 0.06377387046813965, -0.24916456639766693, -0.0059665776789188385, -0.2820761203765869, 0.18777532875537872, 0.1647551953792572, -0.10476815700531006, 0.05913437902927399, -0.3602169156074524, -0.12103529274463654, -0.27700138092041016, -0.018406815826892853, 0.02663542702794075, 0.8668708801269531, -0.22887960076332092, 0.2078230381011963, 0.2653292417526245, -0.03385965898633003, 0.5201854705810547, -0.6522952914237976, 0.2901303172111511, 0.07318654656410217, 0.11476370692253113, -0.45405644178390503, -0.12501055002212524, -0.1602257490158081, 0.15830284357070923, 0.09542221575975418, 0.6210967302322388, -0.08005017042160034, 0.1887618899345398, -0.26353248953819275, 0.2840403616428375, -0.11179698258638382, -0.1358005851507187, -0.19844695925712585, -0.2501112222671509, -0.29048705101013184, 0.1905500888824463, 0.4434541165828705, 0.31547829508781433, 0.1716521978378296, -0.1520231068134308, 0.04546908289194107, 0.14472678303718567, 0.047302037477493286, -0.15716910362243652, 0.34115132689476013, -0.0062835440039634705, 0.44377321004867554, -0.14828836917877197, -0.004905949346721172, 0.13106800615787506, 0.48464903235435486, 0.3343774080276489, -0.2615991532802582, 0.07103202491998672, -0.1857362985610962, 0.2401847094297409, 0.5436398983001709, 0.21804901957511902, 0.2332330346107483, -0.4198492169380188, 0.18016663193702698, -0.3062315583229065, 0.13431338965892792, 0.3003261089324951, -0.2418796867132187, -0.3005869686603546, 0.29303592443466187, 0.46103036403656006, -0.3784443736076355, 0.05304872989654541, 0.2862863540649414, 0.5275206565856934, 0.036161161959171295, 0.3198109567165375, -0.016595538705587387, 1.0614451169967651, -0.02609655261039734, 0.05301760137081146, -0.07740306854248047, -0.11285229027271271, 0.12233889102935791, -0.5169307589530945, 0.0412551611661911, -0.23116585612297058, -0.13070039451122284, 0.030879303812980652, 0.03226190805435181, -0.22442463040351868, 0.20119692385196686, -0.15298080444335938, 0.32753270864486694, -0.13110840320587158, 0.42093852162361145, -0.1838693916797638, 0.0018699541687965393, -0.130127415060997, -0.2440861016511917, -0.18938788771629333, 0.1075812503695488, -0.06049507111310959, -0.06260798126459122, -0.08756065368652344, -0.1864473670721054, -0.17617493867874146, -0.14171701669692993, -0.5833901166915894, -0.01323513314127922, 0.19628289341926575, 0.13676494359970093, 0.23072578012943268, -0.1997290551662445, 0.14391179382801056, -0.19444946944713593, 0.38590067625045776, 0.07785479724407196, -0.33405327796936035, 0.19097179174423218, -0.10763703286647797, -0.04279514402151108, 0.07437650859355927, 0.10597839206457138, 0.07356861978769302, -0.16781170666217804, -0.24044620990753174, 0.15037551522254944, -0.04228556156158447, -0.09575001150369644, -0.09785915166139603, 0.1873447597026825, -0.01005820743739605, -0.10123226046562195, -0.15645214915275574, 0.13059185445308685, 0.11976589262485504, -0.1713738739490509, 0.03761259466409683, 0.18710725009441376, -0.10069819539785385, 0.45398664474487305, 0.09589610993862152, 0.032281577587127686, 0.03874308988451958, 0.4382897615432739, -0.28730103373527527, -0.29743075370788574, 0.12304119765758514, -0.0007962808012962341, -0.1247037798166275, -0.17776121199131012, 0.44808530807495117, -0.07645844668149948, -0.36880674958229065, 0.11182491481304169, -0.3699496388435364, 0.20023086667060852, -0.14428170025348663, 0.0653408020734787, 0.16770052909851074, -0.2761068344116211, -0.23805037140846252, -0.15277449786663055, -0.262761652469635, 0.10565773397684097, 0.1874658465385437, -0.015951234847307205, -0.3147342801094055, -0.25215378403663635, 0.279209703207016, 0.12325148284435272, -0.16283029317855835, 0.17626091837882996, -0.3393527865409851, 0.17725826799869537, -0.09153100103139877, -0.16614454984664917, -0.057625770568847656, -0.3410719037055969, -0.1114647164940834, -0.10161249339580536, -0.12656167149543762, -0.0912461057305336, -0.06521289795637131, 0.23162369430065155, 0.4157184660434723, 0.08922950178384781, -0.23881332576274872, -0.3209381103515625, -0.15686923265457153, 0.04023509845137596, 0.12502919137477875, 0.2652645707130432, -0.0985940545797348, -0.3788248598575592, 0.7903062701225281, -0.11465050280094147, -0.196650892496109, 0.22421970963478088, 0.33656400442123413, 0.0512271523475647, -0.16467759013175964, -0.10986313223838806, 0.28405481576919556, -0.08778674900531769, -0.2065575122833252, 0.2975846827030182, 0.1028405949473381, -0.21776023507118225, 0.3158373236656189, -0.3809058368206024, 0.11264093220233917, 0.06246945261955261, 0.2725043296813965, 0.40636318922042847, -0.3071077764034271, -0.20750635862350464, 0.2644994258880615, 0.12350879609584808, -0.06644515693187714, -0.5301056504249573, 0.1824704110622406, 0.1928805112838745, -0.12848438322544098, -0.042544662952423096, 0.3649769425392151, -0.28428149223327637, -0.2576037049293518, 0.15562579035758972, 0.5011106729507446, -0.2473219931125641, -0.09353326261043549, 0.09776127338409424, -0.028761357069015503, 0.1034855991601944, -0.002974126487970352, 0.00770072266459465, -0.11446507275104523, 0.5254014730453491, -0.04961169883608818, 0.37707147002220154, 0.26134955883026123, -0.41886037588119507, 0.1788206398487091, -0.23533524572849274, -0.1337425261735916, -0.09451788663864136, 0.18307603895664215, -0.02177773416042328, 0.17578895390033722, 0.0770951360464096, -0.1706344038248062, -0.16747641563415527, -0.429413378238678, -0.1586093306541443, -0.09466314315795898, 0.2882286608219147, 0.4631962180137634, -0.08073911815881729, -0.4039609432220459, 0.009450159966945648, -0.1463407576084137, 0.08888944983482361, 0.16580386459827423, 0.2519468665122986, 0.1631598323583603, 0.0008501186966896057, -0.23479729890823364, 0.28197261691093445, 0.12116454541683197, -0.20908735692501068, 0.1651405245065689, 0.20926563441753387, -0.20327556133270264, 0.05498479679226875, 0.2035185992717743, 0.36934906244277954, 0.2268322855234146, -0.3027620017528534, 0.46303707361221313, 0.075199656188488, 0.13933074474334717, 0.17206642031669617, 0.1768849790096283, -0.2009669542312622, 0.33064472675323486, 0.16785398125648499, 0.05939532816410065, -0.002055872231721878, 0.019491760060191154, 0.04120664298534393, -0.02209191396832466, -0.035630322992801666, 0.24446868896484375, -0.14403653144836426, -0.1198531836271286, -0.19723884761333466, -0.077267587184906, -0.2646326422691345, -0.1246369332075119, 0.2790932059288025, -0.19395333528518677, 0.11168604344129562, -0.24712297320365906, -0.0037214569747447968, -0.31706899404525757, 0.6243671774864197, 0.33741486072540283, -0.1213190108537674, -0.23603564500808716, -0.38227856159210205, -0.5243752598762512, 0.1465052217245102, -0.20581981539726257, 0.10526822507381439, 0.334770530462265, 0.10669862478971481, -0.04757339879870415, 0.2805348336696625, -0.02960442751646042, 0.2589075267314911, -0.6548188328742981, 0.3320276439189911, -0.3604471981525421, 0.020581435412168503, 0.14986340701580048, 0.08027193695306778, -0.052596062421798706, -0.20339332520961761, 0.577146053314209, 0.1425180733203888, -0.08880680054426193, 0.1837073415517807, -0.08343593776226044, -0.13481378555297852, -0.09029320627450943, 0.007932743057608604, -0.15524156391620636, 0.48909538984298706, -0.10971197485923767, 0.11981185525655746, -0.3332552909851074, -0.39729827642440796, -0.1446215957403183, -0.1296924203634262, -0.1584620177745819, 0.2643245756626129, 0.14064466953277588, -0.13180391490459442, -0.0104829091578722, -0.04445682093501091, -0.21789464354515076, 0.23111842572689056, -0.17301498353481293, -0.11796960979700089, 0.1269550770521164, 0.45260587334632874, 0.3472529947757721, -0.18321563303470612, -0.044099971652030945, 0.15542101860046387, -0.30567634105682373, -0.4684608578681946, 0.38779228925704956, 0.11144527792930603, -0.48044565320014954, -0.39824241399765015, 0.48455676436424255, 0.0803128331899643, 0.005226904526352882, -0.2269899845123291, -0.1444423347711563, 0.23956318199634552, -0.03782053291797638, -0.15636363625526428, 0.245987206697464, -0.14951294660568237, -0.23937159776687622, 0.0808362364768982, -0.01360609382390976, 0.10135629028081894, 0.0014234408736228943, 0.29103395342826843, -0.1434537172317505 ]
https://github.com/huggingface/datasets/issues/5941
already did,but not useful for step Generating train split,it works in step "Resolving data files" & "Downloading data files"
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
19
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> already did,but not useful for step Generating train split,it works in step "Resolving data files" & "Downloading data files"
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5941
We need more info about the issue to provide help. Can you interrupt the process (with `num_proc=None`) after the `load_dataset` call when the slowdown occurs? So we can know what part of the code is causing it. The `audiofolder` \ `imagefolder` with metadata is not performant for large datasets. Luckily, we can make them much faster if drop the nested metadata files feature (not that useful). I plan to work on this soon. In the meantime, it's better to use `Dataset.from_generator` (requires replacing the `load_dataset` calls in the transformers script with `Dataset.from_generator`) or write a dataset loading script for large datasets.
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
101
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> We need more info about the issue to provide help. Can you interrupt the process (with `num_proc=None`) after the `load_dataset` call when the slowdown occurs? So we can know what part of the code is causing it. The `audiofolder` \ `imagefolder` with metadata is not performant for large datasets. Luckily, we can make them much faster if drop the nested metadata files feature (not that useful). I plan to work on this soon. In the meantime, it's better to use `Dataset.from_generator` (requires replacing the `load_dataset` calls in the transformers script with `Dataset.from_generator`) or write a dataset loading script for large datasets.
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5941
Can you interrupt the process (with num_proc=None) after the load_dataset call when the slowdown occurs? So we can know what part of the code is causing it. (I'll try this operation) The audiofolder \ imagefolder with metadata is not performant for large datasets. Luckily, we can make them much faster if drop the nested metadata files feature (not that useful). I plan to work on this soon. (My data is indeed a bit large, exceeding 10000 hours of audio data. Looking forward to your improvement work very much) In the meantime, it's better to use Dataset.from_generator (requires replacing the load_dataset calls in the transformers script with Dataset.from_generator) or write a dataset loading script for large datasets. (I want to use Dataset.from_generator instead of load_dataset ,where can i found sample code to load audio&label dataset, I was to do asr task)
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
140
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Can you interrupt the process (with num_proc=None) after the load_dataset call when the slowdown occurs? So we can know what part of the code is causing it. (I'll try this operation) The audiofolder \ imagefolder with metadata is not performant for large datasets. Luckily, we can make them much faster if drop the nested metadata files feature (not that useful). I plan to work on this soon. (My data is indeed a bit large, exceeding 10000 hours of audio data. Looking forward to your improvement work very much) In the meantime, it's better to use Dataset.from_generator (requires replacing the load_dataset calls in the transformers script with Dataset.from_generator) or write a dataset loading script for large datasets. (I want to use Dataset.from_generator instead of load_dataset ,where can i found sample code to load audio&label dataset, I was to do asr task)
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5941
Can you interrupt the process (with num_proc=None) after the load_dataset call when the slowdown occurs? So we can know what part of the code is causing it. ================================================================================ Here is the log: [load_dataset.log](https://github.com/huggingface/datasets/files/12169362/load_dataset.log) (The larger my training data, the slower it loads) ![image](https://github.com/huggingface/datasets/assets/19569322/381b73e4-0a54-4240-b95e-cb8164584047)
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
43
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Can you interrupt the process (with num_proc=None) after the load_dataset call when the slowdown occurs? So we can know what part of the code is causing it. ================================================================================ Here is the log: [load_dataset.log](https://github.com/huggingface/datasets/files/12169362/load_dataset.log) (The larger my training data, the slower it loads) ![image](https://github.com/huggingface/datasets/assets/19569322/381b73e4-0a54-4240-b95e-cb8164584047)
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5941
In the meantime, it's better to use Dataset.from_generator (requires replacing the load_dataset calls in the transformers script with Dataset.from_generator) or write a dataset loading script for large datasets. ================================================================================ I tried ‘Dataset. from_generator’ implements data loading, but the testing results show no improvement
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
43
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> In the meantime, it's better to use Dataset.from_generator (requires replacing the load_dataset calls in the transformers script with Dataset.from_generator) or write a dataset loading script for large datasets. ================================================================================ I tried ‘Dataset. from_generator’ implements data loading, but the testing results show no improvement
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5941
I have already solved this problem, referring to #5990 : read audio frist, then use data_generator to change format .
Load Data Sets Too Slow In Train Seq2seq Model
### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
20
Load Data Sets Too Slow In Train Seq2seq Model ### Describe the bug step 'Generating train split' in load_dataset is too slow: ![image](https://github.com/huggingface/datasets/assets/19569322/d9b08eee-95fe-4741-a346-b70416c948f8) ### Steps to reproduce the bug Data: own data,16K16B Mono wav Oficial Script:[ run_speech_recognition_seq2seq.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/speech-recognition/run_speech_recognition_seq2seq.py) Add Code: if data_args.data_path is not None: print(data_args.data_path) raw_datasets = load_dataset("audiofolder", data_dir=data_args.data_path, cache_dir=model_args.cache_dir) raw_datasets = raw_datasets.cast_column("audio", Audio(sampling_rate=16000)) raw_datasets = raw_datasets["train"].train_test_split(test_size=0.005, shuffle=True) (change cache_dir to other path ,ex:/DATA/cache) ### Expected behavior load data fast,at least 1000+ `Generating train split: 387875 examples [32:24:45, 1154.83 examples/s]` ### Environment info - `transformers` version: 4.28.0.dev0 - Platform: Linux-5.4.0-149-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.16 - Huggingface_hub version: 0.13.2 - PyTorch version (GPU?): 1.13.1+cu116 (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?: <fill in> - Using distributed or parallel set-up in script?: <fill in> I have already solved this problem, referring to #5990 : read audio frist, then use data_generator to change format .
[ -0.4304403066635132, -0.21508798003196716, -0.0036190710961818695, 0.40801307559013367, 0.20815572142601013, 0.016328558325767517, 0.27846330404281616, 0.553817093372345, 0.13296890258789062, -0.04803692549467087, -0.3303144574165344, 0.2580045461654663, -0.25866442918777466, 0.17247849702835083, -0.03352446109056473, -0.5277883410453796, -0.055494777858257294, 0.1287320852279663, -0.18103322386741638, 0.008299760520458221, -0.1588309407234192, 0.326081246137619, -0.2861475348472595, -0.08371429145336151, -0.5168247222900391, -0.037050582468509674, 0.11645257472991943, 0.205159530043602, -0.05484938994050026, -0.1255856156349182, 0.04409237205982208, 0.02655179426074028, 0.0046462006866931915, 0.32951465249061584, -0.00011379314673831686, 0.13645941019058228, 0.11707131564617157, -0.004228804260492325, -0.14240425825119019, -0.04238828271627426, -0.15417425334453583, -0.11602707207202911, -0.03187203407287598, -0.04198574274778366, -0.29074299335479736, 0.10740256309509277, -0.24939578771591187, -0.08678880333900452, 0.624557375907898, 0.27553558349609375, 0.2120601236820221, 0.3425494432449341, -0.27366235852241516, -0.02151835709810257, 0.21694603562355042, 0.08314761519432068, -0.011208020150661469, 0.1532439887523651, 0.08595109730958939, 0.052512623369693756, -0.27527719736099243, 0.3025224804878235, 0.0006953775882720947, -0.019126906991004944, -0.06432683765888214, 0.06459005177021027, -0.1615382879972458, -0.20722584426403046, -0.117327481508255, 0.33430150151252747, 0.14416244626045227, -0.09193659573793411, -0.26624125242233276, -0.3003065288066864, -0.12420964241027832, -0.4132470190525055, 0.15969321131706238, 0.019234873354434967, -0.18359048664569855, 0.09321480989456177, -0.3009685277938843, -0.07335077226161957, 0.015843279659748077, -0.15289351344108582, 0.31084030866622925, -0.06166553869843483, -0.07687826454639435, 0.0002300664782524109, 0.3718791902065277, 0.04719901084899902, -0.4492127001285553, 0.17489749193191528, 0.03795013576745987, 0.06416729092597961, -0.8196505904197693, -0.060611601918935776, -0.27926167845726013, -0.3125561475753784, -0.012684918940067291, 0.3436252176761627, -0.03880852088332176, 0.19665823876857758, 0.3966353237628937, -0.003710838034749031, -0.04928696155548096, 0.3218395411968231, -0.25919410586357117, 0.1362648606300354, 0.21974143385887146, 0.1004931852221489, -0.1267774999141693, 0.032085977494716644, -0.27670836448669434, -0.3809218108654022, -0.05908563733100891, -0.07073186337947845, 0.10871957242488861, -0.08116020262241364, -0.43348148465156555, -0.0175075251609087, -0.217787504196167, -0.09292884916067123, 0.33714404702186584, 0.4244591295719147, -0.15187618136405945, 0.15057247877120972, 0.06234104931354523, 0.019984476268291473, -0.3888360857963562, -0.14296992123126984, -0.21636418998241425, 0.054500363767147064, -0.05543610826134682, 0.25463902950286865, 0.04124891757965088, -0.1426718533039093, 0.3838997483253479, 0.06640961021184921, 0.19650280475616455, -0.26958978176116943, 0.15935082733631134, -0.1440529227256775, -0.31903088092803955, 0.17554031312465668, -0.09773799031972885, 0.27127355337142944, -0.12288355827331543, 0.23791705071926117, -0.18254026770591736, -0.1318145990371704, -0.4965314567089081, -0.605414867401123, -0.009632695466279984, 0.20626938343048096, -0.00019497424364089966, 0.23316243290901184, -0.1287032961845398, 0.24085702002048492, 0.21097034215927124, -0.1381370723247528, -0.02151704952120781, -0.04939362406730652, -0.47924408316612244, 0.116788849234581, 0.5768749713897705, 0.5262378454208374, -0.12718255817890167, -0.24952232837677002, 0.0727444738149643, -0.03880864381790161, 0.4893048107624054, 0.7316663265228271, -0.23294804990291595, 0.41346126794815063, -0.31961360573768616, 0.20157486200332642, 0.4372560977935791, -0.044916439801454544, -0.3386627733707428, 0.43551746010780334, -0.36171841621398926, 0.1388956904411316, 0.4095099866390228, 0.11344663798809052, 0.1826280951499939, -0.039261650294065475, 0.1894780397415161, 0.4380929172039032, 0.061782106757164, 0.28299087285995483, -0.3728742003440857, -0.3537999391555786, 0.24893295764923096, 0.3203558027744293, -0.20862789452075958, 0.027443500235676765, -0.14035671949386597, 0.5666725039482117, 0.4002740681171417, 0.0007955608889460564, -0.052390530705451965, 0.2795940637588501, 0.04887627065181732, -0.16764989495277405, 0.09840865433216095, -0.005191534757614136, -0.31271740794181824, 0.24837523698806763, -0.1556539237499237, 0.17020486295223236, 0.1193213239312172, -0.03799315541982651, -0.3717491626739502, -0.19502902030944824, -0.31480780243873596, -0.15537753701210022, 0.08024303615093231, -0.1608714908361435, 0.3632439970970154, -0.003625638782978058, 0.1314968317747116, 0.44009754061698914, -0.044134579598903656, 0.14292410016059875, -0.5844371914863586, 0.18531785905361176, 0.12875059247016907, -0.07791733741760254, 0.11590437591075897, 0.21561819314956665, 0.07316510379314423, -0.1612776219844818, -0.183213472366333, 0.5104206800460815, 0.18040871620178223, 0.36574068665504456, -0.24072912335395813, -0.060478612780570984, 0.1507830023765564, -0.14898279309272766, 0.05183219909667969, 0.03855237737298012, -0.03335590288043022, -0.15786127746105194, -0.03303674980998039, 0.3494122624397278, -0.09975752234458923, 0.15035872161388397, -0.09804021567106247, -0.06229139864444733, 0.027822643518447876, 0.01617617905139923, -0.025215815752744675, -0.07043898105621338, 0.3467121124267578, 0.044471465051174164, 0.6391889452934265, 0.299226313829422, -0.04305706173181534, -0.12896747887134552, 0.5586972832679749, -0.1679665446281433, -0.04630730301141739, 0.19791850447654724, -0.13411928713321686, -0.31376489996910095, 0.011422837153077126, -0.10546661168336868, 0.23832854628562927, 0.14643792808055878, -0.041033048182725906, -0.04254324361681938, 0.16876059770584106, -0.2622798681259155, 0.2916322350502014, 0.16055890917778015, 0.08184763789176941, 0.22291716933250427, 0.08703097701072693, -0.0756145715713501, -0.42438608407974243, -0.15842148661613464, 0.18333938717842102, 0.29082179069519043, -0.2637763023376465, 0.006044648587703705, -0.0976843610405922, 0.1507491171360016, -0.31594690680503845, 0.06671199947595596, -0.06868094205856323, 0.026116929948329926, 0.17701660096645355, 0.13491633534431458, -0.05174057185649872, 0.2070053368806839, 0.025260284543037415, 0.11894245445728302, 0.3613814115524292, -0.3030950129032135, -0.29531729221343994, 0.2190971076488495, 0.06086774542927742, 0.06569882482290268, 0.06190700829029083, 0.24916772544384003, 0.030373597517609596, -0.23295971751213074, -0.1532965749502182, 0.16914314031600952, -0.092789426445961, 0.019856691360473633, -0.08806733787059784, 0.26414087414741516, 0.1245834231376648, 0.011568740010261536, 0.15064489841461182, -0.42516058683395386, 0.24080762267112732, 0.0656823068857193, -0.2764616310596466, 0.3139338493347168, -0.18367509543895721, 0.19470226764678955, -0.08769400417804718, -0.6062119007110596, -0.07710050791501999, -0.3275842070579529, 0.29544591903686523, -0.31370866298675537, 0.07911010086536407, 0.13157391548156738, -0.009068846702575684, 0.10968221724033356, -0.0753057450056076, 0.1721373349428177, -0.186663419008255, -0.32339149713516235, 0.37042436003685, -0.14954757690429688, -0.03800084441900253, -0.4017985463142395, -0.16020672023296356, 0.39991867542266846, -0.1364908367395401, -0.23387813568115234, 0.0735277384519577, -0.3537715971469879, 0.02345176786184311, -0.14355988800525665, -0.26809319853782654, 0.26947176456451416, -0.1016215980052948, 0.017971839755773544, 0.19487009942531586, -0.057681430131196976, 0.4015558063983917, 0.04156352952122688, -0.07826048880815506, -0.20791706442832947, 0.5625293254852295, -0.09637214988470078, 0.8373690843582153, 0.43708184361457825, 0.17743659019470215, -0.03091735765337944, -0.043131157755851746, -0.15139971673488617, -0.2768421173095703, -0.19356131553649902, 0.28397098183631897, -0.05746188014745712, -0.22941872477531433, 0.2939748764038086, -0.02697317861020565, -0.034971218556165695, 0.05807647854089737, -0.0074226632714271545, -0.04932297021150589, -0.3180757761001587, 0.09886357188224792, -0.08641234040260315, 0.04304702579975128, -0.06782376021146774, 0.17710590362548828, 0.11667439341545105, -0.1679520308971405, 0.13977333903312683, 0.04769037291407585, 0.30821022391319275, -0.09581336379051208, -0.3515584468841553, 0.025554046034812927, -0.6309386491775513, -0.029572777450084686, 0.18705213069915771, 0.12150466442108154, -0.04707920923829079, -0.18535825610160828, 0.33323270082473755, 0.1744772344827652, 0.6720073223114014, 0.2988261878490448, -0.02578101120889187, -0.08839600533246994, -0.2986564338207245, -0.12440873682498932, 0.01687627285718918, -0.14359214901924133, -0.16725802421569824, 0.3965612053871155, 0.42015647888183594, -0.40648210048675537, -0.2999268174171448, 0.1811983436346054, 0.13909116387367249, -0.141770601272583, -0.12767329812049866, -0.2644796073436737, -0.010086290538311005, -0.1399286687374115, 0.23131680488586426, 0.09281183779239655, 0.35863494873046875, -0.2995504140853882, -0.39550644159317017, 0.21640950441360474, -0.1948106288909912, 0.15862134099006653, 0.2328232228755951, 0.3347761332988739, -0.05504745990037918, 0.5648508667945862, 0.33859357237815857, 0.02134648710489273, -0.18338121473789215, 0.3916037976741791, -0.10146673023700714, -0.2564822733402252, 0.21943533420562744, 0.11751697957515717, 0.21360927820205688, 0.28898823261260986, -0.2655247449874878, 0.1697675585746765, 0.07091347873210907, 0.3893102705478668, -0.3147008717060089, 0.128178671002388, 0.4567511975765228, -0.015305355191230774, -0.18893776834011078, -0.3553456664085388, 0.174466073513031, -0.004192192107439041, 0.037861213088035583, -0.14715975522994995, -0.1644383668899536, -0.11922761052846909, 0.3455888032913208, -0.1384059190750122, 0.7162400484085083, -0.2308788299560547, 0.05941283702850342, 0.35391393303871155, 0.25165194272994995, 0.3926123082637787, -0.2668452262878418, 0.17179635167121887, -0.30360549688339233, -0.17180819809436798, 0.1800735890865326, -0.04891030117869377, -0.17689895629882812, 0.1189327985048294, -0.14116540551185608, 0.2698654234409332, 0.11472825706005096, -0.021812917664647102, -0.3022581934928894, 0.29769834876060486, 0.12487664818763733, -0.3740997910499573, -0.21252234280109406, 0.05746930092573166, -0.15391480922698975, 0.255570650100708, 0.26273655891418457, -0.13983121514320374, 0.08958564698696136, -0.2002016305923462, -0.034943126142024994, 0.09185706079006195, -0.30647069215774536, 0.20479534566402435, -0.0374329574406147, -0.24345895648002625, 0.14317503571510315, 0.24945957958698273, -0.10638922452926636, 0.21912595629692078, -0.06784870475530624, 0.11973733454942703, -0.11328686773777008, 0.1900148242712021, 0.0723315179347992, -0.18005166947841644, 0.2101178765296936, 0.17084352672100067, -0.11766970157623291, -0.0034297220408916473, -0.19016462564468384, -0.21817569434642792, 0.1165732741355896, -0.1462191641330719, 0.17186860740184784, -0.28727293014526367, -0.09010151773691177, -0.0063965581357479095, -0.06437130272388458, -0.35671067237854004, 0.11748918145895004, 0.22441157698631287, -0.254563570022583, 0.1304791271686554, -0.06163090467453003, -0.3135988712310791, -0.08341705799102783, 0.3424531817436218, 0.09072743356227875, 0.11294513940811157, 0.6744592189788818, 0.08011272549629211, -0.05256032571196556, -0.21471713483333588, 0.11264673620462418, 0.19776591658592224, -0.8890566825866699, 0.199479341506958, 0.07660172879695892, 0.03760699927806854, -0.1378762573003769, 0.18659603595733643, -0.09502911567687988, -0.1380399465560913, -0.014070197939872742, -0.13807107508182526, -0.4365449845790863, 0.08505082130432129, 0.037617675960063934, 0.12398786097764969, -0.11604298651218414, 0.03400836139917374, -0.3553750813007355, 0.2995070815086365, -0.2744944095611572, -0.010980721563100815, -0.275850772857666, 0.07556025683879852, 0.11585788428783417, -0.31610730290412903, 0.40434935688972473, 0.19064685702323914, 0.1551048755645752, 0.16928106546401978, -0.04317481443285942, -0.17626182734966278, -0.23458261787891388, 0.03240281343460083, -0.18844203650951385, -0.1446383148431778, -0.012307465076446533, 0.23016607761383057, -0.2457309067249298, -0.19472180306911469, 0.3204093873500824, 0.15687298774719238, 0.2107611447572708, 0.11295755207538605, 0.14168156683444977, -0.12426095455884933, -0.2579440474510193, 0.19450929760932922, -0.2969168722629547, -0.003248952329158783, 0.0727573037147522, 0.1692885160446167, -0.10174751281738281, -0.16773439943790436, -0.11112421005964279, 0.08680073171854019, 0.3071422874927521, -0.0367969311773777, 0.1555088758468628, -0.15167763829231262, -0.2872699201107025, 0.14017775654792786, 0.22689561545848846, 0.24801822006702423, 0.03508735075592995, -0.1270942986011505, 0.0835651159286499, 0.23533543944358826, -0.05844925343990326, 0.01918315887451172, -0.11487501114606857, -0.23636597394943237, 0.14540238678455353, 0.273586630821228, 0.0004759356379508972, 0.22284284234046936, 0.1767118126153946, 0.011451225727796555, 0.05872255936264992, 0.15346884727478027, 0.09693542122840881, 0.46631157398223877, 0.2062390297651291, 0.03388776630163193, 0.21720339357852936, -0.016880590468645096, 0.2643589675426483, 0.18412993848323822, -0.24076437950134277, 0.3734259605407715, -0.3128921687602997, 0.5481714606285095, 0.08261660486459732, -0.1365624964237213, -0.40354233980178833, 0.2889455556869507, -0.49390196800231934, -0.13489298522472382, -0.35521554946899414, 0.5778172612190247, -0.2575841546058655, -0.11378803104162216, -0.43206891417503357, 0.2515677809715271, -0.20957043766975403, -0.2579479217529297, 0.061286091804504395, -0.02311365306377411, -0.4049149453639984, 0.08407722413539886, 0.11222557723522186, 0.013127589598298073, 0.0884142816066742, 0.032671015709638596, 0.09105537831783295, -0.003804527223110199, -0.4402088224887848, 0.2551165819168091, -0.04904685541987419, -0.35338157415390015, 0.17214731872081757, -0.010347530245780945, -0.14693227410316467, 0.23728840053081512, 0.20885178446769714, 0.11532534658908844, 0.09531168639659882, 0.015038259327411652, -0.08165378123521805, 0.19621345400810242, 0.01918971538543701, -0.0059846676886081696, 0.44592681527137756, 0.02619619108736515, 0.13986027240753174, 0.18494348227977753, 0.06053439527750015, -0.21330147981643677, -0.13203953206539154, -0.07799966633319855, 0.14797362685203552, -0.476847380399704, 0.5830920934677124, -0.10840938240289688, -0.019309915602207184, -0.3616848886013031, -0.042277563363313675, -0.3304792642593384, 0.04203103110194206, 0.06589189171791077, -0.2807058095932007, 0.010751929134130478, -0.021211998537182808, 0.06833946704864502, -0.18923704326152802, 0.509807825088501, 0.015102403238415718, 0.046427078545093536, -0.43393510580062866, -0.04722421616315842, -0.33027946949005127, -0.1255647838115692, 0.15068218111991882, 0.33530789613723755, -0.00020198151469230652, 0.32247424125671387, -0.16652531921863556, 0.1909591406583786, -0.24930927157402039, -0.07832816243171692, -0.2522062659263611, 0.0023310501128435135, -0.18594610691070557, 0.16350539028644562, -0.5375804901123047, -0.006978761404752731, 0.030018500983715057, -0.42346465587615967, 0.25240814685821533, 0.2999712824821472, -0.07995086908340454, -0.003433428704738617, 0.10941678285598755, -0.016798291355371475, 0.028700878843665123, 0.18435269594192505, 0.2235986292362213, -0.008420880883932114, -0.1586717665195465, 0.07603061199188232, -0.12415779381990433, -0.2479560822248459, -0.17510151863098145, -0.1328796148300171, -0.008828170597553253, 0.5314242839813232, 0.18377916514873505, 0.05975022166967392, -0.4424782395362854, 0.30962613224983215, 0.18748988211154938, -0.512605607509613, -0.29363203048706055, 0.1803491860628128, -0.14690342545509338, 0.29369279742240906, 0.29221001267433167, 0.19661277532577515, 0.05017120763659477, -0.019496381282806396, -0.20699521899223328, -0.2919589877128601, 0.40209856629371643, -0.3442244529724121, 0.152245432138443, -0.2067611962556839, 0.41427022218704224, 0.3039453625679016, -0.02377377450466156, -0.2469828873872757, 0.07746362686157227, 0.24087244272232056, 0.06539085507392883, 0.19802284240722656, 0.32208967208862305, 0.06829549372196198, 0.08109426498413086, -0.1640125811100006, 0.2777669131755829, 0.10273396968841553, -0.16305354237556458, 0.22855746746063232, -0.3313462436199188 ]
https://github.com/huggingface/datasets/issues/5990
Hi @AntreasAntoniou , sorry to know you are facing this issue. To help debugging it, could you tell me: - What is the total dataset size? - Is it always failing on the same shard or is the hanging problem happening randomly? - Were you able to save the dataset as parquet locally? This would help us determine if the problem comes from the upload or the file generation. I'm cc-ing @lhoestq who might have some insights from a `datasets` perspective.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
81
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Hi @AntreasAntoniou , sorry to know you are facing this issue. To help debugging it, could you tell me: - What is the total dataset size? - Is it always failing on the same shard or is the hanging problem happening randomly? - Were you able to save the dataset as parquet locally? This would help us determine if the problem comes from the upload or the file generation. I'm cc-ing @lhoestq who might have some insights from a `datasets` perspective.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
One trick that can also help is to check the traceback when you kill your python process: it will show where in the code it was hanging
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
27
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` One trick that can also help is to check the traceback when you kill your python process: it will show where in the code it was hanging
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
Right. So I did the trick @lhoestq suggested. Here is where things seem to hang ``` Error while uploading 'data/train-00120-of-00195-466c2dbab2eb9989.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.15s/ba] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:52<00:00, 52.12s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.08s/ba] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:45<00:00, 45.54s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.08s/ba] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.03s/ba^Upload 1 LFS files: 0%| | 0/1 [ 21:27:35<?, ?it/s] Pushing dataset shards to the dataset hub: 63%|█████████████████████████████████████████████████████████████▎ | 122/195 [23:37:11<14:07:59, 696.98s/it] ^CError in sys.excepthook: Traceback (most recent call last): File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1699, in print extend(render(renderable, render_options)) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1335, in render yield from self.render(render_output, _options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/constrain.py", line 29, in __rich_console__ yield from console.render(self.renderable, child_options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/panel.py", line 220, in __rich_console__ lines = console.render_lines(renderable, child_options, style=style) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1371, in render_lines lines = list( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 292, in split_and_crop_lines for segment in segments: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/padding.py", line 97, in __rich_console__ lines = console.render_lines( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1371, in render_lines lines = list( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 292, in split_and_crop_lines for segment in segments: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1335, in render yield from self.render(render_output, _options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/syntax.py", line 611, in __rich_console__ segments = Segments(self._get_syntax(console, options)) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 668, in __init__ self.segments = list(segments) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/syntax.py", line 674, in _get_syntax lines: Union[List[Text], Lines] = text.split("\n", allow_blank=ends_on_nl) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 1042, in split lines = Lines( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/containers.py", line 70, in __init__ self._lines: List["Text"] = list(lines) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 1043, in <genexpr> line for line in self.divide(flatten_spans()) if line.plain != separator File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 385, in plain if len(self._text) != 1: KeyboardInterrupt Original exception was: Traceback (most recent call last): File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator yield _result_or_cancel(fs.pop()) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel return fut.result(timeout) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 453, in result self._condition.wait(timeout) File "/opt/conda/envs/main/lib/python3.10/threading.py", line 320, in wait waiter.acquire() KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/TALI/tali/scripts/validate_dataset.py", line 127, in <module> train_dataset.push_to_hub(repo_id="Antreas/TALI-base", max_shard_size="5GB") File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/dataset_dict.py", line 1583, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 5275, in _push_parquet_shards_to_hub _retry( File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 282, in _retry return func(*func_args, **func_kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 826, in _inner return fn(self, *args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3205, in upload_file commit_info = self.create_commit( File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 826, in _inner return fn(self, *args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2680, in create_commit upload_lfs_files( File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/_commit_api.py", line 353, in upload_lfs_files thread_map( File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 49, in _executor_map with PoolExecutor(max_workers=max_workers, initializer=tqdm_class.set_lock, File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 649, in __exit__ self.shutdown(wait=True) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/thread.py", line 235, in shutdown t.join() File "/opt/conda/envs/main/lib/python3.10/threading.py", line 1096, in join self._wait_for_tstate_lock() File "/opt/conda/envs/main/lib/python3.10/threading.py", line 1116, in _wait_for_tstate_lock if lock.acquire(block, timeout): KeyboardInterrupt ```
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
556
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Right. So I did the trick @lhoestq suggested. Here is where things seem to hang ``` Error while uploading 'data/train-00120-of-00195-466c2dbab2eb9989.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.15s/ba] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:52<00:00, 52.12s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.08s/ba] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:45<00:00, 45.54s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.08s/ba] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:03<00:00, 1.03s/ba^Upload 1 LFS files: 0%| | 0/1 [ 21:27:35<?, ?it/s] Pushing dataset shards to the dataset hub: 63%|█████████████████████████████████████████████████████████████▎ | 122/195 [23:37:11<14:07:59, 696.98s/it] ^CError in sys.excepthook: Traceback (most recent call last): File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1699, in print extend(render(renderable, render_options)) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1335, in render yield from self.render(render_output, _options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/constrain.py", line 29, in __rich_console__ yield from console.render(self.renderable, child_options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/panel.py", line 220, in __rich_console__ lines = console.render_lines(renderable, child_options, style=style) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1371, in render_lines lines = list( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 292, in split_and_crop_lines for segment in segments: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/padding.py", line 97, in __rich_console__ lines = console.render_lines( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1371, in render_lines lines = list( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 292, in split_and_crop_lines for segment in segments: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1335, in render yield from self.render(render_output, _options) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/console.py", line 1331, in render for render_output in iter_render: File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/syntax.py", line 611, in __rich_console__ segments = Segments(self._get_syntax(console, options)) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/segment.py", line 668, in __init__ self.segments = list(segments) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/syntax.py", line 674, in _get_syntax lines: Union[List[Text], Lines] = text.split("\n", allow_blank=ends_on_nl) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 1042, in split lines = Lines( File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/containers.py", line 70, in __init__ self._lines: List["Text"] = list(lines) File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 1043, in <genexpr> line for line in self.divide(flatten_spans()) if line.plain != separator File "/opt/conda/envs/main/lib/python3.10/site-packages/rich/text.py", line 385, in plain if len(self._text) != 1: KeyboardInterrupt Original exception was: Traceback (most recent call last): File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator yield _result_or_cancel(fs.pop()) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel return fut.result(timeout) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 453, in result self._condition.wait(timeout) File "/opt/conda/envs/main/lib/python3.10/threading.py", line 320, in wait waiter.acquire() KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/TALI/tali/scripts/validate_dataset.py", line 127, in <module> train_dataset.push_to_hub(repo_id="Antreas/TALI-base", max_shard_size="5GB") File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/dataset_dict.py", line 1583, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 5275, in _push_parquet_shards_to_hub _retry( File "/opt/conda/envs/main/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 282, in _retry return func(*func_args, **func_kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 826, in _inner return fn(self, *args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3205, in upload_file commit_info = self.create_commit( File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 826, in _inner return fn(self, *args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2680, in create_commit upload_lfs_files( File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/_commit_api.py", line 353, in upload_lfs_files thread_map( File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) File "/opt/conda/envs/main/lib/python3.10/site-packages/tqdm/contrib/concurrent.py", line 49, in _executor_map with PoolExecutor(max_workers=max_workers, initializer=tqdm_class.set_lock, File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/_base.py", line 649, in __exit__ self.shutdown(wait=True) File "/opt/conda/envs/main/lib/python3.10/concurrent/futures/thread.py", line 235, in shutdown t.join() File "/opt/conda/envs/main/lib/python3.10/threading.py", line 1096, in join self._wait_for_tstate_lock() File "/opt/conda/envs/main/lib/python3.10/threading.py", line 1116, in _wait_for_tstate_lock if lock.acquire(block, timeout): KeyboardInterrupt ```
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
@Wauplin >What is the total dataset size? There are three variants, and the random hanging happens on all three. The sizes are 2TB, 1TB, and 200GB. >Is it always failing on the same shard or is the hanging problem happening randomly? It seems to be very much random, as restarting can help move past the previous hang, only to find a new one, or not. >Were you able to save the dataset as parquet locally? This would help us determine if the problem comes from the upload or the file generation. Yes. The dataset seems to be locally stored as parquet.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
101
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` @Wauplin >What is the total dataset size? There are three variants, and the random hanging happens on all three. The sizes are 2TB, 1TB, and 200GB. >Is it always failing on the same shard or is the hanging problem happening randomly? It seems to be very much random, as restarting can help move past the previous hang, only to find a new one, or not. >Were you able to save the dataset as parquet locally? This would help us determine if the problem comes from the upload or the file generation. Yes. The dataset seems to be locally stored as parquet.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
Hmm it looks like an issue with TQDM lock. Maybe you can try updating TQDM ?
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
16
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Hmm it looks like an issue with TQDM lock. Maybe you can try updating TQDM ?
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
I am using the latest version of tqdm ``` ⬢ [Docker] ❯ pip install tqdm --upgrade Requirement already satisfied: tqdm in /opt/conda/envs/main/lib/python3.10/site-packages (4.65.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv ```
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
54
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` I am using the latest version of tqdm ``` ⬢ [Docker] ❯ pip install tqdm --upgrade Requirement already satisfied: tqdm in /opt/conda/envs/main/lib/python3.10/site-packages (4.65.0) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv ```
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
I tried trying to catch the hanging issue in action again ``` Pushing dataset shards to the dataset hub: 65%|█████████████████████████████████████████████████████████████████▊ | 127/195 [2:28:02<1:19:15, 69.94s/it] Error while uploading 'data/train-00127-of-00195-3f8d036ade107c27.parquet' to the Hub. Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 64%|████████████████████████████████████████████████████████████████▏ | 124/195 [2:06:10<1:12:14, 61.05s/it]C^[^C^C^C ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /TALI/tali/scripts/validate_dataset.py:127 in <module> │ │ │ │ 124 │ │ │ 125 │ while not succesful_competion: │ │ 126 │ │ try: │ │ ❱ 127 │ │ │ train_dataset.push_to_hub(repo_id="Antreas/TALI-base", max_shard_size="5GB") │ │ 128 │ │ │ succesful_competion = True │ │ 129 │ │ except Exception as e: │ │ 130 │ │ │ print(e) │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/dataset_dict.py:1583 in push_to_hub │ │ │ │ 1580 │ │ for split in self.keys(): │ │ 1581 │ │ │ logger.warning(f"Pushing split {split} to the Hub.") │ │ 1582 │ │ │ # The split=key needs to be removed before merging │ │ ❱ 1583 │ │ │ repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parq │ │ 1584 │ │ │ │ repo_id, │ │ 1585 │ │ │ │ split=split, │ │ 1586 │ │ │ │ private=private, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:5263 in │ │ _push_parquet_shards_to_hub │ │ │ │ 5260 │ │ │ │ 5261 │ │ uploaded_size = 0 │ │ 5262 │ │ shards_path_in_repo = [] │ │ ❱ 5263 │ │ for index, shard in logging.tqdm( │ │ 5264 │ │ │ enumerate(itertools.chain([first_shard], shards_iter)), │ │ 5265 │ │ │ desc="Pushing dataset shards to the dataset hub", │ │ 5266 │ │ │ total=num_shards, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/tqdm/std.py:1178 in __iter__ │ │ │ │ 1175 │ │ time = self._time │ │ 1176 │ │ │ │ 1177 │ │ try: │ │ ❱ 1178 │ │ │ for obj in iterable: │ │ 1179 │ │ │ │ yield obj │ │ 1180 │ │ │ │ # Update and possibly print the progressbar. │ │ 1181 │ │ │ │ # Note: does not call self.update(1) for speed optimisation. │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:5238 in │ │ shards_with_embedded_external_files │ │ │ │ 5235 │ │ │ │ for shard in shards: │ │ 5236 │ │ │ │ │ format = shard.format │ │ 5237 │ │ │ │ │ shard = shard.with_format("arrow") │ │ ❱ 5238 │ │ │ │ │ shard = shard.map( │ │ 5239 │ │ │ │ │ │ embed_table_storage, │ │ 5240 │ │ │ │ │ │ batched=True, │ │ 5241 │ │ │ │ │ │ batch_size=1000, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:578 in wrapper │ │ │ │ 575 │ │ else: │ │ 576 │ │ │ self: "Dataset" = kwargs.pop("self") │ │ 577 │ │ # apply actual function │ │ ❱ 578 │ │ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) │ │ 579 │ │ datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [ou │ │ 580 │ │ for dataset in datasets: │ │ 581 │ │ │ # Remove task templates if a column mapping of the template is no longer val │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:543 in wrapper │ │ │ │ 540 │ │ │ "output_all_columns": self._output_all_columns, │ │ 541 │ │ } │ │ 542 │ │ # apply actual function │ │ ❱ 543 │ │ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) │ │ 544 │ │ datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [ou │ │ 545 │ │ # re-apply format to the output │ │ 546 │ │ for dataset in datasets: │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:3073 in map │ │ │ │ 3070 │ │ │ │ │ leave=False, │ │ 3071 │ │ │ │ │ desc=desc or "Map", │ │ 3072 │ │ │ │ ) as pbar: │ │ ❱ 3073 │ │ │ │ │ for rank, done, content in Dataset._map_single(**dataset_kwargs): │ │ 3074 │ │ │ │ │ │ if done: │ │ 3075 │ │ │ │ │ │ │ shards_done += 1 │ │ 3076 │ │ │ │ │ │ │ logger.debug(f"Finished processing shard number {rank} of {n │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:3464 in _map_single │ │ │ │ 3461 │ │ │ │ │ │ │ │ buf_writer, writer, tmp_file = init_buffer_and_writer() │ │ 3462 │ │ │ │ │ │ │ │ stack.enter_context(writer) │ │ 3463 │ │ │ │ │ │ │ if isinstance(batch, pa.Table): │ │ ❱ 3464 │ │ │ │ │ │ │ │ writer.write_table(batch) │ │ 3465 │ │ │ │ │ │ │ else: │ │ 3466 │ │ │ │ │ │ │ │ writer.write_batch(batch) │ │ 3467 │ │ │ │ │ │ num_examples_progress_update += num_examples_in_batch │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_writer.py:567 in write_table │ │ │ │ 564 │ │ │ writer_batch_size = self.writer_batch_size │ │ 565 │ │ if self.pa_writer is None: │ │ 566 │ │ │ self._build_writer(inferred_schema=pa_table.schema) │ │ ❱ 567 │ │ pa_table = pa_table.combine_chunks() │ │ 568 │ │ pa_table = table_cast(pa_table, self._schema) │ │ 569 │ │ if self.embed_local_files: │ │ 570 │ │ │ pa_table = embed_table_storage(pa_table) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyboardInterrupt ```
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
867
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` I tried trying to catch the hanging issue in action again ``` Pushing dataset shards to the dataset hub: 65%|█████████████████████████████████████████████████████████████████▊ | 127/195 [2:28:02<1:19:15, 69.94s/it] Error while uploading 'data/train-00127-of-00195-3f8d036ade107c27.parquet' to the Hub. Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 64%|████████████████████████████████████████████████████████████████▏ | 124/195 [2:06:10<1:12:14, 61.05s/it]C^[^C^C^C ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /TALI/tali/scripts/validate_dataset.py:127 in <module> │ │ │ │ 124 │ │ │ 125 │ while not succesful_competion: │ │ 126 │ │ try: │ │ ❱ 127 │ │ │ train_dataset.push_to_hub(repo_id="Antreas/TALI-base", max_shard_size="5GB") │ │ 128 │ │ │ succesful_competion = True │ │ 129 │ │ except Exception as e: │ │ 130 │ │ │ print(e) │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/dataset_dict.py:1583 in push_to_hub │ │ │ │ 1580 │ │ for split in self.keys(): │ │ 1581 │ │ │ logger.warning(f"Pushing split {split} to the Hub.") │ │ 1582 │ │ │ # The split=key needs to be removed before merging │ │ ❱ 1583 │ │ │ repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parq │ │ 1584 │ │ │ │ repo_id, │ │ 1585 │ │ │ │ split=split, │ │ 1586 │ │ │ │ private=private, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:5263 in │ │ _push_parquet_shards_to_hub │ │ │ │ 5260 │ │ │ │ 5261 │ │ uploaded_size = 0 │ │ 5262 │ │ shards_path_in_repo = [] │ │ ❱ 5263 │ │ for index, shard in logging.tqdm( │ │ 5264 │ │ │ enumerate(itertools.chain([first_shard], shards_iter)), │ │ 5265 │ │ │ desc="Pushing dataset shards to the dataset hub", │ │ 5266 │ │ │ total=num_shards, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/tqdm/std.py:1178 in __iter__ │ │ │ │ 1175 │ │ time = self._time │ │ 1176 │ │ │ │ 1177 │ │ try: │ │ ❱ 1178 │ │ │ for obj in iterable: │ │ 1179 │ │ │ │ yield obj │ │ 1180 │ │ │ │ # Update and possibly print the progressbar. │ │ 1181 │ │ │ │ # Note: does not call self.update(1) for speed optimisation. │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:5238 in │ │ shards_with_embedded_external_files │ │ │ │ 5235 │ │ │ │ for shard in shards: │ │ 5236 │ │ │ │ │ format = shard.format │ │ 5237 │ │ │ │ │ shard = shard.with_format("arrow") │ │ ❱ 5238 │ │ │ │ │ shard = shard.map( │ │ 5239 │ │ │ │ │ │ embed_table_storage, │ │ 5240 │ │ │ │ │ │ batched=True, │ │ 5241 │ │ │ │ │ │ batch_size=1000, │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:578 in wrapper │ │ │ │ 575 │ │ else: │ │ 576 │ │ │ self: "Dataset" = kwargs.pop("self") │ │ 577 │ │ # apply actual function │ │ ❱ 578 │ │ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) │ │ 579 │ │ datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [ou │ │ 580 │ │ for dataset in datasets: │ │ 581 │ │ │ # Remove task templates if a column mapping of the template is no longer val │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:543 in wrapper │ │ │ │ 540 │ │ │ "output_all_columns": self._output_all_columns, │ │ 541 │ │ } │ │ 542 │ │ # apply actual function │ │ ❱ 543 │ │ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) │ │ 544 │ │ datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [ou │ │ 545 │ │ # re-apply format to the output │ │ 546 │ │ for dataset in datasets: │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:3073 in map │ │ │ │ 3070 │ │ │ │ │ leave=False, │ │ 3071 │ │ │ │ │ desc=desc or "Map", │ │ 3072 │ │ │ │ ) as pbar: │ │ ❱ 3073 │ │ │ │ │ for rank, done, content in Dataset._map_single(**dataset_kwargs): │ │ 3074 │ │ │ │ │ │ if done: │ │ 3075 │ │ │ │ │ │ │ shards_done += 1 │ │ 3076 │ │ │ │ │ │ │ logger.debug(f"Finished processing shard number {rank} of {n │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_dataset.py:3464 in _map_single │ │ │ │ 3461 │ │ │ │ │ │ │ │ buf_writer, writer, tmp_file = init_buffer_and_writer() │ │ 3462 │ │ │ │ │ │ │ │ stack.enter_context(writer) │ │ 3463 │ │ │ │ │ │ │ if isinstance(batch, pa.Table): │ │ ❱ 3464 │ │ │ │ │ │ │ │ writer.write_table(batch) │ │ 3465 │ │ │ │ │ │ │ else: │ │ 3466 │ │ │ │ │ │ │ │ writer.write_batch(batch) │ │ 3467 │ │ │ │ │ │ num_examples_progress_update += num_examples_in_batch │ │ │ │ /opt/conda/envs/main/lib/python3.10/site-packages/datasets/arrow_writer.py:567 in write_table │ │ │ │ 564 │ │ │ writer_batch_size = self.writer_batch_size │ │ 565 │ │ if self.pa_writer is None: │ │ 566 │ │ │ self._build_writer(inferred_schema=pa_table.schema) │ │ ❱ 567 │ │ pa_table = pa_table.combine_chunks() │ │ 568 │ │ pa_table = table_cast(pa_table, self._schema) │ │ 569 │ │ if self.embed_local_files: │ │ 570 │ │ │ pa_table = embed_table_storage(pa_table) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyboardInterrupt ```
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
I'm on my phone so can't help that much. What I'd advice to do is to [save_to_disk](https://huggingface.co/docs/datasets/package_reference/main_classes#save_to_disk) if it's not already done and then upload the files/folder to the Hub separately. You can find what you need in the [upload guide](https://huggingface.co/docs/huggingface_hub/guides/upload). It might not help finding the exact issue for now but at least it can unblock you.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
58
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` I'm on my phone so can't help that much. What I'd advice to do is to [save_to_disk](https://huggingface.co/docs/datasets/package_reference/main_classes#save_to_disk) if it's not already done and then upload the files/folder to the Hub separately. You can find what you need in the [upload guide](https://huggingface.co/docs/huggingface_hub/guides/upload). It might not help finding the exact issue for now but at least it can unblock you.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
In your last stacktrace it interrupted while embedding external content - in case your dataset in made of images or audio files that live on your disk. Is it the case ?
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
32
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` In your last stacktrace it interrupted while embedding external content - in case your dataset in made of images or audio files that live on your disk. Is it the case ?
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
It's maybe related to https://github.com/apache/arrow/issues/34455: are you using ArrayND features ? Also what's your `pyarrow` version ? Could you try updating to >= 12.0.1 ?
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
25
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` It's maybe related to https://github.com/apache/arrow/issues/34455: are you using ArrayND features ? Also what's your `pyarrow` version ? Could you try updating to >= 12.0.1 ?
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
I was using pyarrow == 12.0.0 I am not explicitly using ArrayND features, unless the hub API automatically converts my files to such.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
23
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` I was using pyarrow == 12.0.0 I am not explicitly using ArrayND features, unless the hub API automatically converts my files to such.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
You can also try to reduce the `max_shard_size` - Sometimes parquet has a hard time working with data bigger than 2GB
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
21
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` You can also try to reduce the `max_shard_size` - Sometimes parquet has a hard time working with data bigger than 2GB
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
So, updating the pyarrow seems to help. It can still throw errors here and there but I can retry when that happens. It's better than hanging. However, I am a bit confused about something. I have uploaded my datasets, but while earlier I could see all three sets, now I can only see 1. What's going on? https://huggingface.co/datasets/Antreas/TALI-base I have seen this happen before as well, so I deleted and reuploaded, but this dataset is way too large for me to do this.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
83
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` So, updating the pyarrow seems to help. It can still throw errors here and there but I can retry when that happens. It's better than hanging. However, I am a bit confused about something. I have uploaded my datasets, but while earlier I could see all three sets, now I can only see 1. What's going on? https://huggingface.co/datasets/Antreas/TALI-base I have seen this happen before as well, so I deleted and reuploaded, but this dataset is way too large for me to do this.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
It's a bug on our side, I'll update the dataset viewer ;) Thanks for reporting !
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
16
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` It's a bug on our side, I'll update the dataset viewer ;) Thanks for reporting !
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]